Skip to content
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

Test coverage #1090

Merged
merged 7 commits into from
Jul 13, 2022
Merged

Test coverage #1090

merged 7 commits into from
Jul 13, 2022

Conversation

randombenj
Copy link
Contributor

@randombenj randombenj commented Jun 30, 2022

Requirements

All new code should be covered with tests, documentation should be updated. CI should pass.

Description of the Change

Add code coverage also for functional tests so contribution and maintenance of aptly becomes
simpler in the future.

@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Merging #1090 (6113a7f) into master (c9f5763) will increase coverage by 14.20%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master    #1090       +/-   ##
===========================================
+ Coverage   52.11%   66.31%   +14.20%     
===========================================
  Files          73      141       +68     
  Lines       11272    15890     +4618     
===========================================
+ Hits         5874    10538     +4664     
+ Misses       4832     4603      -229     
- Partials      566      749      +183     
Impacted Files Coverage Δ
main.go 0.00% <ø> (ø)
cmd/mirror.go 91.89% <0.00%> (ø)
console/progress.go 50.81% <0.00%> (ø)
cmd/mirror_update.go 74.88% <0.00%> (ø)
cmd/publish_repo.go 100.00% <0.00%> (ø)
cmd/publish_snapshot.go 93.23% <0.00%> (ø)
cmd/api.go 100.00% <0.00%> (ø)
cmd/db_recover.go 85.18% <0.00%> (ø)
cmd/task.go 100.00% <0.00%> (ø)
cmd/cmd.go 82.95% <0.00%> (ø)
... and 96 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Add the https redirect to the gold ouptut of the test
as this was changed for the jenkins debian repos
and the tests were failing after this change.
@randombenj randombenj force-pushed the test-coverage branch 12 times, most recently from 0d0ffed to 5eb9723 Compare July 11, 2022 15:08
To capture the coverage also for the integration tests,
a test only executing the cmd.Run function is used.

The test always exits with code 0 and prints the
real exit code to stdout. Otherwise no coverage
report is generated.

Those changes enable a more accurate coverage report
for future contributions.
@randombenj randombenj marked this pull request as ready for review July 12, 2022 11:40
@randombenj randombenj requested review from ximon18 and lbolla and removed request for ximon18 July 12, 2022 13:38
@randombenj
Copy link
Contributor Author

@lbolla @ximon18 feel free to leave a review if you are interested, otherwise I will merge this in the next few days :)

@randombenj randombenj merged commit f0a85b2 into master Jul 13, 2022
@ximon18
Copy link
Contributor

ximon18 commented Jul 13, 2022

Thanks @randombenj, I'll try and make time to take a look. Ah I see it was already approved and merged, well I may still take a look anyway even if just to satisfy my own curiosity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants