Closed elpdt852 closed 6 months ago
Previously it was generating a coverage report per integration test. Using actions/upload-artifact
and actions/download-artifact
I was able to copy each integration test coverage report into a single step to merge & produce the final coverage report.
Thanks, looks like our current statement-level test coverage is 63.9%
.
Fix #43
As of go 1.20, we can compile go binaries with cover instrumentation to collect coverage for integration tests: https://go.dev/doc/build-cover
Combined with
machine.copy_from_vm
capability via a shared mount in the NixOS test framework, we can essentially collect Golang test coverage data even when nix-snapshotter is embedded in a systemd service, very cool!We likely want to use codecov, which is free for open source (cc @gbpdt need approval for
pdtpartners/nix-snapshotter
). For now, I've added the coverage data to$GITHUB_STEP_SUMMARY
.