266 Commits

Author SHA1 Message Date
Wei Fu
55bce22e97 chore: enable strict mode for test CI
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-04-02 08:57:56 +08:00
Piotr Tabor
90d1b838ad Fix shellcheck warnings: Escaping.
```
build:3:65: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
test:3:64: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/fix.sh:23:17: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/fix.sh:23:46: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/fix.sh:30:17: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/genproto.sh:38:17: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/genproto.sh:53:17: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/genproto.sh:73:23: note: Backslash is literal in "\(". Prefer explicit escaping: "\\(". [SC1117]
scripts/genproto.sh:73:33: note: Backslash is literal in "\(". Prefer explicit escaping: "\\(". [SC1117]
scripts/genproto.sh:74:69: note: Backslash is literal in "\1". Prefer explicit escaping: "\\1". [SC1117]
scripts/genproto.sh:74:78: note: Backslash is literal in "\2". Prefer explicit escaping: "\\2". [SC1117]
scripts/genproto.sh:75:40: note: Backslash is literal in "\(". Prefer explicit escaping: "\\(". [SC1117]
scripts/genproto.sh:75:52: note: Backslash is literal in "\1". Prefer explicit escaping: "\\1". [SC1117]
scripts/genproto.sh:91:17: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
scripts/genproto.sh:115:17: note: Backslash is literal in "\n". Prefer explicit escaping: "\\n". [SC1117]
./test.sh:71:29: warning: Quote to prevent word splitting, or split robustly with mapfile or read -a. [SC2206]
./test.sh:400:28: note: Backslash is literal in "\t". Prefer explicit escaping: "\\t". [SC1117]
./test.sh:406:33: note: Backslash is literal in "\t". Prefer explicit escaping: "\\t". [SC1117]
./test.sh:415:36: note: Backslash is literal in "\*". Prefer explicit escaping: "\\*". [SC1117]
./test.sh:415:176: note: Backslash is literal in "\'". Prefer explicit escaping: "\\'". [SC1117]
./test.sh:493:56: note: Backslash is literal in "\.". Prefer explicit escaping: "\\.". [SC1117]
./test.sh:601:57: note: Backslash is literal in "\(". Prefer explicit escaping: "\\(". [SC1117]
./test.sh:601:64: note: Backslash is literal in "\)". Prefer explicit escaping: "\\)". [SC1117]
./test.sh:601:67: note: Backslash is literal in "\(". Prefer explicit escaping: "\\(". [SC1117]
./test.sh:601:74: note: Backslash is literal in "\)". Prefer explicit escaping: "\\)". [SC1117]
./test.sh:601:77: note: Backslash is literal in "\(". Prefer explicit escaping: "\\(". [SC1117]
./test.sh:601:84: note: Backslash is literal in "\)". Prefer explicit escaping: "\\)". [SC1117]
./test.sh:601:91: note: Backslash is literal in "\1". Prefer explicit escaping: "\\1". [SC1117]
./test.sh:601:94: note: Backslash is literal in "\2". Prefer explicit escaping: "\\2". [SC1117]
./test.sh:601:103: note: Backslash is literal in "\3". Prefer explicit escaping: "\\3". [SC1117]
```
2021-01-29 22:32:43 +00:00
Piotr Tabor
84b5b87fb2 Make test.sh scripts OSX/BSD compatible:
- build & test scripts deprecated. Call *.sh variants.
  This will avoid delete the symlinks and get rid of
  subtle dependency on 'sed --follow-symlinks' on OsX/BSD sed.

