-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] Coverage Collection #1135
Comments
I assume you're looking at getting some .xml or other file produced by the coverage tooling from the device right? |
The idea is something like this: I am using this tool on a macOS azdo self-hosted agent for a CI/CD pipeline. Thanks! |
Yeah so there are essentially two steps: 1) plug the coverage collector into the test run 2) collect the coverage results xml/json. The former is probably something you can do already in your runner class which is derived from iOSApplicationEntryPoint. |
Actually I am using the TestRunners from the Maui repo with some slight modifications used with xharness in a CI/CD pipeline. I only use net6.0-android (not maui) for my project so I have deleted anything non-android (iOS, macCatalyst, etc.) I can see that they have this:
Could you please advise how I can make it collect the coverage info (statements/lines/assembly,...) as well? I actually find the 2nd option more plausible as I don't see why we can't be using the same tcpTextWriter to transfer the coverage results xml as well?! |
That depends on the specific coverage tool, e.g. if it has an API to start/stop the collection then you could add that into
Yeah for Android it's much easier since we can pull arbitrary files from the device via adb. It would still need to be implemented in xharness so you can somehow communicate a file should be pulled. I'd be happy to accept a PR for that. |
I think the natural choice would be this: https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-code-coverage?tabs=linux But I still don't know how to implement it in Xharness. Could you please provide some hints? Thanks! |
I have no experience with coverlet, you'd need to ask them. |
I am more than happy to work on this and contribute to this project but I don't see where the dotnet test command is executed. Could you please point me to the right direction which file(s) I should focus on first to achieve getting coverage result from a tool when running the tests? Thanks! |
We don't execute |
Hi,
I have been using this fantastic library with xunit however, I have noted that the test coverage results are not collected/published.
I would be grateful if consideration is given to collecting test coverage data as part of the test execution so that they could be used in a CI/CD run.
Thanks!
The text was updated successfully, but these errors were encountered: