318 Commits

Author SHA1 Message Date
Piotr Tabor
9abc895122 Goimports: Apply automated fixing to test files as well.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 13:04:45 +01:00
Piotr Tabor
9e1abbab6e Fix goimports in all existing files. Execution of ./scripts/fix.sh
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 09:41:31 +01:00
Piotr Tabor
5a28a02b97 ./scripts/fix.sh: Takes care of goimports across the whole project.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-28 16:37:55 +01:00
Benjamin Wang
27ca4d5488 remove the dependency on busybox
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-23 17:28:24 +08:00
Benjamin Wang
5d78d6d4b1 release: support kick off release in current branch
Currently when triggering release, it always pull remote repo and
checkout main branch. Any changes which are merged into the target
release branch (e.g. release-3.5) will be ignored. It isn't
convenient for test, including in github workflow and local environment.
So we need to support triggering release in current branch.

Note: --current-branch should only be called with DRY_RUN=true

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-12 09:35:03 +08: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
Benjamin Wang
cc58edecf2 raft: add raft into the tools/mod
Previously etcdservers depends on raft/raftpb/raft.proto directly.
After moving raft to a separate repo, we need to add raft to the
tools/mod, and get raft included in the -I protc flags.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-02 15:36:41 +08:00
Benjamin Wang
b1cdf16988 scripts: cleanup raft from all script files
No need to generate proto file;
No need to test coverage for raft;
No need to run any test for raft module;
NO need to run any test for raftexample;

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-02 13:58:11 +08:00
Marek Siarkowicz
dd4d69ca91 tests: Cleanup gofail
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-27 20:35:39 +01:00
Bhargav Ravuri
18463081ad scripts: go_srcs_in_module to list test packages files
The shell func go_srcs_in_module will now list
1. go src files
2. go test files belong to same packages
3. go test files that belong to _test packages

Fixes #14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2022-11-23 23:50:21 +05:30
Bhargav Ravuri
cc77eb1011 scripts: go_srcs_in_module to list go source + test files
The shell function go_srcs_in_module will list go test files
along with go src files in the specified module. This helps
in identifying the copyright header misses in test files.

Fixes #14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2022-11-23 21:52:09 +05:30
Dirkjan Bussink
c26dabacbd
release: build with consistent paths
This changes the builds to always add -trimpath which removes specific
build time paths from the binary (like current directories etc).

Improves build reproducability to make the final binary independent from
the specific build path.

Lastly, when stripping debug symbols, also add -w to strip DWARF symbols
as well which aren't needed in that case either.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-11-21 15:06:11 +01:00
Marek Siarkowicz
ebf41c2d48 Avoid getting gofail/runtime when failpoints are disabled
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-16 11:09:38 +01:00
Marek Siarkowicz
f96957adba tests: Add compact failpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-15 14:59:03 +01:00
Benjamin Wang
228f493c76 rpc.proto: regenerate rpc.proto related files
Run
1. ./script/genproto.sh
2. ./scripts/update_proto_annotations.sh

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 08:33:44 +08:00
Marek Siarkowicz
2a1055c7f3 raft: Remove dependency on etcd api
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-08 13:56:46 +01:00
spacewander
a774510a90 address review
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2022-10-31 21:23:48 +08: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
bbda80486f Updating script for static analysis readiness.
Signed-off-by: Samuele Resca <samuele.resca@gmail.com>
2022-10-23 13:46:10 +01:00
Samuele Resca
37d62ba477 Updating fuzzing script with list of target.
Signed-off-by: Samuele Resca <samuele.resca@gmail.com>
2022-10-23 13:46:10 +01: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
Benjamin Wang
328a33668b functional_test: stop etcd and cleanup data when test is successful
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-09 09:23:13 +08:00
Benjamin Wang
742c925a27
Merge pull request #14387 from lavacat/main-functional
functional: remove SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT command
2022-10-09 08:25:25 +08:00
Marek Siarkowicz
e0647b9d42
Merge pull request #14481 from serathius/verify-fmt
makefile: Split fmt into separate verify commands
2022-09-19 12:38:30 +02:00
Benjamin Wang
536743042b Build: remove the invalid quote character ' for flag -ldflags
It isn't valid to start with quote character ' for flag -ldflags.
Go cmd older than 1.19 just ignores the error. Starting from go 1.19,
Go cmd will fail with error message something like below,
```
stderr: invalid value "'-X=go.etcd.io/etcd/api/v3/version.GitSHA=01250c9'" for flag -ldflags: parameter may not start with quote character '
```

Actually we don't have such quote character ' when building
etcd/etcdctl/etcdutl.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-09-18 04:19:40 +08: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
Bogdan Kanivets
c31d758189 functional: remove SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT command
Problem: both SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT and test.sh
will attempt to stop agents and remove directories.

Solution: since test.sh creates directories and starts test, it should be
responsible for cleanup.

See https://github.com/etcd-io/etcd/issues/14384

Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
2022-09-15 10:55:32 -07:00
Benjamin Wang
d8ee37641d Cleanup all etcd-agent and etcd processes when the test finishes
There are two cases, when interrupted by users, then forcibly kill
all processes. Otherwise, gracefully terminate all processes.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-08-18 17:15:39 +08:00
Benjamin Wang
7400d6c363 Update scripts/release.sh to remove message related to travis.yml
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-07-11 10:31:51 +08: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
Marek Siarkowicz
63e47656e0 scripts: Detect staged files before building release 2022-05-18 12:21:43 +02:00
Marek Siarkowicz
e737f4296c scripts: Avoid additional repo clone
This PR removes additional clone when building artifacts.

When releasing v3.5.4 this clone was main cause of issues and
confusion about what release script is doing.

release.sh script already clones repo in /tmp/ directory, so clonning
before build is not needed. As precautions for bug in script leaving
/tmp/ clone in bad state  I moved "Verify the latest commit has the
version tag" and added "Verify the clean working tree" to be always run
before build.
2022-05-16 14:37:47 +02:00
Marek Siarkowicz
5472e589cf scripts: Add tests for release scripts 2022-04-25 10:12:01 +02:00
Piotr Tabor
8d36956d0e
Merge pull request #13955 from ptabor/20220417-tests-improvements
test.sh script improvement (OsX centric)
2022-04-19 12:18:45 +02:00
Vimal Kumar
12ab72a6ff smoke test:fix license header check 2022-04-19 08:35:22 +05:30
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
55a7c91de9 test.sh: Tools run correctly on OsX
- The location of installed tools is found using `go list`
- ETCD_VERIFY env variable is printed in repro command line.
2022-04-17 23:28:26 +02:00
Piotr Tabor
cf2d98cc88 Fix PASSES="build" on OSX
`readlink -f` is supported since OsX 12.3.

```
% env GO_BUILD_FLAGS=-v CGO_ENABLED=0 go build -v -installsuffix=cgo -ldflags='-X=go.etcd.io/etcd/api/v3/version.GitSHA=4ac59dbe3' -o=bin/tools/local-tester/bridge ./tools/local-tester/bridge
readlink: illegal option -- m
usage: readlink [-fn] [file ...]
mkdir: /functional: Read-only file system
% ./tests/functional/build.sh
stderr: go build go.etcd.io/etcd/tests/v3/functional/cmd/etcd-agent: mkdir /functional: read-only file system
stderr: go build go.etcd.io/etcd/tests/v3/functional/cmd/etcd-proxy: mkdir /functional: read-only file system
stderr: go build go.etcd.io/etcd/tests/v3/functional/cmd/etcd-runner: mkdir /functional: read-only file system
stderr: go test go.etcd.io/etcd/tests/v3/functional/cmd/etcd-tester.test: mkdir /functional: read-only file system
```
2022-04-17 23:21:37 +02:00
Marek Siarkowicz
98764fadef scripts: Remove Windows build scripts 2022-04-12 10:34:10 +02:00
Marek Siarkowicz
ae57fe5d30
Merge pull request #13885 from serathius/verify
server: Add verification of whether lock was called within out outside of apply
2022-04-05 16:22:52 +02:00
Marek Siarkowicz
1d3517020b server: Add verification of whether lock was called within out outside of apply 2022-04-05 15:34:45 +02:00
Marek Siarkowicz
8d8271f6d1
Merge pull request #13175 from karuppiah7890/issue-13167-measure-flakyness
scripts: add script to measure percentage of commits with failed status
2022-04-05 15:25:47 +02:00
Piotr Tabor
d4dcd3061d Fix flakes in TestV3LeaseCheckpoint/Checkpointing_disabled,_lease_TTL_is_reset
I think strong (not-equal) relationship was too restrictive when expressed with 1s granularity.

```
        logger.go:130: 2022-04-03T22:15:15.242+0200	WARN	m1	leader failed to send out heartbeat on time; took too long, leader is overloaded likely from slow disk	{"member": "m1", "to": "cb785755eb80ac1", "heartbeat-interval": "10ms", "expected-duration": "20ms", "exceeded-duration": "24.666613ms"}
        logger.go:130: 2022-04-03T22:15:15.262+0200	INFO	m-1	published local member to cluster through raft	{"member": "m-1", "local-member-id": "e2dd9f523aa7be87", "local-member-attributes": "{Name:m-1 ClientURLs:[unix://127.0.0.1:2196386040]}", "cluster-id": "b4b8e7e41c23c8b5", "publish-timeout": "5.2s"}
        v3_lease_test.go:415: Expected lease ttl (4m58s) to be greather than (4m58s)
```
2022-04-03 23:13:01 +02:00
Piotr Tabor
90796720c1 Reduce integration test parallelism to 2 packages at once.
Especially with 'race' detection, running O(cpu) integrational tests was causing CPU overloads and timeouts.
2022-04-03 14:48:36 +02:00
ahrtr
edce939f6e add one more field storageVersion into StatusResponse
When performing the downgrade operation, users can confirm whether each member
is ready to be downgraded using the field 'storageVersion'. If it's equal to the
'target version' in the downgrade command, then it's ready to be downgraded;
otherwise, the etcd member is still in progress of processing the db file.
2022-03-18 07:04:44 +08:00
cuishuang
b7824b794b fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>

fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-07 20:28:53 +08:00