247 Commits

Author SHA1 Message Date
D Tripp
640e54552a etcd 3.4: Install revive linter on CI if not installed.
This is based on commit 4f238837aa and pull request https://github.com/etcd-io/etcd/pull/14872.

Signed-off-by: D Tripp <38776199+thedtripp@users.noreply.github.com>
2024-07-03 23:44:16 +00:00
D Tripp
e3c0ac0bec etcd 3.4: Install shellcheck if not installed.
Include conditional logic to install shellcheck with correct architecture.

This is based on commit 4f23883 and pull request etcd-io#14872.

Signed-off-by: D Tripp <38776199+thedtripp@users.noreply.github.com>
2024-06-28 23:34:25 +00:00
D Tripp
f599316654 etcd 3.4: fix shellcheck violations [SC2086] by adding double quotes to variables where needed.
Signed-off-by: D Tripp <38776199+thedtripp@users.noreply.github.com>
2024-06-28 23:32:36 +00:00
Wei Fu
609be39ea9 .github: enable failpoints for integration tests
And introduce helper to toggle failpoints by makefile.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2024-04-04 22:32:23 +08:00
Siyuan Zhang
2caf0f0a12 Add schema verification when closing etcd.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-02-20 08:55:55 -08:00
Chao Chen
e61f1d886b [3.4] backport 12675: Cleanup grpc clientv3/naming API
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-10-24 09:17:32 -07:00
Piotr Tabor
6c0e4d97f1 Introduce grpc-1.30+ compatible client/v3/naming API.
This is not yet implementation, just API and tests to be filled
with implementation in next CLs,
tracked by: https://github.com/etcd-io/etcd/issues/12652

We propose here 3 packages:
 - clientv3/naming/endpoints ->
    That is abstraction layer over etcd that allows to write, read &
    watch Endpoints information. It's independent from GRPC API. It hides
    the storage details.

 - clientv3/naming/endpoints/internal ->
    That contains the grpc's compatible Update class to preserve the
    internal JSON mashalling format.

 - clientv3/naming/resolver ->
   That implements the GRPC resolver API, such that etcd can be
   used for connection.Dial in grpc.

Please see the grpc_naming.md document changes & grpcproxy/cluster.go
new integration, to see how the new abstractions work.

Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-10-19 12:59:24 -07:00
Marek Siarkowicz
3f6429d702 tests: Avoid testing package root tests in e2e
Changes invocation from `go test -timeout 30m -v -cpu 1,2,4 '' -v
--count 1 go.etcd.io/etcd/tests/e2e` to `go test -timeout 30m -v -cpu 1,2,4 -v --count 1 go.etcd.io/etcd/tests/e2e` (removes '').
Those braces caused tests to also run in root package.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-28 11:07:34 +02:00
Wei Fu
3fc5fbeaa0 fix: enable strict mode for CI
fixes: #15487

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-22 17:55:58 +08:00
Benjamin Wang
5413ce46dc bump go version to 1.17.3
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-19 18:34:04 +08:00
Benjamin Wang
095bbfc4ed lock down the version of shadow to v0.1.11
The latest vesion v0.1.12 was just released On Jul 27, 2022,
and it is causing issue (see below) on the govet check,

```
govet_shadow' started at Sun Jul 31 23:23:27 PDT 2022
go get: upgraded golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 => v0.0.0-20220722155237-a158d28d115b
go get: upgraded golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 => v0.0.0-20220722155257-8c9f86f7a55f
go get: upgraded golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 => v0.1.12
/root/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-prometheus@v1.2.0/client_metrics.go:7:2: missing go.sum entry for module providing package golang.org/x/net/context (imported by go.etcd.io/etcd/etcdserver/etcdserverpb); to add:
	go get go.etcd.io/etcd/etcdserver/etcdserverpb
/root/go/pkg/mod/google.golang.org/grpc@v1.26.0/internal/transport/controlbuf.go:28:2: missing go.sum entry for module providing package golang.org/x/net/http2 (imported by go.etcd.io/etcd/embed); to add:
	go get go.etcd.io/etcd/embed
/root/go/pkg/mod/google.golang.org/grpc@v1.26.0/internal/transport/controlbuf.go:29:2: missing go.sum entry for module providing package golang.org/x/net/http2/hpack (imported by github.com/soheilhy/cmux); to add:
	go get github.com/soheilhy/cmux@v0.1.4
/root/go/pkg/mod/google.golang.org/grpc@v1.26.0/server.go:36:2: missing go.sum entry for module providing package golang.org/x/net/trace (imported by go.etcd.io/etcd/embed); to add:
	go get go.etcd.io/etcd/embed
```

It isn't good to always to use the latest version. Instead, we should
lock down the version, and v0.1.11 was confirmed to be working.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-08-01 15:11:49 +08:00
Marek Siarkowicz
6cc1345a0b Migrate PR testing from travis to GitHub actions 2021-06-23 18:25:29 +02:00
Lili Cosic
a1691be1bd .travis,test: Turn race off in Travis for go version 1.15
Currently with race it fails, we can enable this at a later point.
2021-04-19 11:49:13 +02:00
jingyih
5f17aa2c8b test: auto detect branch when finding merge base 2020-03-31 10:59:44 -07:00
Gyuho Lee
29cdc9abfc test: output etcd server logs when functional tests fail
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-07 10:16:44 -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
Gyuho Lee
cdadc4638d test: enable static analysis "SA4004"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-30 10:04:44 -07:00
Gyuho Lee
5fd9270d6c test: disable SA4004 temporarily
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-27 14:21:17 -07:00
Gyuho Lee
ad4b747ed4 test: configure go test -cpu flag
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-20 14:10:30 -07:00
Gyuho Lee
fdf4a12d3c test: rename etcd functional test data directories
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-11 19:52:23 -07:00
Gyuho Lee
7ed4803fb0 test: remove "-a" GO_BUILD_FLAGS
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-11 01:45:06 -07:00
Gyuho Lee
7e56c3e737 test: remove backup data from functional tests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-11 01:18:15 -07:00
Gyuho Lee
6cf9979cf0 test: remove wait commands
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-10 18:38:01 -07:00
Gyuho Lee
eabb40f0ae test: combine "compile_pass" into "build_pass"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-10 17:07:42 -07:00
Gyuho Lee
0e7f1100e3 cover: move coverage test script to "tests"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-09 10:47:32 -07:00
Gyuho Lee
0c327ea456 test: move "e2e" and "functional"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-09 10:47:25 -07:00
Gyuho Lee
85e050a120 *: rename, clean up functional tests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-07 10:00:00 -07:00
Gyuho Lee
d7b468ec6f test: bump up test timeout to 20m
Recently, we've added bunch of tests...

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-04 13:45:12 -07:00
Gyuho Lee
173fdc37a3 test: run shellcheck only on bash scripts
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-02 11:45:04 -07:00
Gyuho Lee
048a1b14d5 test: bump up default timeout for now
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-30 14:42:45 -07:00
Gyuho Lee
28766fb002 test: run test script with new "functional-tester"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-30 11:25:23 -07:00
Gyuho Lee
9c995fab9b test: fix shellcheck
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-22 10:39:23 -07:00
Wenjia Zhang
3571f406aa scripts: add TESTCASE flag to run single unit test
Enable user to run specified test case with different TIMEOUT expectation
when needed.
2018-03-13 13:54:20 -07:00
Gyuho Lee
1da0818186 build: use "bash" syntax, clean up
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-27 11:07:36 -08:00
Gyuho Lee
18f8b1b1e1 build,test: set up GOPATH in build script
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-27 10:23:14 -08:00