17 Commits

Author SHA1 Message Date
Piotr Tabor
c32180d772 tests/e2e,etcdctl,etcdmain: Fix go test --tags cov -v ./tests/e2e
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.
2020-09-09 12:56:15 +02:00
Gyuho Lee
9ecbf5d2d1 main_test: skip test when invoked via go test
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 16:19:11 -07:00
shivaramr
9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Anthony Romano
7e05b33aa0 *: remove os.Kill from signal.Notify
Clears SA1016 in staticcheck
2017-04-07 10:52:54 -07:00
fanmin shi
1d521556ae e2e: modify e2e to run code coverage 2017-02-15 09:51:50 -08:00
Jonathan Boulle
cf9dd31daa etcd: move main logic to etcdmain subpackage 2014-10-29 18:43:22 -07:00
Jonathan Boulle
d7301a5cf4 main: fix proxy initialization and setupCluster 2014-10-23 16:09:29 -07:00
Jonathan Boulle
0d36385bb4 main: add header 2014-10-23 14:46:05 -07:00
Yicheng Qin
5fbe6c7134 main: add genClusterString func and its test 2014-10-23 14:19:40 -07:00
Brandon Philips
78a9bba276 pkg/types/flags: introduce flags package
I want to use the Addrs type in another experimental proxy that I am
implementing. Pull it out into a separate package.
2014-09-28 14:56:30 -07:00
Brian Waldon
e30c1eeefd pkg: move SetFlagsFromEnv to pkg package 2014-09-24 16:29:47 -07:00
Brian Waldon
b0617be7e3 etcd: rewrite SetFlagsFromEnv test to use custom flagset 2014-09-24 16:27:00 -07:00
Brian Waldon
f7c353a703 etcd: export SetFlagsFromEnv 2014-09-24 16:12:06 -07:00
Brian Waldon
18c300f80c etcd: pass flagset into setFlagsFromEnv 2014-09-24 16:11:47 -07:00
Jonathan Boulle
f0789e7349 main: add address validation for bind-addr flag 2014-09-18 16:38:14 -07:00
Brian Waldon
afce2948d2 etcd: replace -proxy-mode with -proxy 2014-09-18 14:30:22 -07:00
Jonathan Boulle
844897360c main: add test for setting flags 2014-09-17 14:12:04 -07:00