-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add tests for increased coverage. #4891
Conversation
6f5ff0d
to
54707b6
Compare
The failed tests here do not appear when running
I'm not entirely sure what to make of the error, but I see that it happens occasionally, e.g. here as well: |
@Lussebullen This is a flaky test unrelated to your changes and can be safely ignored :) |
Could you resolve the conflicts and the review suggestions? Other than that it looks good! :) |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4891 +/- ##
==========================================
+ Coverage 61.44% 61.70% +0.26%
==========================================
Files 289 289
Lines 20241 20241
==========================================
+ Hits 12437 12490 +53
+ Misses 6903 6864 -39
+ Partials 901 887 -14 |
01d0c47
to
28277e1
Compare
I force pushed an amend with my signature to fix the DCO issue, but I'm not sure I can trigger the tests to run again. |
Thank you @Lussebullen, there is still a merge conflict with |
fe90762
to
daad174
Compare
@Benehiko reverted the ?: / :? part as you requested, I also updated the branch, but in doing so it seems the test capitalizeFirst utility no longer builds, for some reason it no longer exports despite doing so before. So I removed it entirely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Lussebullen, LGTM :)
My pleasure 🫡 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; most of these could be refactored into a table-based tests (thinking of the convertVolumeToMount
tests).
But this is still an improvement and could be a follow up 😄
Thanks!
Hey @Lussebullen sorry to ask more of you 🙈, but could you squash the commits you have on this branch into a single commit so we can merge this? |
Co-authored-by: Adam Siraj <[email protected]> Co-authored-by: Emil Sjölander <[email protected]> Co-authored-by: Omar Askar Vergara <[email protected]> Co-authored-by: Emir Catir <[email protected]> Signed-off-by: Mathias Duedahl <[email protected]>
daad174
to
ccfd0b2
Compare
@Benehiko I squashed them now, I just added my co-authors in the commit message, not sure how it works with the ctn, but its important to me that they get the credit they are due :) |
- What I did
Increased test coverage of
cli/compose/convert/volume.go
to 100%.Fixed typo in
cli/compose/template/template_test.go
to reach the intended branch test inextractVariables
funcIt checks for
Strings.Contains
func checks for:?
and not?:
Added tests of Descope and Name methods for Namespace in
cli/compose/convert/compose_test.go
.Added test of convertEnvironment in case of nil value in
cli/compose/convert/service_test.go
.Added tests for
capitalizeFirst
func incli/command/utils_test.go
.Added tests of String and Type methods for NetworkOpt in
opts/network_test.go
.Added test for GetAllOrEmpty method and for ParseCPUs in
opts/opts_test.go
.- How I did it
We started by checking the Code coverage to see where testing was lacking and added test as we saw fit in order to increase the test coverage.
- How to verify it
Check difference as reported by codecov bot when triggered.
Verify it by running first running
make dev
andmake test
to check that all test passes and afterwards running the following commands to check that the test coverage has increaed:$ go test -coverprofile=coverage.out ./... $ go tool cover -html=coverage.out -o coverage.html
or
make test-coverage
- Description for the changelog
Add various test cases for increased test coverage.
- A picture of a cute animal (not mandatory but encouraged)