mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

This CL fixes: COVERDIR=./coverage PASSES="build_cov" && go test --tags cov -v ./tests/e2e and is part of the effort to make: COVERDIR=coverage PASSES="build_cov cov" ./test fully pass. The args passed to ./bin/etcd_test and ./bin/etcdctl_test binaries were mismatched. The protocol of passing the arguments using environment variables has been replaces with proper passing of flags. How the measurement of coverage by e2e tests works: 1. COVERDIR=./coverage PASSES="build_cov" are generating ./bin/etcd_test and ./bin/etcdctl_test binaries. 2. These binaries are tests (as coverage can be computed only for tests) [see ./main_test.go ./etcdctl/main_test.go], but this tests are running the main logic of the server and uppon termination (or SIGTERM signal) are writting proper .coverprofile files in the $COVERDIR folder. The binaries used to take arguments using env variables, but its not needed any longer. The binaries can consume any command line arguments that either test (so --test.fooo) or the original binary can consume. 3. The tests/e2e (when compiled with the --tags cov) are starting the _test binaries instead of the original binaries, such that the coverage is being collected.