Does not recognize the results of the second test module.
Describe the bug Does not recognize the results of the second test module.
To Reproduce
Directory structure:
myproject/
├── foobar1/
│ ├── module1.py
│ └── module2.py
├── foobar2/
│ ├── module3.py
│ └── module4.py
└── tests/
├── test_module1.py
└── test_module2.py
└── test_module3.py
└── test_module4.py
The following command is used to generate coverage:
pytest tests --cov-report xml:cov.xml --cov foobar1 --cov foobar2
This generates the cov.xml file with the following content:
...
<sources>
<source>/Users/username/projects/myproject/foobar1</source>
<source>/Users/username/projects/myproject/foobar2</source>
</sources>
...
In VSCode, modules from foobar1 are highlighted correctly, but modules from foobar2 show "No Coverage." If the first module is commented out in cov.xml:
<sources>
<!-- <source>/Users/username/projects/myproject/foobar1</source> -->
<source>/Users/username/projects/myproject/foobar2</source>
</sources>
Or if the order of the modules is swapped:
<sources>
<source>/Users/username/projects/myproject/foobar2</source>
<source>/Users/username/projects/myproject/foobar1</source>
</sources>
Then the coverage results switch—modules from foobar2 are correctly displayed, while modules from foobar1 are not.
Expected behaviour It is expected that after the tests are run, all modules will be highlighted correctly.
Desktop:
- OS: MacOs
- Extension Version 2.12.0
- VSCode Version 1.96.2
@fargoss Thanks for the issue!
Hmm could be that the coverage parser library we use doesn't do multiple sources (I bet if you generated 2 coverage files it would work fine).
I believe you are using xml with clover for the coverage file? (we can see here how this logic works)
In the upstream parser repo, I wasn't able to find anything about multiple sources 🤔. https://github.com/coverage-report/clover-json/blob/master/src/index.js