feat: more tests options#9
Open
N1xev wants to merge 3 commits into
Open
Conversation
- Add --summary-only/-s, --filter/-F, --count/-c, --cover/-C CLI flags - Per-package coverage % appended to package totals line - Per-function coverage breakdown, wrapped to terminal width, sorted worst-first, color-coded - Overall coverage % appended to summary the count flag is for `go test -count=1` that disables cache for re-run the tests freshly <: the cover flag runs statments coverage only if the tests is with the .go file that holds the statments of these test cases. and also it uses `go test -coverprofile` to make temp out file and then appends the function names with percentage of its statments covered (and its colored too per much percent). the summary only flag prints only the overall tests results. the filter flag filters the test names and show it normally under its package.
Owner
|
Overall I think it looks great! Two main things:
|
- Add gif and explain in readme for cache (-count=1 in normal `go test`) - Add gif and explain in readme for coverage - Add gif and explain in readme for filter - Add gif and explain in readme for summary only output - Add 1 file_test.go for testing the new coverage flag and for making the example gif.
Contributor
Author
i added the examples and tapes/gifs and updated the readme for this branch. for the organization idk tbh but this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add coverage reporting and new CLI flags
--summary-only/-s,--filter/-F,--count/-c,--cover/-CCLI flagsThe count flag is for
go test -count=1that disables cache for re-run the tests freshly <:The cover flag runs statments coverage only if the tests is with the .go file that holds the statments of these test cases.
and also it uses
go test -coverprofileto make temp out file and then appends the function names with percentage of its statments covered (and its colored too per much percent).Example cover and count:
The summary only flag prints only the overall tests results.
Example:
The filter flag filters the test names and show it normally under its package.
Example: