Commit Graph

103 Commits (3d9890ff0e636764246259f722d494a5bd73cf19)

Author SHA1 Message Date
James Blair ab65ee3d01
Consolidate etcd dockerfiles.
We can consolidate by using docker build args to create the individual platform Dockerfile.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-04-26 17:09:25 +12:00
Marek Siarkowicz d0cd94a520
Merge pull request #15561 from serathius/makefile-entrypoint
Use makefile as entrypoint in CI
2023-04-01 09:02:09 +02:00
Marek Siarkowicz f53594309a Use makefile as entrypoint in CI
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-30 11:15:19 +02:00
Chao Chen a8c20f931e add etcd test analyzer build and integrate into measure-test-flakiness workflow
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-28 11:30:32 -07:00
Marek Siarkowicz d03ac88b36 tests: Document robustness tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-28 15:08:43 +02:00
Hanning Lin 8bc6b289fb add new goimport_pass
Signed-off-by: Hanning Lin <liam.hanninglin@outlook.com>
2023-03-16 05:50:17 +00:00
Marek Siarkowicz d475cf81a0 tests: Rename linearizability tests to robustness
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-26 14:36:18 +01:00
Benjamin Wang 1fe7b9793a etcdserver: add failpoints walBeforeSync and walAfterSync
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-08 09:08:09 +08:00
Benjamin Wang b9b7c9328e tools: fix the CSV format error and add build target 'tools' in Makefile
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-30 16:35:41 +08:00
Thomas Jungblut ab3c530b92 add linearizability nightlies for release 3.4/3.5
This CL refactors the tests to reuse a single workflow that has
parameters. This is then reused for PRs/pushes and the nightlies.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-16 11:00:16 +01:00
guiyong.ou 4f238837aa Make sure shellcheck exist
Signed-off-by: guiyong.ou <guiyong.ou@daocloud.io>
2022-12-05 15:36:16 +08:00
Bhargav Ravuri dadd7358f4 Makefile: Read GO_BUILD_FLAGS from env and prepend
Build flags read from env GO_BUILD_FLAGS are prepended to
flags in Makefile and sent to scripts/build.sh for building
executables (etcd, etcdctl & etcdutl).

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2022-12-01 09:43:26 +05:30
Marek Siarkowicz dd4d69ca91 tests: Cleanup gofail
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-27 20:35:39 +01:00
spacewander e73a25a1d0 ci: ensure the generated code is up-to-date
See https://github.com/etcd-io/etcd/pull/14612#issue-1419792069
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2022-10-31 19:58:21 +08:00
Marek Siarkowicz 8ce81a1624
Merge pull request #14611 from serathius/issue14370
tests: Add linearizability tests scenario for #14370
2022-10-25 14:03:39 +02:00
Marek Siarkowicz 837819860b tests: Add linearizability tests scenario for #14370
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-24 13:36:12 +02:00
Samuele Resca 3d9c5c6166 Adding fuzz test on v3rpc interfaces.
Signed-off-by: Samuele Resca <sr7@ad.datcon.co.uk>
Signed-off-by: Samuele Resca <samuele.resca@gmail.com>
2022-10-23 13:46:10 +01:00
Marek Siarkowicz 069e26e284 tests: Validate etcd linearizability
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-23 06:41:38 +02:00
Marek Siarkowicz bea478266e makefile: Raname targets update* to fix* to distinquish from update_dep
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-20 13:58:17 +02:00
Marek Siarkowicz bb139b15f8 makefile: Don't run update_dep.sh as it's not a check
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-20 13:55:51 +02:00
Marek Siarkowicz 05104ee9a7 makefile: Remove verify-revive as it is already run by golangci
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-20 13:55:51 +02:00
Marek Siarkowicz b8347edf3b makefile: Split fmt into separate verify commands
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-16 22:37:10 +02:00
Marek Siarkowicz 7bb114d171 makefile: Make static analysis commands easier to use
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-15 11:54:14 +02:00
Marek Siarkowicz a36bcfff1f Improve contributor guidelines and simplify development commands
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-14 09:39:32 +02:00
Ramsés Morales 3cdc4225e1 Followup to "Add golangci-lint config file"
Addressed comments by @ldez and added `lint-fix` target.

