Skip to content

Commit

Permalink
*: cleanup main_test.go
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fuweid committed Oct 17, 2023
1 parent be83fff commit f96000e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 216 deletions.
10 changes: 0 additions & 10 deletions etcdctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ import (
"go.etcd.io/etcd/etcdctl/v3/ctlv3"
)

/*
*
mainWithError is fully analogous to main, but instead of signaling errors
by os.Exit, it exposes the error explicitly, such that test-logic can intercept
control to e.g. dump coverage data (even for test-for-failure scenarios).
*/
func mainWithError() error {
return ctlv3.Start()
}

func main() {
ctlv3.MustStart()
return
Expand Down
68 changes: 0 additions & 68 deletions etcdctl/main_test.go

This file was deleted.

68 changes: 0 additions & 68 deletions etcdutl/main_test.go

This file was deleted.

70 changes: 0 additions & 70 deletions server/main_test.go

This file was deleted.

0 comments on commit f96000e

Please sign in to comment.