93 Commits

Author SHA1 Message Date
Wei Fu
aea1cd0077 feat: enable unparam lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-17 21:24:13 +08:00
Wei Fu
07effc4d0a *: fix revive linter
Remove old revive_pass in the bash scripts and migirate the revive.toml
into golangci linter_settings.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-24 14:21:11 +08:00
Wei Fu
aa97484166 *: enable goimports in verify-lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-21 21:14:09 +08:00
Wei Fu
df86cadd8b *: fix ineffassign lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-19 22:19:19 +08:00
Wei Fu
5e3910d96c *: fix govet-shadow lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-19 20:24:01 +08:00
Benjamin Wang
1b87ec499e test: de-flake test case TestMemberList
get memberlist immediately before each time checking the members.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-09-06 08:24:41 +01:00
Wei Fu
befb283cca tests: deflake TestKVDelete/ClientAutoTLS
For the sub test TestKVDelete/ClientAutoTLS, the timeout might be caused
by IO or task scheduled. It's really hard to reproduce this case. And
we don't add `VERBOSE=1` for e2e test, the pipeline doesn't show the
`EXPECT_DEBUG` log in time. It's also hard to debug when flaky case
show. So, this patch will enable `VERBOSE=1` to get timestamp in time.

And the one operation `del a c -w json` will be performed after two seconds
delay, we can increase the timeout from 15s to 30s just in case that the
put or del operations take more time in unstable env.

```
Warning: Keys between "a" and "c" will be deleted. Please interrupt the
command within next 2 seconds to cancel.
```

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-05-19 18:22:18 +08:00
Chao Chen
c846b087db migrate e2e auth tests to common #8
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-05-12 22:51:47 -07:00
Chao Chen
caed563e08 fix flaking auth member remove test
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-04-03 17:41:08 -07:00
Chao Chen
9a2553fe2f migrate auth tests to common #7
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-27 19:30:41 -07:00
Chao Chen
d7f992c351 enable pre-vote by default and add retry on member_test
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-17 15:15:13 -07:00
Chao Chen
c002e096b5 migration auth tests to common #5
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-03 12:26:36 -08:00
Chao Chen
d798816baf migrate auth tests to common #6
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-28 10:32:29 -08:00
Benjamin Wang
da4bf0f76f
Merge pull request #15261 from ahrtr/memberlist_20230208
clientv3: support serializable `MemberList` operation
2023-02-28 06:26:38 +08:00
Benjamin Wang
1f0d361848 clientv3: support serializable MemberList operation
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-25 07:23:39 +08:00
Chao Chen
b93745a862 migrate to auth test #4
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-23 10:46:31 -08:00
Chao Chen
c36ea3fdcf migrate auto tests to common #3
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-15 11:08:01 -08:00
Marek Siarkowicz
e73f55d4e9
Merge pull request #15028 from chaochn47/auth_test_split
tests/common: migrate auth tests #2
2023-01-01 18:58:39 +01:00
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
Wei Fu
4d0b91947e chore: delete // +build buildtag by go fix
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-29 14:17:05 +08:00
Chao Chen
a7da508ff6 tests/common: migrate auth tests #1
Signed-off-by: Chao Chen <chaochn@amazon.com>
2022-12-19 22:23:11 -08:00
Chao Chen
008df94901 tests/common: migrate auth tests #1
Signed-off-by: Chao Chen <chaochn@amazon.com>
2022-12-15 10:49:20 -08:00
Benjamin Wang
cd15507c65 test: enhance case TestEndpointHashKV to check both hash and hashRevision
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-25 18:49:16 +08:00
Bhargav Ravuri
2feec4fe68 comments: fix comments as per goword in go test files
Comments fixed as per goword in go test files that shell
function go_srcs_in_module lists as per changes on #14827

Helps in #14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2022-11-23 23:05:42 +05:30
Andrew Sims
f656fa0f49 add missing copyright headers
Signed-off-by: Andrew Sims <andrew.cameron.sims@gmail.com>
2022-11-23 19:13:43 +11:00
Thomas Jungblut
5b163aa507 Expect exit code enhancement
ExpectProcess and ExpectFunc now take the exit code of the process into
account, not just the matching of the tty output.

This also refactors the many tests that were previously succeeding on
matching an output from a failing cmd execution.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-11-14 11:19:41 +01:00
Benjamin Wang
86e71f026e test: update the definition of testRunner and clusterTestCases
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:18:51 +08:00
Benjamin Wang
fc23d0e83a test: add ClusterContext into the common ClusterConfig
ClusterContext is used by "e2e" or "integration" to extend the
ClusterConfig. The common test cases shouldn't care about what
data is encoded or included; instead "e2e" or "integration"
framework should decode or parse it separately.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:05:45 +08:00
Marek Siarkowicz
71b40b3abf tests: Extend common test to run previous release
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-07 06:51:59 +08:00
Benjamin Wang
c00ede393f test: fix pipeline errors due to PRs conflict
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-06 06:28:51 +08:00
Hitoshi Mitake
49db50c117
Merge pull request #14663 from ahrtr/auth_20221031
auth: check permission when performing maintainenence operations if auth is enabled
2022-11-05 23:13:29 +09:00
Benjamin Wang
dc0273b049 test: refactor the struct to make it clearer
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-04 19:28:32 +08:00
Benjamin Wang
f782891246 test: added auth test on maintenance API
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Benjamin Wang
1791ab5754 test: add common functions for auth test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Clark
fa9ee5cce9 tests: TestRunner.NewCluster accepts options
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-31 15:26:08 +08:00
Clark
e28b66f751 tests: add a ClusterOption interface for ClusterSize in config.ClusterConfig
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-26 23:41:09 +08:00
Benjamin Wang
5550041633
Merge pull request #14629 from clarkfw/fix-anti-pattern-naming
test: fix anti-pattern naming problem in config.ClusterConfig
2022-10-26 20:01:43 +08:00
Clark
08284c56e0 test: fix anti-pattern naming problem in config.ClusterConfig
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-26 15:47:19 +08:00
Benjamin Wang
42cfb74b4c test: define a default WithAuth to resolve error Unresolved reference 'WithAuth' from IDE
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-26 14:30:47 +08:00
Benjamin Wang
3ee2f5711e test: add common function "WithAuth"
We defines two common `WithAuth` functions for e2e and integration
test respectively. They are calling `integration.WithAuth` and
`e2e.WithAuth` respectively.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-25 02:41:49 +08:00
Benjamin Wang
4e0ccc69c9 test: refactor the client interface
It doesn't make sense to always pass a AuthConfig parameter for
test cases which do not enable auth at all. So refactoring the
Client interface method so that it accepts a `ClientOption`
variadic parameter.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-24 19:04:34 +08:00
Chao Chen
8d057ea2b8 common tests framework: cluster client creation fail with invalid auth
Signed-off-by: Chao Chen <chaochn@amazon.com>
2022-09-29 23:09:32 -07:00
Benjamin Wang
159ed15afc
Merge pull request #14479 from demoManito/fix/declaring-empty-slice
etcd: modify declaring empty slices
2022-09-20 05:22:59 +08:00
Benjamin Wang
d657f2f66b Test: increase the TestKVDelete's timeout to 15s
Sometimes it just needs more time to execute the test case,
so increase the timeout from 10s to 15s.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-09-18 04:26:30 +08:00
demoManito
72cf0cc04a etcd: modify declaring empty slices
declare an empty slice to var s []int replace  s :=[]int{}, https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices

Signed-off-by: demoManito <1430482733@qq.com>
2022-09-16 14:41:14 +08:00
Clark
6a5dd09fe6 tests: Migrate member remove tests to common framework
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-09-09 15:09:10 +08:00
Marek Siarkowicz
f0c95cadea
Merge pull request #14281 from clarkfw/migrate-member-add-tests
tests: Migrate member add tests to common framework
2022-09-06 09:27:28 +02:00
Clark
fcc076fb78 tests: Migrate member add tests to common framework
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-09-06 11:02:54 +08:00
Benjamin Wang
cc840336f0 move consistent_index forward when executing alarmList operation
The alarm list is the only exception that doesn't move consistent_index
forward. The reproduction steps are as simple as,

```
etcd --snapshot-count=5 &
for i in {1..6}; do etcdctl  alarm list; done
kill -9 <etcd_pid>
etcd
```

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-09-05 10:05:55 +08:00
Marek Siarkowicz
46fe4b8e1c tests: Rename common client lease methods to match
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-08-26 07:12:47 +02:00