Conversation
|
Correction on my part. While (as far as I can tell) the current version works with MSBuild integration, it does not work with vstest. My modifications will make the coverage reporter work for both MSBuild and VSTest. To use VSTest integration with my modifications, one simply needs to create a <?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>opencover</Format>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>And the test CLI command needs to be updated to be: |
|
I'm currently looking at building a slightly different, wildcard-based version of this. Since actions can't use third-party libraries, I'm trying to come up with the most efficient way to do this easily. |
|
Thanks for the PR @JerrettDavis, and I'm sorry for not having a look at it before now. I just want to check up on the status before I merge it and release a new version. Is it still valid functionality that you would like to have added or is this deprecated? |
|
Hi @simon-k. This code change should still be operation in its current state. I had hoped to expand it with pattern matching, but the submitted code changes do what is described in my original comment. |
I couldn't get the existing version to work with version 3.1.0 of coverlet.collector due to changes in how it generates tests.
This new version runs the tests via:
dotnet test --collect:"XPlat Code Coverage"with an optional--settings <path>/coverlet.runsettings. And when it creates the test runs, it places them in folders with procedurally generated names.To make the library work with both the old and new versions, I made some updates. First, I introduced a couple optional parameters called
filenameanddiscover-directory. If neither are set, it operates pretty much exactly as it did before. Ifdiscover-directoryis set to true, it'll try to get the directory by checking the directory in the path specified inpath. If it finds one, it gets appended to the path, and the filename is appended to that.The documentation still needs to be updated.