-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Remove e2e from coverage calculation #15544
Conversation
Signed-off-by: James Blair <mail@jamesblair.net>
Please find and cleanup files with |
Ok so taking this one step at a time to get my head around it, here is our list of grep -Ri "//go:build" | grep cov
pkg/osutil/signal_linux.go://go:build linux && !cov
pkg/osutil/signal.go://go:build !linux || cov
tests/framework/e2e/etcd_spawn_nocov.go://go:build !cov
tests/framework/e2e/etcd_spawn_cov.go://go:build cov
tests/e2e/zap_logging_test.go://go:build !cov
tests/e2e/ctl_v3_completion_test.go://go:build !cov
tests/e2e/v3_cipher_suite_test.go://go:build !cov && !cluster_proxy
tests/e2e/ctl_v3_watch_no_cov_test.go://go:build !cov
tests/e2e/ctl_v3_watch_cov_test.go://go:build cov @serathius are we simply removing the |
Depends on the case. We could either:
|
Signed-off-by: James Blair <mail@jamesblair.net>
Signed-off-by: James Blair <mail@jamesblair.net>
Signed-off-by: James Blair <mail@jamesblair.net>
Hey @serathius - Many thanks for the guidance above. I've had a go a the remaining cleanup you described. Hoping I have understood this correctly. Please take a look when you can and let me know what you think 🙏🏻 |
Signed-off-by: James Blair <mail@jamesblair.net>
Signed-off-by: James Blair <mail@jamesblair.net>
Looks great! This is exactly what we want. |
The etcd-io#15544 has removed the `build_cov` build. And after go1.20, we use `-cover` buildflag to enable coverage exporter. We don't need to maintain main_test.go anymore. ```bash ➜ pwd /home/fuwei/go/src/go.etcd.io/etcd/etcdctl ➜ go build -o /tmp/etcdctl -cover ./ ➜ mkdir /tmp/etcdctl-covdata ➜ GOCOVERDIR=/tmp/etcdctl-covdata /tmp/etcdctl get /health ➜ go tool covdata percent -i=/tmp/etcdctl-covdata go.etcd.io/etcd/etcdctl/v3 coverage: 66.7% of statements go.etcd.io/etcd/etcdctl/v3/ctlv3 coverage: 83.3% of statements go.etcd.io/etcd/etcdctl/v3/ctlv3/command coverage: 15.4% of statements ``` REF: https://go.dev/testing/coverage/ Signed-off-by: Wei Fu <fuweid89@gmail.com>
The etcd-io#15544 has removed the `build_cov` build. And after go1.20, we use `-cover` buildflag to enable coverage exporter. We don't need to maintain main_test.go anymore. ```bash ➜ pwd /home/fuwei/go/src/go.etcd.io/etcd/etcdctl ➜ go build -o /tmp/etcdctl -cover ./ ➜ mkdir /tmp/etcdctl-covdata ➜ GOCOVERDIR=/tmp/etcdctl-covdata /tmp/etcdctl get /health ➜ go tool covdata percent -i=/tmp/etcdctl-covdata go.etcd.io/etcd/etcdctl/v3 coverage: 66.7% of statements go.etcd.io/etcd/etcdctl/v3/ctlv3 coverage: 83.3% of statements go.etcd.io/etcd/etcdctl/v3/ctlv3/command coverage: 15.4% of statements ``` REF: https://go.dev/testing/coverage/ Signed-off-by: Wei Fu <fuweid89@gmail.com>
This pull request removes e2e from the coverage collected in
scripts/test.sh
.Ref #15522