-
Notifications
You must be signed in to change notification settings - Fork 388
Show coverage summary on terminal #681
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
Comments
Does VSTest signal the end of the entire test run (like an event)? Each data collector could then do one last action. |
No AFAIK...this is the biggest issue for coverlet for a lot of features like merging...we don't have a way to synch between parallel tests run. I'm in contact with vstest team to undestand if there is a solution, but I think that at the moment the only place is inside |
For this issue I had a fast conversation with team member and seem that we could inject a custom logger https://github.com/microsoft/vstest-docs/blob/master/docs/report.md |
Thanks @MarcoRossignoli for working on this issue ASAP. this is the biggest blocker for us, using the vstest collector. |
@PureKrome why?Can you tell me how you use terminal data? |
Sure, either when:
using the command line (eg. dotnet test ..) creates a file which I can't read easily. Just seeing the ascii art chart after that command is a great first and easy step into seeing some quick steps. It's a blocker because it's slowing me down when coding. I don't want to have to push the report file up to codecov.io and then log in to that to review the report. |
Ok for local dev you can use ReportGenerator with simple script https://github.com/danielpalme/ReportGenerator |
This issue has strained on me for an hour. Due to https://github.com/coverlet-coverage/coverlet#vstest-integration-preferred-due-to-known-issue-supports-only-net-core-application, we have been exploring To my dismay, same as op, there is seemingly no way today to get a simple The REASON for this is for gitlab CI coverage integration and badges, see: https://docs.gitlab.com/ee/ci/yaml/#coverage, so for a gitlab job that runs # opencover coverage report prints in TABLE reST format
coverage: '/^\s*\|\s+Total\s+\|\s+(\d+\.?\d+\%)\s+\|/' I tried the suggested workaround (to use an open-source report generator https://danielpalme.github.io/ReportGenerator/usage.html), however this cannot achieve it either. The closest I found was using the
, this gives us something like:
so then we can at least get that data with:
and we'd have to augment our regex match |
@mcallaghan-bsm I went through the same hoops - using a vstest "collector", then report generator for a text summary, and finally scrape the output for GitLab CI. AFAIK, this is the best way until coverlet collector hooks into collector logging to generate the text summary itself. |
@mcallaghan-bsm and @gitfool - wow! as a workaround, that's great!!! painful ... but great! |
We use an another approach with the coverlet vstest collector on GitLab. Coverlet is configured to output the results as opencover format. After the test run a script extracts the coverage from the report and prints it to console. PERCENTAGE=$(grep -m 1 -o -P '(?<=sequenceCoverage=")(\d+.\d+|\d+)' $DIRECTORY/coverage.opencover.xml)
echo "Line coverage: ${PERCENTAGE}%" |
This issue is stale because it has been open for 3 months with no activity. |
This issue was closed because it has been inactive for 275 days since being marked as stale. |
SADNESS |
Today at the end of the tests msbuil/.net tool drivers show a table with coverage result on console.
For instance:
This is not supported at the moment for vstest collectors integration.
cc: @vagisha-nidhi @PureKrome
The text was updated successfully, but these errors were encountered: