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: add code coverage support #347

Closed
wants to merge 10 commits into from
Closed

Conversation

rchincha
Copy link
Contributor

@rchincha rchincha commented Dec 5, 2022

Signed-off-by: Ramkumar Chinchani [email protected]

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchincha rchincha force-pushed the cov branch 2 times, most recently from 1f3df01 to c522d57 Compare December 5, 2022 21:30
@rchincha rchincha force-pushed the cov branch 16 times, most recently from 4c72dec to c547bee Compare December 16, 2022 00:31
@rchincha rchincha added this to the v0.40.2 milestone Dec 16, 2022
@rchincha rchincha force-pushed the cov branch 9 times, most recently from e258ecc to 4db6ee6 Compare December 20, 2022 23:25
@rchincha
Copy link
Contributor Author

rchincha commented Feb 3, 2023

2023-02-03T01:38:33.6924887Z GOCOVERDIR=. go build -tags "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper containers_image_openpgp osusergo netgo " -ldflags "-X main.version=b9cbdb6efc7a274b0574764594a3f864b18a2951 -X main.lxc_version=5.0.0~git2209-g5a7b9ce67 " -o stacker-dynamic ./cmd/stacker

2023-02-03T01:48:48.9973555Z GOCOVERDIR=. go build -cover -covermode=atomic -coverpkg="./..." -tags "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper containers_image_openpgp osusergo netgo static_build testrunmain" -ldflags "-X main.version=b9cbdb6efc7a274b0574764594a3f864b18a2951 -X main.lxc_version=727adc05220e9b8b594c5bc2124bef5b2e0abe7a -extldflags '-static'" -o stacker ./cmd/stacker

@rchincha
Copy link
Contributor Author

rchincha commented Feb 3, 2023

https://pkgs.alpinelinux.org/package/edge/community/x86/go
^ best to wait for alpine to release its go 1.20 pkg

@rchincha rchincha force-pushed the cov branch 6 times, most recently from 5e141cc to 087eff4 Compare February 8, 2023 22:36
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@9c11803). Click here to learn what that means.
The diff coverage is n/a.

@@          Coverage Diff           @@
##             main    #347   +/-   ##
======================================
  Coverage        ?   6.60%           
======================================
  Files           ?      58           
  Lines           ?    6297           
  Branches        ?       0           
======================================
  Hits            ?     416           
  Misses          ?    5819           
  Partials        ?      62           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rchincha rchincha force-pushed the cov branch 5 times, most recently from 76d52ae to f413e25 Compare February 10, 2023 02:43
With golang 1.20.x, we can build a binary with coverage support.

"
Cover

Go 1.20 supports collecting code coverage profiles for programs
(applications and integration tests), as opposed to just unit tests.

To collect coverage data for a program, build it with go build's -cover
flag, then run the resulting binary with the environment variable
GOCOVERDIR set to an output directory for coverage profiles. See the
'coverage for integration tests' landing page for more on how to get
started. For details on the design and implementation, see the proposal.
"

Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
@rchincha
Copy link
Contributor Author

Closing in favor of PR #550

@rchincha rchincha closed this Nov 15, 2023
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.

2 participants