Signed-off-by: Ramsés Morales <ramses@gmail.com>
2022-07-28 17:55:22 -07:00
Ramsés Morales a7a48168a0 Add golangci-lint config file and `make` target.
Here we add file `.golangci.yaml`, to have a common configuration for
static analysis. If you use the following IDEs/editors, they will read
the file:

- `vim` with vim-go.
- VSCode.

The initial configuration file is based on Kubernetes' HEAD. We removed
a custom kubernetes-linter for custom kubernetes-logging. We also
changed to Golang version 1.17 (etcd's current target Golang version)
from 1.18.

Also, we added a new target to `Makefile`: `lint`. NOTE that auto-fixing
should be part of a later commit, once we are all happy with how the
configuration file is working for us.

As expected, this change fixes two issues found by this `.golangci.yaml`
in file `contrib/lock/client/client.go`:

- Dead code, removed.
- Innefective assignment, removed.

Finally, we are updating `CONTRIBUTING.md` to mention `golangci-lint`.

We will add a GitHub-action to run `golangci-lint` in a future change.

Local testing done:

- `make build`.
- `make test`.

Both are happy.

This is the initial step to fix
https://github.com/etcd-io/etcd/issues/14164.

Signed-off-by: Ramsés Morales <ramses@gmail.com>
2022-07-28 17:55:08 -07:00
Eduardo Patrocinio 5a93b087a6 Separate the build library functions and add a top level tools script
The current Makefile doesn't allow the compilation of the tools directory.
This commit creates a build library file, updates the Makefile
and a top level script fod building tools.

To build the tools, you can run make build_tools.

As before, you can run make build to build etcd binaries.
2022-06-10 11:43:10 -04:00
Eduardo Patrocinio 73766a92fb Update build file to run with an argument
The current Makefile doesn't allow the compilation of the tools directory.
This commit updates the Makefile and the build file to add an option
to build the tools.

To build the tools, you can run make build_tools.
2022-06-07 11:47:28 -04:00
Piotr Tabor 8a22d640a7 add OUTPUT_FILE='foo.log' env variable support to test.sh script.
Side consequence of this is that `make test-smoke` can become interactive again.
2022-04-18 22:54:51 +02:00
Piotr Tabor 47bb48dfdc
Merge pull request #13869 from wking/test-fail-exit-code-with-log-redirect-upstream
Makefile: Drop log tee calls
2022-04-07 09:12:19 +02:00
W. Trevor King c59cae5aaa Makefile: Drop log tee calls
We've had these since in one form or another since 23a302364c
(Makefile: initial commit, 2017-09-29), but in at least some cases the
underlying shell does not pipefail, a test failure gets swallowed, and
the make call exits zero despite failing the tests [1]:

  $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_etcd/109/pull-ci-openshift-etcd-openshift-4.11-unit/1509260812278042624/artifacts/test/build-log.txt
  TEST_OPTS: PASSES='unit'
  log-file: test-MTY0ODY3MTA1MQo.log
  PASSES='unit' ./test.sh 2>&1 | tee test-MTY0ODY3MTA1MQo.log
  % env GO111MODULE=off go get github.com/myitcv/gobin
  Running with --race
  Starting at: Wed Mar 30 20:10:52 UTC 2022

  'unit' started at Wed Mar 30 20:10:52 UTC 2022
  % (cd api && env go test -short -timeout=3m --race ./...)
  stderr: authpb/auth.pb.go:12:2: open /go/pkg/mod/github.com/gogo/protobuf@v1.3.2/gogoproto: permission denied
  stderr: authpb/auth.pb.go:13:2: open /go/pkg/mod/github.com/golang/protobuf@v1.5.2/proto: permission denied
  stderr: etcdserverpb/rpc.pb.go:17:2: open /go/pkg/mod/google.golang.org/genproto@v0.0.0-20210602131652-f16073e35f0c/googleapis/api/annotations: permission denied
  stderr: etcdserverpb/rpc.pb.go:18:2: open /go/pkg/mod/google.golang.org/grpc@v1.38.0: permission denied
  stderr: etcdserverpb/rpc.pb.go:19:2: open /go/pkg/mod/google.golang.org/grpc@v1.38.0/codes: permission denied
  stderr: etcdserverpb/rpc.pb.go:20:2: open /go/pkg/mod/google.golang.org/grpc@v1.38.0/status: permission denied
  stderr: etcdserverpb/gw/rpc.pb.gw.go:17:2: open /go/pkg/mod/github.com/golang/protobuf@v1.5.2/descriptor: permission denied
  stderr: etcdserverpb/gw/rpc.pb.gw.go:19:2: open /go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/runtime: permission denied
  stderr: etcdserverpb/gw/rpc.pb.gw.go:20:2: open /go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.16.0/utilities: permission denied
  FAIL: (code:1):
    % (cd api && env go test -short -timeout=3m --race ./...)
  stderr: etcdserverpb/gw/rpc.pb.gw.go:23:2: open /go/pkg/mod/google.golang.org/grpc@v1.38.0/grpclog: permission denied
  stderr: version/version.go:23:2: open /go/pkg/mod/github.com/coreos/go-semver@v0.3.0/semver: permission denied
  FAIL: 'unit' failed at Wed Mar 30 20:10:52 UTC 2022
  ! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-MTY0ODY3MTA1MQo.log

We can't drop the log aggregation, because the log files are used for
the panic/race grepping.  But I'm dropping the tee (so no more
synchronous updates, but we no longer have to worry about pipefail
handling).  And then if the test script fails, I'm dumping the log
file to stdout and exiting 1, so the overall run fails.