- Fix parameters to mktemp
2021-01-12 16:29:00 +01:00
Piotr Tabor
4d173231d1 Documentation: Developer's docs about etcd-3.5.x modules 2020-12-02 10:00:09 +01:00
Piotr Tabor
6e800b9b01
20201103 no commit title check (#12447)
* Turn off checking of format of commit message.

* scripts/fix.sh: Fix fixing whitespaces in *.sh scripts

Aparently there is a difference between:
  find ./ -print0 -name *.sh and
  find ./ -name *.sh -print0

* etcdserver unit tests: Do not call .Fatalf(...) from not test's goroutine.

Fixes following test failures:
https://travis-ci.com/github/etcd-io/etcd/jobs/425920416
```
% (cd server && go vet ./...)
stderr: # go.etcd.io/etcd/server/v3/etcdserver
stderr: etcdserver/server_test.go:1002:4: call to (*T).Fatalf from a non-test goroutine
stderr: etcdserver/server_test.go:1166:4: call to (*T).Fatalf from a non-test goroutine
FAIL: (code:2):
  % (cd server && go vet ./...)
FAIL: 'run go vet ./...' checking failed (!=0 return code)
FAIL: 'govet' failed at Tue Nov  3 04:07:47 UTC 2020
```
2020-11-03 07:59:42 -08:00
Piotr Tabor
6c1efd6ba5 server: Update go.mod 2020-10-26 13:02:32 +01:00
Piotr Tabor
c035df5317 test: Detect indention done using tab (\t) in *.sh 2020-10-26 10:59:40 +01:00
Piotr Tabor
cf795c0ae6 client/v3: Create and update go.mod 2020-10-20 10:09:12 +02:00
Piotr Tabor
bea5f379bc raft: Make raft a module
Establishing a module: Creating a go.mod files
2020-10-16 09:15:48 +02:00
Piotr Tabor
b7f0f52a16
*: Refresh of dependencies (#12399)
This PR focuses on dependencies that have new stable versions.
2020-10-15 15:32:00 -07:00
Piotr Tabor
f7f17dd6a1 test: Adding dependencies consistency check
Examplar output for artificially inconsistent dependencies:

```
% PASSES="dep" ./test
% 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'
% 'env' 'GO111MODULE=off' 'go' 'get' 'github.com/myitcv/gobin'
% 'gofail' 'disable' 'etcdserver/' 'mvcc/backend/'
Running with -cpu=4 --race

'dep' started at Wed 14 Oct 2020 09:56:34 AM CEST
% (cd api && 'go' 'list' '-m')
% (cd api && 'go' 'list' '-f' '{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/api/v3{{end}}{{end}}' '-m' 'all')
% (cd pkg && 'go' 'list' '-m')
% (cd pkg && 'go' 'list' '-f' '{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/pkg/v3{{end}}{{end}}' '-m' 'all')
% 'go' 'list' '-m'
% 'go' 'list' '-f' '{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/v3{{end}}{{end}}' '-m' 'all'
% (cd tests && 'go' 'list' '-m')
% (cd tests && 'go' 'list' '-f' '{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/tests/v3{{end}}{{end}}' '-m' 'all')
FAIL: inconsistent versions for depencency: github.com/coreos/go-semver
github.com/coreos/go-semver:
  - v0.2.0 from: go.etcd.io/etcd/api/v3
  - v0.3.0 from: go.etcd.io/etcd/v3
FAIL: inconsistent dependencies
FAIL: 'dep' failed at Wed 14 Oct 2020 09:56:35 AM CEST
```
2020-10-14 09:57:27 +02:00
Piotr Tabor
bc9e433ca2 tools: Migrate remaining tools to gobin
Replace ./scripts/install_tool.sh with `gobin`, such that we have
consistent handling for all tools needed for build and consistent
versioning within ./tools/mod/go.mod.

Side changes:
  - Expose /scripts/fix.sh that fixes formatting and bom across modules
  - Expose *.sh variants of scripts like build and ./test (first step
towards replacement).
  - Make stderr output of commands explicit and make commands use
different color than callouts.
2020-10-13 19:33:01 +02:00
Piotr Tabor
f67956cb7a clientv3: Expose clientv3/examples close to the code.
Many of the tests had missing '// Output:' comment, so were not
runnable. They required fining.
2020-10-08 14:27:32 +02:00
Piotr Tabor
313087f8c5 ./test,./scripts: Update go.sum and bill-of-materials generation logic (and refresh bom). 2020-10-07 15:38:39 +02:00
Piotr Tabor
7886ec8574 test: Modules: PASSES="integration" ./test understand new file locations 2020-10-07 15:38:39 +02:00
Piotr Tabor
b382429d01 tests: Move functional tests to 'tests' module.
Tested with:

PASSES="fmt functional unit" ./test
make build-docker-functional
2020-10-07 15:09:26 +02:00
Piotr Tabor
4fb48b7c14 tests: Estabilishing module for tests
For now it contains only e2e tests, but integration & functional will follow.
2020-10-07 15:03:51 +02:00
Piotr Tabor
997961ebfd bom: Update bill of materials to reflect the new module. 2020-10-06 12:28:40 +02:00
Piotr Tabor
a6b0375b7b
Travis: Reduce footprint of unit tests - so hopefully flakiness (#12350)
* ./tests: Remove legacy coverage collection code

The legacy tests/cover.test.bash script was not ./test script
compatible for a long time.

The following method of coverage collection works (also across
packages) and does not make all the test execution slower.

```
COVERDIR=coverage PASSES="build build_cov cov" ./test
go tool cover -html ./coverage/cover.out
```

* CI: Reduce duplicated coverage between different variants on Travis

We used to execute unit tests in 3 different jobs,
every time with --race detection and every time in 3 variants:1,2,4
CPUS.

The proposed change makes each of the jobs use different variant of
CPUS, and only 4-cpu variant is running with --race detection
(as the more-parallel variant is more likely to experience races),
2020-09-29 19:47:05 -07:00
Piotr Tabor
b3bbe10465 go.sum: Update & make sure PASSES="mod_tidy" ./test detects such problems.
Commit inspired by this failure:
  https://travis-ci.com/github/etcd-io/etcd/jobs/391164537

This is not happanning locally - but can be forced by removal of go.sum
file. Let's watch how frequently we will need to refresh go.sum.
2020-09-28 12:00:25 +02:00
Piotr Tabor
f1d4593241 ./test: Refactoring of test script for modularization
This refactoring offers following benefits:

  - Unified way how go test commands are being called (in terms of flags intepretation)
  - Uses standard go mechanisms (like go lists) to find files/packages that are subject for test. The mechanism are module aware.
  - Added instruction how to install tools needed for the tests/checkers.
  - Added colors to the output to make it easier to spot any failure.

Confirmed to work using:
- COVERDIR="./coverage" CPU="4" RACE=false COVER=false PASSES="build build_cov cov" ./test
- CPU="4" RACE=false COVER=false PASSES="e2e functional integration" ./test
- COVERDIR="./coverage" COVER="false" CPU="4" RACE="false" PASSES="fmt build unit build_cov integration e2e integration_e2e grpcproxy cov" ./test
- PASSES=unit PKG=./wal TIMEOUT=1m ./test
- PASSES=integration PKG=./clientv3 TIMEOUT=1m ./test
- PASSES=unit PKG=./wal TESTCASE=TestNew TIMEOUT=1m ./test
- PASSES=unit PKG=./wal TESTCASE="\bTestNew\b" TIMEOUT=1m ./test
- PASSES=integration PKG=./client/integration TESTCASE="\bTestV2NoRetryEOF\b" TIMEOUT=1m ./test
- COVERDIR=coverage PASSES="build_cov cov" ./test
2020-09-28 11:07:50 +02:00
Piotr Tabor
aa10b1ee7f ./test: Add PASSES="mod_tidy" check
Added check that ensures that go.mod & go.sum files are up-to-date.
The check verifies whether 'go mod tidy' does not generate any mutations
in these files.
The check can be run on its own:
  PASSES="mod_tidy" ./test
Or as part of "fmt" pass:
  PASSES="fmt" ./test

Examplar outputs:

```
% PASSES="fmt" ./test

Running with TEST_CPUS: 1,2,4
Starting 'fmt' pass at Fri 11 Sep 2020 11:07:54 PM CEST
'shellcheck' started at Fri 11 Sep 2020 11:07:54 PM CEST
'shellcheck' completed at Fri 11 Sep 2020 11:07:54 PM CEST
'markdown_you' started at Fri 11 Sep 2020 11:07:54 PM CEST
'markdown_you' completed at Fri 11 Sep 2020 11:07:54 PM CEST
'goword' started at Fri 11 Sep 2020 11:07:54 PM CEST
'goword' completed at Fri 11 Sep 2020 11:07:54 PM CEST
'gofmt' started at Fri 11 Sep 2020 11:07:54 PM CEST
'gofmt' completed at Fri 11 Sep 2020 11:07:55 PM CEST
'govet' started at Fri 11 Sep 2020 11:07:55 PM CEST
'govet' completed at Fri 11 Sep 2020 11:07:57 PM CEST
'revive' started at Fri 11 Sep 2020 11:07:57 PM CEST
Skipping revive...
'revive' completed at Fri 11 Sep 2020 11:07:57 PM CEST
'license_header' started at Fri 11 Sep 2020 11:07:57 PM CEST
'license_header' completed at Fri 11 Sep 2020 11:07:58 PM CEST
'receiver_name' started at Fri 11 Sep 2020 11:07:58 PM CEST
'receiver_name' completed at Fri 11 Sep 2020 11:07:58 PM CEST
'commit_title' started at Fri 11 Sep 2020 11:07:58 PM CEST
'commit_title' completed at Fri 11 Sep 2020 11:07:58 PM CEST
'mod_tidy' started at Fri 11 Sep 2020 11:07:58 PM CEST
*** /tmp/fileiALKRA_go.mod	2020-09-11 23:07:58.838010716 +0200
--- ./go.mod	2020-09-11 23:07:58.974010922 +0200
***************
*** 29,39 ****
  	github.com/mattn/go-runewidth v0.0.2 // indirect
  	github.com/modern-go/reflect2 v1.0.1
  	github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
  	github.com/prometheus/client_golang v1.0.0
  	github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
- 	github.com/prometheus/common v0.4.1
  	github.com/sirupsen/logrus v1.4.2 // indirect
  	github.com/soheilhy/cmux v0.1.4
  	github.com/spf13/cobra v0.0.3
  	github.com/spf13/pflag v1.0.1
  	github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
--- 29,38 ----
./go.mod is not in sync with 'go mod tidy'
```

```
% PASSES="mod_tidy" ./test

Running with TEST_CPUS: 1,2,4
Starting 'mod_tidy' pass at Fri 11 Sep 2020 11:09:21 PM CEST
*** /tmp/file9gy4so_go.mod	2020-09-11 23:09:21.166133290 +0200
--- ./go.mod	2020-09-11 23:09:21.286133466 +0200
***************
*** 29,39 ****
  	github.com/mattn/go-runewidth v0.0.2 // indirect
  	github.com/modern-go/reflect2 v1.0.1
  	github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
  	github.com/prometheus/client_golang v1.0.0
  	github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
- 	github.com/prometheus/common v0.4.1
  	github.com/sirupsen/logrus v1.4.2 // indirect
  	github.com/soheilhy/cmux v0.1.4
  	github.com/spf13/cobra v0.0.3
  	github.com/spf13/pflag v1.0.1
  	github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
--- 29,38 ----
./go.mod is not in sync with 'go mod tidy'
```
2020-09-15 14:38:54 +02:00
Piotr Tabor
0f195baca1 ./test: CI (./test) should never edit go.mod nor go.sum files
Tested and received as expected:
```
...
go: updates to go.mod needed, disabled by -mod=readonly
```
2020-09-15 14:38:54 +02:00
Piotr Tabor
fb2e96e651 vendor: Get rid of ./vendor cleanup
Updated scripts and documentation to not recommend vendoring.
Implemented best practices for tools installation.

Performed multiple tests to confirm its not breaking any workflows and
has no negative performance impact. Rather see 3x speedup.

1. PASSES="fmt unit integration e2e functional" ./test
2. ./scripts/updatebom.sh
3. ./scripts/updatedep.sh
4. ./scripts/genproto.sh - works - ca be simplified - in follow up PR
5. Installation without explicit GOPATH:

```
% unset GOPATH
% [sudo] rm -rf ~/go
% git clone https://github.com/etcd-io/etcd.git
% time ./build
go: downloading google.golang.org/grpc v1.26.0
go: downloading github.com/jonboulle/clockwork v0.1.0
go: downloading github.com/prometheus/client_golang v1.0.0
go: downloading github.com/soheilhy/cmux v0.1.4
go: downloading github.com/gogo/protobuf v1.2.1
go: downloading sigs.k8s.io/yaml v1.1.0
go: downloading golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2
go: downloading github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
go: downloading go.etcd.io/bbolt v1.3.5
go: downloading go.uber.org/zap v1.15.0
go: downloading golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
go: downloading github.com/golang/protobuf v1.3.2
go: downloading github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
go: downloading github.com/beorn7/perks v1.0.0
go: downloading github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4
go: downloading github.com/coreos/go-systemd/v22 v22.0.0
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/coreos/go-semver v0.2.0
go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7
go: downloading github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: downloading github.com/google/uuid v1.0.0
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading github.com/prometheus/common v0.4.1
go: downloading github.com/spf13/cobra v0.0.3
go: downloading github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
go: downloading github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c
go: downloading github.com/spf13/pflag v1.0.1
go: downloading github.com/json-iterator/go v1.1.7
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: downloading github.com/google/btree v1.0.0
go: downloading go.uber.org/atomic v1.6.0
go: downloading github.com/prometheus/procfs v0.0.2
go: downloading go.uber.org/multierr v1.5.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.9.5
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
go: downloading github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
go: downloading github.com/bgentry/speakeasy v0.1.0
go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.25
go: downloading github.com/urfave/cli v1.20.0
go: downloading github.com/mattn/go-runewidth v0.0.2
./build  8.22s user 2.31s system 117% cpu 8.961 total
```

Before:
```
% git clone https://github.com/etcd-io/etcd.git && cd etcd && time ./build
Cloning into 'etcd'...
remote: Enumerating objects: 97872, done.
remote: Total 97872 (delta 0), reused 0 (delta 0), pack-reused 97872
Receiving objects: 100% (97872/97872), 58.97 MiB | 19.85 MiB/s, done.
Resolving deltas: 100% (63091/63091), done.

./build  34.97s user 4.15s system 236% cpu 16.555 total
```

6. Rebuild without changes:

```
% time ./build
./build  1.43s user 0.83s system 168% cpu 1.336 total
```

7. Instantation of vendor directory (assuming ./build loaded them to
$GOPATH/pkg):

```
time go mod vendor
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa
go: downloading github.com/creack/pty v1.1.11
go: downloading github.com/etcd-io/gofail v0.0.0-20190801230047-ad7f989257ca
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.1
go mod vendor  0.51s user 0.44s system 110% cpu 0.861 total
```

8. Fresh instantation of vendor:

```
% rm -rf vendor
% [sudo] rm -rf ~/go

% time go mod vendor
go: downloading github.com/coreos/go-systemd/v22 v22.0.0
go: downloading github.com/spf13/cobra v0.0.3
go: downloading github.com/prometheus/client_golang v1.0.0
go: downloading golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7
go: downloading github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4
go: downloading github.com/gogo/protobuf v1.2.1
go: downloading sigs.k8s.io/yaml v1.1.0
go: downloading google.golang.org/grpc v1.26.0
go: downloading github.com/urfave/cli v1.20.0
go: downloading go.uber.org/zap v1.15.0
go: downloading github.com/spf13/pflag v1.0.1
go: downloading github.com/soheilhy/cmux v0.1.4
go: downloading github.com/json-iterator/go v1.1.7
go: downloading github.com/coreos/go-semver v0.2.0
go: downloading github.com/prometheus/common v0.4.1
go: downloading github.com/prometheus/procfs v0.0.2
go: downloading go.uber.org/atomic v1.6.0
go: downloading github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
go: downloading github.com/golang/protobuf v1.3.2
go: downloading github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading go.uber.org/multierr v1.5.0
go: downloading github.com/creack/pty v1.1.11
go: downloading github.com/mattn/go-runewidth v0.0.2
go: downloading github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: downloading golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
go: downloading golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
go: downloading github.com/jonboulle/clockwork v0.1.0
go: downloading gopkg.in/yaml.v2 v2.2.2
go: downloading github.com/etcd-io/gofail v0.0.0-20190801230047-ad7f989257ca
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.9.5
go: downloading github.com/google/btree v1.0.0
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading github.com/beorn7/perks v1.0.0
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: downloading github.com/google/uuid v1.0.0
go: downloading golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2
go: downloading github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
go: downloading go.etcd.io/bbolt v1.3.5
go: downloading golang.org/x/text v0.3.3
go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.25
go: downloading github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
go: downloading github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading github.com/bgentry/speakeasy v0.1.0
go: downloading github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.1
go mod vendor  3.62s user 1.30s system 127% cpu 3.854 total
```

9. Size of the repository - before: 39M, after: 18M

Before:

```
% time git clone https://github.com/etcd-io/etcd.git
Cloning into 'etcd'...
remote: Enumerating objects: 97872, done.
remote: Total 97872 (delta 0), reused 0 (delta 0), pack-reused 97872
Receiving objects: 100% (97872/97872), 58.97 MiB | 20.53 MiB/s, done.
Resolving deltas: 100% (63091/63091), done.
git clone https://github.com/etcd-io/etcd.git  4.66s user 1.02s system 93% cpu 6.068 total

% du -h --exclude .git -d 1
944K	./clientv3
108K	./etcdmain
5.4M	./Documentation
384K	./security
384K	./mvcc
28K	./.github
8.0K	./version
144K	./contrib
240K	./proxy
2.5M	./etcdserver
112K	./embed
536K	./integration
332K	./tools
116K	./lease
108K	./logos
896K	./tests
960K	./raft
216K	./client
52K	./scripts
100K	./hack
464K	./etcdctl
3.0M	./pkg
620K	./functional
136K	./wal
152K	./auth
21M	./vendor
39M
```

After:
```
% time git clone https://github.com/ptabor/etcd.git -b 20200908-no-vendor
Cloning into 'etcd'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 98489 (delta 10), reused 8 (delta 1), pack-reused 98451
Receiving objects: 100% (98489/98489), 59.23 MiB | 21.26 MiB/s, done.
Resolving deltas: 100% (63572/63572), done.
git clone https://github.com/ptabor/etcd.git -b 20200908-no-vendor  5.56s user 1.05s system 105% cpu 6.260 total

% du -h --exclude .git -d 1
944K	./clientv3
108K	./etcdmain
5.4M	./Documentation
384K	./security
384K	./mvcc
28K	./.github
8.0K	./version
144K	./contrib
240K	./proxy
2.5M	./etcdserver
112K	./embed
536K	./integration
332K	./tools
116K	./lease
108K	./logos
896K	./tests
960K	./raft
216K	./client
56K	./scripts
100K	./hack
464K	./etcdctl
3.0M	./pkg
620K	./functional
136K	./wal
152K	./auth
19M	.
```
2020-09-15 14:38:54 +02:00
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
Hitoshi Mitake
76539cee57 test: avoid non existing package for integration test 2020-08-03 00:13:47 +09:00
Gyuho Lee
6874b9a76b test: add "mod" to build tests
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-10 18:36:38 -07:00
Gyuho Lee
e94201c9fd test: set mod flags for bom test
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-10 13:37:18 -07:00
Gyuho Lee
027c26a0fd test: test '-mod=mod'
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-10 12:39:11 -07:00
Gyuho Lee
b6ea32ee0f test: ignore vendor directory in govet test
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-10 12:35:15 -07:00
Brandon Philips
03248a9045 bill-of-materials: updates for /etcd/v3 packaging
bill-of-materials:
- update to new package names

test/updatebom.sh scripts:
- Update to the right package names
- Don't add bom tool to go.mod
2020-04-28 00:57:52 +00:00
lucperkins
1be2f4b8e2 Documentation: Restructure directory to accommodate new site generation system
Signed-off-by: lucperkins <lucperkins@gmail.com>
2020-01-21 14:29:54 -08:00
Gyuho Lee
d4d57c5422 test: skip govet shadow tests for now
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-09-06 12:51:10 -07:00
Gyuho Lee
158354755a test: output etcd server logs when functional tests fail
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-07 10:16:15 -07:00
Tobias Schottdorf
362dfb4d08 test: s/20m/30m/g
Every other test build times out due to the 20 minute test timeout. I
doesn't seem like tests are actually hanging, it's more that 20 minutes
just isn't enough to run the tests any more.
2019-06-20 23:44:25 +02:00
Gyuho Lee
1caaa9ed4a test: test update for Go 1.12.5 and related changes
Update to Go 1.12.5 testing. Remove deprecated unused and gosimple
pacakges, and mask staticcheck 1006. Also, fix unconvert errors related
to unnecessary type conversions and following staticcheck errors:
- remove redundant return statements
- use for range instead of for select
- use time.Since instead of time.Now().Sub
- omit comparison to bool constant
- replace T.Fatal and T.Fatalf in tests with T.Error and T.Fatalf respectively because the goroutine calls T.Fatal must be called in the same goroutine as the test
- fix error strings that should not be capitalized
- use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...))
- use he status code of Canceled instead of grpc.ErrClientConnClosing which is deprecated
- use use status.Errorf instead of grpc.Errorf which is deprecated

Related #10528 #10438
2019-06-05 17:02:05 -04:00
shivaramr
9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Manjunath A Kumatagi
474cea1cd6 test: Add shadow tool 2019-02-06 23:20:06 -06:00
Sam Batschelet
2001786f02 *: Use -n instead of ! -z. [SC2236]
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2019-01-08 13:45:40 -05:00
Gyuho Lee
c58f5cfeda test: disable "unparam" for now
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-17 11:30:28 -08:00
Sam Batschelet
78d01140ff *: resolve shellcheck errors. 2018-10-25 19:41:11 -04:00
Vimal K
bcde798fdd *: path changes for moving to github/etcd-io/etcd 2018-09-03 21:57:23 +05:30
Gyuho Lee
02b94fcc0d test: fix "license-bill-of-materials" command
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 20:53:28 -07:00
Gyuho Lee
1c04820026 tests: integrate "github.com/mgechev/revive" to fmt tests
https://github.com/mgechev/revive

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-21 15:49:53 -07:00
Joe Betz
12acfc057a vendor: upgrade grpc/grpc-go to v1.11.3 2018-06-15 13:41:28 -07:00
Gyuho Lee
4cbfcfeede test: fix test "etcdserver/api/v2store"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 14:33:49 -07:00
Gyuho Lee
775e9d5ba6 test: add "unused_pass"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-09 15:39:44 -07:00
Gyuho Lee
18e1686bdf test: only print test targets in verbose mode
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-01 10:07:25 -07:00
Gyuho Lee
1af2228fca test: add "unconvert" test
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-30 15:32:16 -07:00
Gyuho Lee
358640de46 test: fix "markdown_you_pass"
"find" command was matching "vendor" directory in
my local machine.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-30 11:42:35 -07:00