More test coverage #13

Closed
opened 2022-06-29 13:50:27 +00:00 by grumbulon · 1 comment
Collaborator

So running the following commands go test -v -coverpkg=./... -coverprofile=profile.cov ./... provide us with only 6.1% test coverage for all of awl currently.

Obviously this is very low so more tests will need to be written which fortunatly we can see better coverage of where we are missing things, check this page that Go generated for a more verbose explaination of where our tests are and are not.

So the tl;dr of the file is logawl and query has 0% coverage and the root directory has a whopping 9% coverage and util has ~6%. Full output

go test -v -coverpkg=./... -coverprofile=profile.cov ./...                         
=== RUN   TestApp
--- PASS: TestApp (0.00s)
=== RUN   TestArgParse
--- PASS: TestArgParse (0.00s)
PASS
coverage: 9.9% of statements in ./...
ok      git.froth.zone/sam/awl  0.002s  coverage: 9.9% of statements in ./...
?       git.froth.zone/sam/awl/logawl   [no test files]
?       git.froth.zone/sam/awl/query    [no test files]
=== RUN   TestIPv4
--- PASS: TestIPv4 (0.00s)
=== RUN   TestIPv6
--- PASS: TestIPv6 (0.00s)
=== RUN   TestNAPTR
--- PASS: TestNAPTR (0.00s)
=== RUN   TestInvalid
--- PASS: TestInvalid (0.00s)
PASS
coverage: 6.1% of statements in ./...
ok      git.froth.zone/sam/awl/util     0.002s  coverage: 6.1% of statements in ./...

As a future proposal we may want to add a pipeline step to update that page with the test coverage and include a link in the repo, maybe.

So running the following commands `go test -v -coverpkg=./... -coverprofile=profile.cov ./... ` provide us with only 6.1% test coverage for all of awl currently. Obviously this is very low so more tests will need to be written which fortunatly we can see better coverage of where we are missing things, check [this page](https://grumbulon.xyz/awl.html) that Go generated for a more verbose explaination of where our tests are and are not. So the tl;dr of the file is logawl and query has 0% coverage and the root directory has a whopping 9% coverage and util has ~6%. Full output ``` go test -v -coverpkg=./... -coverprofile=profile.cov ./... === RUN TestApp --- PASS: TestApp (0.00s) === RUN TestArgParse --- PASS: TestArgParse (0.00s) PASS coverage: 9.9% of statements in ./... ok git.froth.zone/sam/awl 0.002s coverage: 9.9% of statements in ./... ? git.froth.zone/sam/awl/logawl [no test files] ? git.froth.zone/sam/awl/query [no test files] === RUN TestIPv4 --- PASS: TestIPv4 (0.00s) === RUN TestIPv6 --- PASS: TestIPv6 (0.00s) === RUN TestNAPTR --- PASS: TestNAPTR (0.00s) === RUN TestInvalid --- PASS: TestInvalid (0.00s) PASS coverage: 6.1% of statements in ./... ok git.froth.zone/sam/awl/util 0.002s coverage: 6.1% of statements in ./... ``` As a future proposal we may want to add a pipeline step to update that page with the test coverage and include a link in the repo, maybe.
grumbulon added the
enhancement
label 2022-06-29 13:50:27 +00:00
grumbulon self-assigned this 2022-06-29 13:50:27 +00:00
grumbulon added this to the awl v0.3 release candidate project 2022-06-29 13:50:27 +00:00
grumbulon added this to the Release v0.3 milestone 2022-06-29 13:52:34 +00:00
Author
Collaborator

Adding on to this to quantify test coverage percentages: if a given file has test coverage of at least 85% it's fine.

Adding on to this to quantify test coverage percentages: if a given file has test coverage of at least 85% it's fine.
sam closed this issue 2022-07-02 16:34:43 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sam/awl#13
No description provided.