[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_etcd/109/pull-ci-openshift-etcd-openshift-4.11-unit/1509260812278042624
2022-04-01 11:06:50 -07:00
Manuel Rüger 29905029f6 Makefile: Additional logic fix
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-03-31 11:18:36 +02:00
Manuel Rüger ec29b9ee36 Makefile: Fix wrong target
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-03-31 09:48:21 +02:00
Manuel Rüger c544b2a2a5 Update go to 1.17.8 2022-03-23 20:11:12 +01:00
Marek Siarkowicz 396efd9608 Cleanup scripts in root directory 2022-02-02 13:50:44 +01:00
Manuel Rüger ce086a4ba6 *: Bump to go 1.17.6
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-01-12 03:13:27 +01:00
Manuel Rüger 9404d523b8 Build locally if docker-test container image does not exist
This should make it easier to bump the golang version
2022-01-12 03:00:08 +01:00
Manuel Rüger ce50f68166 *: Bump to go 1.17.5 2022-01-12 03:00:08 +01:00
Lili Cosic e6e279a14d *: Bump go to go v1.17.2 2021-10-27 13:44:54 +02:00
Sam Batschelet da34e9bf30
Merge pull request #13245 from serathius/makefile
*: Cleanup Makefile
2021-08-02 10:24:33 -04:00
halleyshx 2bcfc1ae2e update makefile for test egrep
add 'FAIL:' to egrep
```shell
[root@LF-136-9 etcd]# egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-MTYyNjIyOTc0MQo.log
[root@LF-136-9 etcd]# egrep "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-MTYyNjIyOTc0MQo.log
ok    go.etcd.io/etcd/server/v3/auth  3.247s
ok    go.etcd.io/etcd/server/v3/config  0.047s
ok    go.etcd.io/etcd/server/v3/datadir 0.035s
ok    go.etcd.io/etcd/server/v3/embed 1.944s
ok    go.etcd.io/etcd/server/v3/etcdmain  0.326s
FAIL  go.etcd.io/etcd/server/v3/etcdserver [build failed]
?     go.etcd.io/etcd/server/v3/etcdserver/api  [no test files]
ok    go.etcd.io/etcd/server/v3/etcdserver/api/etcdhttp 0.110s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/membership 0.479s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/rafthttp 0.251s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/snap 0.045s
?     go.etcd.io/etcd/server/v3/etcdserver/api/snap/snappb  [no test files]
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v2auth 1.470s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v2discovery  0.088s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v2error  0.034s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v2http 0.128s
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v2http/httptypes 0.033s
?     go.etcd.io/etcd/server/v3/etcdserver/api/v2stats  [no test files]
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v2store  0.068s
?     go.etcd.io/etcd/server/v3/etcdserver/api/v2v3 [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3alarm  [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3client [no test files]
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v3compactor  1.793s
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3election [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3election/v3electionpb  [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3election/v3electionpb/gw [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3lock [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3lock/v3lockpb  [no test files]
?     go.etcd.io/etcd/server/v3/etcdserver/api/v3lock/v3lockpb/gw [no test files]
ok    go.etcd.io/etcd/server/v3/etcdserver/api/v3rpc  0.089s
ok    go.etcd.io/etcd/server/v3/etcdserver/cindex 0.045s
ok    go.etcd.io/etcd/server/v3/lease 3.324s
ok    go.etcd.io/etcd/server/v3/lease/leasehttp 2.096s
?     go.etcd.io/etcd/server/v3/lease/leasepb [no test files]
?     go.etcd.io/etcd/server/v3/mock/mockstorage  [no test files]
?     go.etcd.io/etcd/server/v3/mock/mockstore  [no test files]
?     go.etcd.io/etcd/server/v3/mock/mockwait [no test files]
ok    go.etcd.io/etcd/server/v3/mvcc  8.805s
ok    go.etcd.io/etcd/server/v3/mvcc/backend  1.983s
?     go.etcd.io/etcd/server/v3/mvcc/backend/testing  [no test files]
?     go.etcd.io/etcd/server/v3/mvcc/buckets  [no test files]
?     go.etcd.io/etcd/server/v3/proxy/grpcproxy [no test files]
?     go.etcd.io/etcd/server/v3/proxy/grpcproxy/adapter [no test files]
?     go.etcd.io/etcd/server/v3/proxy/grpcproxy/cache [no test files]
ok    go.etcd.io/etcd/server/v3/proxy/httpproxy 0.046s
ok    go.etcd.io/etcd/server/v3/proxy/tcpproxy  0.035s
?     go.etcd.io/etcd/server/v3/verify  [no test files]
ok    go.etcd.io/etcd/server/v3/wal 0.513s
ok    go.etcd.io/etcd/server/v3/wal/walpb 0.045s
FAIL
FAIL: (code:2):
  % (cd server && env go test -short -timeout=3m --race --cpu=16 ./...)
FAIL: 'unit' failed at Wed Jul 14 10:29:37 CST 2021
```
2021-07-28 10:10:40 +08:00
Marek Siarkowicz 7b5f8fc71c *: Cleanup Makefile
* Move manual docker tests to ./tests/manual
* Move manual docker makefile targets to ./tests/manual/Makefile
* Remove unused makefile rules
2021-07-27 17:32:39 +02:00
Piotr Tabor c09aca1ba4 Split etcdctl into etcdctl (public API access) & etcdutl (direct surgery on files)
Motivation is as follows:

  - etcdctl we only depend on clientv3 APIs, no dependencies of bolt, backend, mvcc, file-layout
  - etcdctl can be officially supported across wide range of versions, while etcdutl is pretty specific to file format at particular version.
it's step towards desired modules layout, documented in: https://etcd.io/docs/next/dev-internal/modules/
2021-05-17 11:54:03 +02:00
Gyuho Lee 3d4629c1fb hack,scripts: rename "master" branch references to "main"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2021-05-12 10:40:28 -07:00
Piotr Tabor ce3dae6f83
Merge pull request #12873 from ptabor/20210417-test-docker-gcloud
Makefile: Use `gcloud auth configure-docker` instead of `gcloud docker ...` for test-images
2021-04-21 09:30:02 +02:00
Lili Cosic 81652d16ef Makefile: Fix build-docker-release-master
Since the Dockerfile files are now per arch, this adjusts to detect ARCH
and builds docker release from the Dockerfile.<ARCH> file.
2021-04-19 17:47:03 +02:00
Piotr Tabor 3423a949c0 Update go for 3.5: 1.15 -> 1.16.(3).
https://github.com/etcd-io/etcd/issues/12732
2021-04-19 16:50:54 +02:00
Piotr Tabor 5ad8880d77 Makefile: Use gcloud auth configure-docker instead of gcloud docker. 2021-04-17 10:11:09 +00:00
Piotr Tabor d4a8093ea5 Switch release-test (upgrade test) to use etcd 3.4 (instead of 3.3) as upgrade-base. 2021-04-08 01:15:16 +02:00
Piotr Tabor 3976d68ed3 raftExample: Allow closing raftexample node when snapshotting.
Fix race that made the raftExample test fail.
2021-02-26 08:56:12 +01:00