Skip to content
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

*: cleanup main_test.go #16789

Merged
merged 1 commit into from
Oct 17, 2023
Merged

*: cleanup main_test.go #16789

merged 1 commit into from
Oct 17, 2023

Conversation

fuweid
Copy link
Member

@fuweid fuweid commented Oct 17, 2023

The #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.

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/

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

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>
@fuweid fuweid force-pushed the cleanup-build-cov branch from 79863a1 to f96000e Compare October 17, 2023 13:48
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

thx for the cleanup.

@ahrtr ahrtr merged commit bbf59a9 into etcd-io:main Oct 17, 2023
27 checks passed
@fuweid fuweid deleted the cleanup-build-cov branch October 17, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants