Skip to content

Commit e4f7dd2

Browse files
committed
OTE extension for openshift etcd with vendor files
This commit adds the OpenShift Tests Extension (OTE) framework for etcd, including the etcd-tests-ext binary and all required vendor dependencies. Changes include: - New etcd-tests-ext command in cmd/etcd-tests-ext/ - Extended test framework in tests/extended/ - Updated Makefile with OTE build targets - Added vendor dependencies for test framework - Updated .gitignore and go.mod/go.sum
1 parent e2b3dfd commit e4f7dd2

2,917 files changed

Lines changed: 1052467 additions & 249 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@ hack/tls-setup/certs
1616
.idea
1717
/contrib/raftexample/raftexample
1818
/contrib/raftexample/raftexample-*
19-
/vendor
2019
/tests/e2e/default.proxy
20+
/vendor
2121
*.tmp
2222
*.bak
2323
.gobincache/
24+
_output
25+
etcd-tests-ext
26+
etcd-tests-ext.gz
27+
28+
# Test output files
29+
junit.xml
30+
report.json
31+
test-results/
32+
33+
# OpenShift Tests Extension metadata
34+
.openshift-tests-extension/openshift_payload_*.json

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,49 @@ fix: sync-toolchain-directive
600600
.PHONY: sync-toolchain-directive
601601
sync-toolchain-directive:
602602
./scripts/sync_go_toolchain_directive.sh
603+
604+
605+
# OpenShift Tests Extension variables
606+
TESTS_EXT_BINARY ?= etcd-tests-ext
607+
TESTS_EXT_PACKAGE ?= ./cmd/etcd-tests-ext
608+
TESTS_EXT_LDFLAGS ?= -X 'main.CommitFromGit=$(shell git rev-parse --short HEAD)' \
609+
-X 'main.BuildDate=$(shell date -u +%Y-%m-%dT%H:%M:%SZ)' \
610+
-X 'main.GitTreeState=$(shell if git diff-index --quiet HEAD --; then echo clean; else echo dirty; fi)'
611+
612+
# Build the openshift-tests-extension binary
613+
.PHONY: tests-ext-build
614+
tests-ext-build:
615+
GOOS=$(GOOS) GOARCH=$(GOARCH) GO_COMPLIANCE_POLICY=exempt_all CGO_ENABLED=0 \
616+
go build -o $(TESTS_EXT_BINARY) -ldflags "$(TESTS_EXT_LDFLAGS)" $(TESTS_EXT_PACKAGE)
617+
618+
# Update test metadata
619+
.PHONY: tests-ext-update
620+
tests-ext-update:
621+
./$(TESTS_EXT_BINARY) update
622+
623+
# Clean tests extension artifacts
624+
.PHONY: tests-ext-clean
625+
tests-ext-clean:
626+
rm -f $(TESTS_EXT_BINARY) $(TESTS_EXT_BINARY).gz
627+
628+
# Run tests extension help
629+
.PHONY: tests-ext-help
630+
tests-ext-help:
631+
./$(TESTS_EXT_BINARY) --help
632+
633+
634+
# Run sanity test
635+
.PHONY: tests-ext-sanity
636+
tests-ext-sanity:
637+
./$(TESTS_EXT_BINARY) run-suite "openshift/etcd/conformance/parallel"
638+
639+
# List available tests
640+
.PHONY: tests-ext-list
641+
tests-ext-list:
642+
./$(TESTS_EXT_BINARY) list tests
643+
644+
# Show extension info
645+
.PHONY: tests-ext-info
646+
tests-ext-info:
647+
./$(TESTS_EXT_BINARY) info
648+

cmd/etcd-tests-ext/main.go

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"strings"
7+
8+
"github.com/openshift-eng/openshift-tests-extension/pkg/cmd"
9+
e "github.com/openshift-eng/openshift-tests-extension/pkg/extension"
10+
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
11+
g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
12+
13+
"github.com/spf13/cobra"
14+
15+
// The import below is necessary to ensure that the openshift etcd tests are registered with the extension.
16+
_ "go.etcd.io/etcd/tests/v3/extended"
17+
)
18+
19+
func main() {
20+
registry := e.NewRegistry()
21+
ext := e.NewExtension("openshift", "payload", "etcd")
22+
23+
// Suite: conformance/parallel (fast, parallel-safe)
24+
ext.AddSuite(e.Suite{
25+
Name: "openshift/etcd/conformance/parallel",
26+
Parents: []string{"openshift/conformance/parallel"},
27+
Qualifiers: []string{
28+
`!(name.contains("[Serial]") || name.contains("[Slow]"))`,
29+
},
30+
})
31+
32+
// Suite: conformance/serial (explicitly serial tests)
33+
ext.AddSuite(e.Suite{
34+
Name: "openshift/etcd/conformance/serial",
35+
Parents: []string{"openshift/conformance/serial"},
36+
Qualifiers: []string{
37+
`name.contains("[Serial]")`,
38+
},
39+
})
40+
41+
// Suite: optional/slow (long-running tests)
42+
ext.AddSuite(e.Suite{
43+
Name: "openshift/etcd/optional/slow",
44+
Parents: []string{"openshift/optional/slow"},
45+
Qualifiers: []string{
46+
`name.contains("[Slow]")`,
47+
},
48+
})
49+
50+
// Suite: all (includes everything)
51+
ext.AddSuite(e.Suite{
52+
Name: "openshift/etcd/all",
53+
})
54+
55+
specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
56+
if err != nil {
57+
panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error()))
58+
}
59+
60+
// Ensure [Disruptive] tests are also [Serial] (for any future tests that might need this)
61+
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
62+
if strings.Contains(spec.Name, "[Disruptive]") && !strings.Contains(spec.Name, "[Serial]") {
63+
spec.Name = strings.ReplaceAll(
64+
spec.Name,
65+
"[Disruptive]",
66+
"[Serial][Disruptive]",
67+
)
68+
}
69+
})
70+
71+
// Preserve original-name labels for renamed tests
72+
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
73+
for label := range spec.Labels {
74+
if strings.HasPrefix(label, "original-name:") {
75+
parts := strings.SplitN(label, "original-name:", 2)
76+
if len(parts) > 1 {
77+
spec.OriginalName = parts[1]
78+
}
79+
}
80+
}
81+
})
82+
83+
// Ignore obsolete tests
84+
ext.IgnoreObsoleteTests(
85+
// "[sig-etcd] <test name here>",
86+
)
87+
88+
// Initialize environment before running any tests
89+
specs.AddBeforeAll(func() {
90+
// do stuff
91+
})
92+
93+
ext.AddSpecs(specs)
94+
registry.Register(ext)
95+
96+
root := &cobra.Command{
97+
Long: "Etcd Tests Extension",
98+
}
99+
100+
root.AddCommand(cmd.DefaultExtensionCommands(registry)...)
101+
102+
if err := root.Execute(); err != nil {
103+
os.Exit(1)
104+
}
105+
}

go.mod

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.23.0
55
toolchain go1.23.7
66

77
replace (
8+
github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12
89
go.etcd.io/etcd/api/v3 => ./api
910
go.etcd.io/etcd/client/pkg/v3 => ./client/pkg
1011
go.etcd.io/etcd/client/v2 => ./client/v2
@@ -20,7 +21,8 @@ replace (
2021
require (
2122
github.com/bgentry/speakeasy v0.1.0
2223
github.com/dustin/go-humanize v1.0.0
23-
github.com/spf13/cobra v1.1.3
24+
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250916161632-d81c09058835
25+
github.com/spf13/cobra v1.8.1
2426
github.com/spf13/pflag v1.0.5
2527
go.etcd.io/bbolt v1.3.11
2628
go.etcd.io/etcd/api/v3 v3.5.21
@@ -35,43 +37,53 @@ require (
3537
go.etcd.io/etcd/tests/v3 v3.5.21
3638
go.uber.org/zap v1.17.0
3739
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
38-
google.golang.org/grpc v1.59.0
40+
google.golang.org/grpc v1.64.0
3941
gopkg.in/cheggaaa/pb.v1 v1.0.28
4042
)
4143

4244
require (
45+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
4346
github.com/beorn7/perks v1.0.1 // indirect
4447
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
4548
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4649
github.com/coreos/go-semver v0.3.0 // indirect
4750
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
48-
github.com/go-logr/logr v1.3.0 // indirect
51+
github.com/fatih/color v1.18.0 // indirect
52+
github.com/go-logr/logr v1.4.3 // indirect
4953
github.com/go-logr/stdr v1.2.2 // indirect
54+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
5055
github.com/gogo/protobuf v1.3.2 // indirect
5156
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
5257
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5358
github.com/golang/protobuf v1.5.4 // indirect
5459
github.com/google/btree v1.0.1 // indirect
60+
github.com/google/cel-go v0.17.8 // indirect
61+
github.com/google/go-cmp v0.7.0 // indirect
62+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
5563
github.com/gorilla/websocket v1.4.2 // indirect
5664
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
5765
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
5866
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
5967
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
60-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
68+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
6169
github.com/jonboulle/clockwork v0.2.2 // indirect
6270
github.com/json-iterator/go v1.1.11 // indirect
63-
github.com/mattn/go-colorable v0.1.11 // indirect
71+
github.com/mattn/go-colorable v0.1.13 // indirect
6472
github.com/mattn/go-runewidth v0.0.9 // indirect
6573
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
6674
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6775
github.com/modern-go/reflect2 v1.0.1 // indirect
6876
github.com/olekukonko/tablewriter v0.0.5 // indirect
77+
github.com/onsi/ginkgo/v2 v2.25.1 // indirect
78+
github.com/onsi/gomega v1.38.2 // indirect
79+
github.com/pkg/errors v0.9.1 // indirect
6980
github.com/prometheus/client_golang v1.11.1 // indirect
7081
github.com/prometheus/client_model v0.2.0 // indirect
7182
github.com/prometheus/common v0.26.0 // indirect
7283
github.com/prometheus/procfs v0.6.0 // indirect
7384
github.com/sirupsen/logrus v1.9.3 // indirect
7485
github.com/soheilhy/cmux v0.1.5 // indirect
86+
github.com/stoewer/go-strcase v1.2.0 // indirect
7587
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
7688
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
7789
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect
@@ -84,20 +96,18 @@ require (
8496
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
8597
go.uber.org/atomic v1.7.0 // indirect
8698
go.uber.org/multierr v1.6.0 // indirect
87-
golang.org/x/crypto v0.36.0 // indirect
88-
golang.org/x/net v0.38.0 // indirect
89-
golang.org/x/sys v0.31.0 // indirect
90-
golang.org/x/text v0.23.0 // indirect
99+
go.yaml.in/yaml/v3 v3.0.4 // indirect
100+
golang.org/x/crypto v0.41.0 // indirect
101+
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
102+
golang.org/x/net v0.43.0 // indirect
103+
golang.org/x/sys v0.35.0 // indirect
104+
golang.org/x/text v0.28.0 // indirect
105+
golang.org/x/tools v0.36.0 // indirect
91106
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
92-
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
93-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
94-
google.golang.org/protobuf v1.33.0 // indirect
107+
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
108+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect
109+
google.golang.org/protobuf v1.36.7 // indirect
95110
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
96111
gopkg.in/yaml.v2 v2.4.0 // indirect
97112
sigs.k8s.io/yaml v1.2.0 // indirect
98-
go.etcd.io/gofail v0.2.0 // indirect
99-
github.com/urfave/cli v1.22.4 // indirect
100-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
101-
github.com/russross/blackfriday/v2 v2.0.1 //indirect
102-
github.com/shurcooL/sanitized_anchor_name v1.0.0 //indirect
103113
)

0 commit comments

Comments
 (0)