From 0d277f8739b889154fc5d77b596d9144fd52ad44 Mon Sep 17 00:00:00 2001 From: Fabio Bertinatto Date: Thu, 11 Dec 2025 15:47:17 -0300 Subject: [PATCH] Revert "CNTRLPLANE-1258:Migrate to single-module OTE test infrastructure" --- .gitignore | 3 +- Makefile | 48 ++ OWNERS | 8 + README.md | 33 +- cmd/openshift-apiserver-tests-ext/main.go | 54 -- go.mod | 1 - go.sum | 2 - images/Dockerfile.rhel | 5 +- test/extended/tests-extension/Makefile | 88 +++ test/extended/tests-extension/OWNERS | 17 + test/extended/tests-extension/README.md | 242 +++++++ .../cmd/openshift-apiserver-tests-ext/main.go | 113 ++++ test/extended/tests-extension/go.mod | 88 +++ test/extended/tests-extension/go.sum | 229 +++++++ test/extended/tests-extension/main.go | 12 + .../openshift-tests-extension/LICENSE | 201 ------ .../openshift-tests-extension/pkg/cmd/cmd.go | 23 - .../pkg/cmd/cmdimages/cmdimages.go | 36 - .../pkg/cmd/cmdinfo/info.go | 38 -- .../pkg/cmd/cmdlist/list.go | 133 ---- .../pkg/cmd/cmdrun/runsuite.go | 114 ---- .../pkg/cmd/cmdrun/runtest.go | 112 ---- .../pkg/cmd/cmdupdate/update.go | 84 --- .../pkg/dbtime/time.go | 26 - .../pkg/extension/extension.go | 165 ----- .../extension/extensiontests/environment.go | 92 --- .../pkg/extension/extensiontests/result.go | 69 -- .../extension/extensiontests/result_writer.go | 164 ----- .../pkg/extension/extensiontests/spec.go | 613 ------------------ .../pkg/extension/extensiontests/task.go | 31 - .../pkg/extension/extensiontests/types.go | 119 ---- .../pkg/extension/registry.go | 39 -- .../pkg/extension/types.go | 94 --- .../pkg/flags/component.go | 25 - .../pkg/flags/concurrency.go | 23 - .../pkg/flags/environment.go | 114 ---- .../pkg/flags/names.go | 24 - .../pkg/flags/output.go | 95 --- .../pkg/flags/suite.go | 21 - .../pkg/junit/types.go | 104 --- .../pkg/util/sets/LICENSE | 202 ------ .../pkg/util/sets/README.md | 3 - .../pkg/util/sets/byte.go | 137 ---- .../pkg/util/sets/doc.go | 19 - .../pkg/util/sets/empty.go | 21 - .../pkg/util/sets/int.go | 137 ---- .../pkg/util/sets/int32.go | 137 ---- .../pkg/util/sets/int64.go | 137 ---- .../pkg/util/sets/set.go | 236 ------- .../pkg/util/sets/string.go | 137 ---- .../pkg/version/version.go | 11 - vendor/modules.txt | 15 - 52 files changed, 850 insertions(+), 3844 deletions(-) delete mode 100644 cmd/openshift-apiserver-tests-ext/main.go create mode 100644 test/extended/tests-extension/Makefile create mode 100644 test/extended/tests-extension/OWNERS create mode 100644 test/extended/tests-extension/README.md create mode 100644 test/extended/tests-extension/cmd/openshift-apiserver-tests-ext/main.go create mode 100644 test/extended/tests-extension/go.mod create mode 100644 test/extended/tests-extension/go.sum create mode 100644 test/extended/tests-extension/main.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/LICENSE delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmd.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages/cmdimages.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo/info.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist/list.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate/update.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/dbtime/time.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extension.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/environment.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/task.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/registry.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/types.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/component.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/concurrency.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/environment.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/names.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/output.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/suite.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/junit/types.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/LICENSE delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/README.md delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/byte.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/doc.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/empty.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int32.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int64.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/set.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/string.go delete mode 100644 vendor/github.com/openshift-eng/openshift-tests-extension/pkg/version/version.go diff --git a/.gitignore b/.gitignore index 61cfcc3d20..dee437ec16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /openshift-apiserver -/openshift-apiserver-tests-ext -/openshift-apiserver-tests-ext.gz /_output .idea +/test/extended/tests-extension/bin/ diff --git a/Makefile b/Makefile index 264b7ef079..82bf58f793 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,22 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \ IMAGE_REGISTRY?=registry.svc.ci.openshift.org +# ------------------------------------------------------------------- +# OpenShift Tests Extension (OpenShift API Server) +# ------------------------------------------------------------------- +TESTS_EXT_BINARY := openshift-apiserver-tests-ext +TESTS_EXT_DIR := ./test/extended/tests-extension +TESTS_EXT_OUTPUT := $(TESTS_EXT_DIR)/$(TESTS_EXT_BINARY) +TESTS_EXT_PACKAGE := ./cmd/openshift-apiserver-tests-ext + +TESTS_EXT_GIT_COMMIT := $(shell git rev-parse --short HEAD) +TESTS_EXT_BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') +TESTS_EXT_GIT_TREE_STATE := $(shell if git diff --quiet; then echo clean; else echo dirty; fi) + +TESTS_EXT_LDFLAGS := -X 'github.com/openshift-eng/openshift-tests-extension/pkg/version.CommitFromGit=$(TESTS_EXT_GIT_COMMIT)' \ + -X 'github.com/openshift-eng/openshift-tests-extension/pkg/version.BuildDate=$(TESTS_EXT_BUILD_DATE)' \ + -X 'github.com/openshift-eng/openshift-tests-extension/pkg/version.GitTreeState=$(TESTS_EXT_GIT_TREE_STATE)' + # This will call a macro called "build-image" which will generate image specific targets based on the parameters: # $0 - macro name # $1 - target suffix @@ -20,6 +36,10 @@ $(call build-image,ocp-openshift-apiserver,$(IMAGE_REGISTRY)/ocp/4.3:openshift-a $(call verify-golang-versions,images/Dockerfile.rhel) +clean: tests-ext-clean + $(RM) ./openshift-apiserver +.PHONY: clean + GO_TEST_PACKAGES := ./pkg/... ./cmd/... update: @@ -35,3 +55,31 @@ verify: hack/verify-generated-defaulters.sh hack/verify-generated-openapi.sh .PHONY: verify + +# ------------------------------------------------------------------- +# Build binary with metadata (CI-compliant) +# ------------------------------------------------------------------- +.PHONY: tests-ext-build +tests-ext-build: + $(MAKE) -C $(TESTS_EXT_DIR) build + +# ------------------------------------------------------------------- +# Run "update" and strip env-specific metadata +# ------------------------------------------------------------------- +.PHONY: tests-ext-update +tests-ext-update: + $(MAKE) -C $(TESTS_EXT_DIR) build-update + +# ------------------------------------------------------------------- +# Clean test extension binaries +# ------------------------------------------------------------------- +.PHONY: tests-ext-clean +tests-ext-clean: + $(MAKE) -C $(TESTS_EXT_DIR) clean + +# ------------------------------------------------------------------- +# Run test suite +# ------------------------------------------------------------------- +.PHONY: run-suite +run-suite: + $(MAKE) -C $(TESTS_EXT_DIR) run-suite SUITE=$(SUITE) JUNIT_DIR=$(JUNIT_DIR) diff --git a/OWNERS b/OWNERS index 9faaf0044e..34fccdce5b 100644 --- a/OWNERS +++ b/OWNERS @@ -1,9 +1,17 @@ reviewers: + - deads2k + - mfojtik + - sttts + - tkashem - p0lyn0mial - benluddy - sanchezl - dgrisonnet approvers: + - deads2k + - mfojtik + - sttts + - tkashem - p0lyn0mial - benluddy - sanchezl diff --git a/README.md b/README.md index 4382ce0bde..875b41d967 100644 --- a/README.md +++ b/README.md @@ -1,32 +1 @@ -## Tests - -This repository is compatible with the [OpenShift Tests Extension (OTE)](https://github.com/openshift-eng/openshift-tests-extension) framework. - -### Building the test binary - -```bash -make build -``` - -### Running test suites and tests - -```bash -# Run a specific test suite or test -./openshift-apiserver-tests-ext run-suite openshift/openshift-apiserver/all -./openshift-apiserver-tests-ext run-test "test-name" - -# Run with JUnit output -./openshift-apiserver-tests-ext run-suite openshift/openshift-apiserver/all --junit-path /tmp/junit.xml -``` - -### Listing available tests and suites - -```bash -# List all test suites -./openshift-apiserver-tests-ext list suites - -# List tests in a suite -./openshift-apiserver-tests-ext list tests --suite=openshift/openshift-apiserver/all -``` - -For more information about the OTE framework, see the [openshift-tests-extension documentation](https://github.com/openshift-eng/openshift-tests-extension). +### TODO: ADD README.md here diff --git a/cmd/openshift-apiserver-tests-ext/main.go b/cmd/openshift-apiserver-tests-ext/main.go deleted file mode 100644 index 6652f8fd1f..0000000000 --- a/cmd/openshift-apiserver-tests-ext/main.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "context" - "os" - - "github.com/spf13/cobra" - "k8s.io/component-base/cli" - - otecmd "github.com/openshift-eng/openshift-tests-extension/pkg/cmd" - oteextension "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift/openshift-apiserver/pkg/version" - - "k8s.io/klog/v2" -) - -func main() { - command := newOperatorTestCommand(context.Background()) - code := cli.Run(command) - os.Exit(code) -} - -func newOperatorTestCommand(ctx context.Context) *cobra.Command { - registry := prepareOperatorTestsRegistry() - - cmd := &cobra.Command{ - Use: "openshift-apiserver-tests-ext", - Short: "A binary used to run openshift-apiserver tests as part of OTE.", - Run: func(cmd *cobra.Command, args []string) { - // no-op, logic is provided by the OTE framework - if err := cmd.Help(); err != nil { - klog.Fatal(err) - } - }, - } - - if v := version.Get().String(); len(v) == 0 { - cmd.Version = "" - } else { - cmd.Version = v - } - - cmd.AddCommand(otecmd.DefaultExtensionCommands(registry)...) - - return cmd -} - -func prepareOperatorTestsRegistry() *oteextension.Registry { - registry := oteextension.NewRegistry() - extension := oteextension.NewExtension("openshift", "payload", "openshift-apiserver") - - registry.Register(extension) - return registry -} diff --git a/go.mod b/go.mod index 5903cc09dc..1c112fc9c6 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/jteeuwen/go-bindata v3.0.8-0.20151023091102-a0ff2567cfb7+incompatible github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.1 - github.com/openshift-eng/openshift-tests-extension v0.0.0-20251113163031-356b66aa5c24 github.com/openshift/api v0.0.0-20250820105013-6282350d0c39 github.com/openshift/apiserver-library-go v0.0.0-20250710132015-f0d44ef6e53b github.com/openshift/build-machinery-go v0.0.0-20250806130835-622c0378eb0d diff --git a/go.sum b/go.sum index e339442e5c..d17c543868 100644 --- a/go.sum +++ b/go.sum @@ -252,8 +252,6 @@ github.com/opencontainers/runc v1.2.1 h1:mQkmeFSUxqFaVmvIn1VQPeQIKpHFya5R07aJw0D github.com/opencontainers/runc v1.2.1/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/openshift-eng/openshift-tests-extension v0.0.0-20251113163031-356b66aa5c24 h1:bwmjtFaipakIwAyZxnDLgtkLY1Nf1nK9lRCmADvHirE= -github.com/openshift-eng/openshift-tests-extension v0.0.0-20251113163031-356b66aa5c24/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M= github.com/openshift/api v0.0.0-20250820105013-6282350d0c39 h1:X42iTyo3AAHS36BkiBkU8FvxfK8NEDmnBi3QrnaCIlA= github.com/openshift/api v0.0.0-20250820105013-6282350d0c39/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM= github.com/openshift/apiserver-library-go v0.0.0-20250710132015-f0d44ef6e53b h1:rIfs2f1zo9GLyxk6tak2bHzX01VTz6Xheay2NECfZpg= diff --git a/images/Dockerfile.rhel b/images/Dockerfile.rhel index 872833d16a..3ef5f95a81 100644 --- a/images/Dockerfile.rhel +++ b/images/Dockerfile.rhel @@ -2,11 +2,12 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS WORKDIR /go/src/github.com/openshift/openshift-apiserver COPY . . RUN make build --warn-undefined-variables \ - && gzip openshift-apiserver-tests-ext + && make tests-ext-build \ + && gzip test/extended/tests-extension/bin/openshift-apiserver-tests-ext FROM registry.ci.openshift.org/ocp/4.21:base-rhel9 COPY --from=builder /go/src/github.com/openshift/openshift-apiserver/openshift-apiserver /usr/bin/ -COPY --from=builder /go/src/github.com/openshift/openshift-apiserver/openshift-apiserver-tests-ext.gz /usr/bin/ +COPY --from=builder /go/src/github.com/openshift/openshift-apiserver/test/extended/tests-extension/bin/openshift-apiserver-tests-ext.gz /usr/bin/ ENTRYPOINT ["/usr/bin/openshift-apiserver"] LABEL io.k8s.display-name="OpenShift API Server Command" \ io.k8s.description="OpenShift is a platform for developing, building, and deploying containerized applications." \ diff --git a/test/extended/tests-extension/Makefile b/test/extended/tests-extension/Makefile new file mode 100644 index 0000000000..7637226ccc --- /dev/null +++ b/test/extended/tests-extension/Makefile @@ -0,0 +1,88 @@ +# Get the directory where this Makefile is, so we can use it below for including +DIR := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))) + +# Definitions for the extended tests +GO_PKG_NAME := github.com/openshift-eng/openshift-tests-extension + +GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo 'unknown') +BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') +GIT_TREE_STATE := $(shell if git rev-parse --git-dir > /dev/null 2>&1; then if git diff --quiet; then echo clean; else echo dirty; fi; else echo unknown; fi) + +LDFLAGS := -X '$(GO_PKG_NAME)/pkg/version.CommitFromGit=$(GIT_COMMIT)' \ + -X '$(GO_PKG_NAME)/pkg/version.BuildDate=$(BUILD_DATE)' \ + -X '$(GO_PKG_NAME)/pkg/version.GitTreeState=$(GIT_TREE_STATE)' + +METADATA := $(shell pwd)/.openshift-tests-extension + +TOOLS_BIN_DIR := $(CURDIR)/bin +BINARY_NAME := openshift-apiserver-tests-ext + +.PHONY: help +help: #HELP Display essential help. + @awk 'BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n make \033[36m\033[0m\n\n"} /^[a-zA-Z_0-9-]+:.*#HELP / { printf " \033[36m%-17s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST) + +#SECTION Development +.PHONY: verify #HELP To verify the code +verify: tidy fmt vet + +.PHONY: tidy #HELP Run go mod tidy. +tidy: + go mod tidy + +.PHONY: fmt +fmt: #HELP Run go fmt against code. + go fmt ./... + +.PHONY: vet +vet: #HELP Run go vet against code. + go vet ./... + +.PHONY: build +build: #HELP Build the extended tests binary + @mkdir -p $(TOOLS_BIN_DIR) + GO_COMPLIANCE_POLICY="exempt_all" CGO_ENABLED=0 go build -mod=mod -ldflags "$(LDFLAGS)" -o $(TOOLS_BIN_DIR)/$(BINARY_NAME) ./cmd/... + +.PHONY: update-metadata +update-metadata: build #HELP Build and run 'update-metadata' to generate test metadata + $(TOOLS_BIN_DIR)/$(BINARY_NAME) update + $(MAKE) clean-metadata + +.PHONY: build-update +build-update: build update-metadata #HELP Build and update metadata and sanitize output + +.PHONY: clean +clean: #HELP Remove build artifacts + rm -rf $(TOOLS_BIN_DIR) + +#SECTION Metadata + +.PHONY: list-test-names +list-test-names: build #HELP Show current full test names + @$(TOOLS_BIN_DIR)/$(BINARY_NAME) list -o names + +.PHONY: run-suite +run-suite: build #HELP Run a test suite (usage: make run-suite SUITE= [JUNIT_DIR=]) + @if [ -z "$(SUITE)" ]; then \ + echo "Error: SUITE variable is required. Usage: make run-suite SUITE= [JUNIT_DIR=]"; \ + exit 1; \ + fi + @JUNIT_ARG=""; \ + if [ -n "$(JUNIT_DIR)" ]; then \ + mkdir -p $(JUNIT_DIR); \ + JUNIT_ARG="--junit-path=$(JUNIT_DIR)/junit.xml"; \ + fi; \ + $(TOOLS_BIN_DIR)/$(BINARY_NAME) run-suite $(SUITE) $$JUNIT_ARG + +.PHONY: clean-metadata +clean-metadata: #HELP Remove 'codeLocations' from metadata JSON + @echo "Cleaning metadata (removing codeLocations)..." + @for f in $(METADATA)/*.json; do \ + jq 'map(del(.codeLocations))' "$$f" > "$$f.tmp" && mv "$$f.tmp" "$$f"; \ + done + +.PHONY: verify-metadata #HELP To verify that the metadata was properly updated +verify-metadata: update-metadata + @if ! git diff --exit-code $(METADATA); then \ + echo "ERROR: Metadata is out of date. Please run 'make build-update' and commit the result."; \ + exit 1; \ + fi diff --git a/test/extended/tests-extension/OWNERS b/test/extended/tests-extension/OWNERS new file mode 100644 index 0000000000..7f7f79ccd2 --- /dev/null +++ b/test/extended/tests-extension/OWNERS @@ -0,0 +1,17 @@ +reviewers: + - p0lyn0mial + - benluddy + - dgrisonnet + - dinhxuanvu + - xingxingxia + - wangke19 + - gangwgr +approvers: + - p0lyn0mial + - benluddy + - dgrisonnet + - dinhxuanvu + - xingxingxia + - wangke19 + - gangwgr +component: openshift-apiserver-tests diff --git a/test/extended/tests-extension/README.md b/test/extended/tests-extension/README.md new file mode 100644 index 0000000000..bc3b115451 --- /dev/null +++ b/test/extended/tests-extension/README.md @@ -0,0 +1,242 @@ +# OpenShift API Server Tests Extension +======================== + +This repository contains the tests for the OpenShift API Server for OpenShift. +These tests run against OpenShift clusters and are meant to be used in the OpenShift CI/CD pipeline. +They use the framework: https://github.com/openshift-eng/openshift-tests-extension + +## Quick Start +### Building the Test Extension + +From the repository root: +```bash +make tests-ext-build +``` + +Or from the test extension directory: +```bash +cd test/extended/tests-extension +make build +``` + +The binary will be located at: `test/extended/tests-extension/bin/openshift-apiserver-tests-ext` + +### Running Tests + +| Command | Description | +|----------------------------------------------------------------------------|--------------------------------------------------------------------------| +| `make tests-ext-build` | Builds the test extension binary (from root). | +| `make run-suite SUITE= [JUNIT_DIR=]` | Runs a test suite from root (e.g., `SUITE=openshift/openshift-apiserver/conformance/parallel`). | +| `./test/extended/tests-extension/bin/openshift-apiserver-tests-ext list` | Lists all available test cases. | +| `./test/extended/tests-extension/bin/openshift-apiserver-tests-ext run-suite ` | Runs a test suite directly. | +| `./test/extended/tests-extension/bin/openshift-apiserver-tests-ext run-test ` | Runs one specific test. | + +## How to Run the Tests Locally + +The tests can be run locally using the `openshift-apiserver-tests-ext` binary against an OpenShift cluster. +Use the environment variable `KUBECONFIG` to point to your cluster configuration file such as: + +```shell +export KUBECONFIG=path/to/kubeconfig +./test/extended/tests-extension/bin/openshift-apiserver-tests-ext run-test +``` + +### Local Test using OCP + +1. Use the `Cluster Bot` to create an OpenShift cluster. + +**Example:** + +```shell +launch 4.20 gcp,techpreview +``` + +2. Set the `KUBECONFIG` environment variable to point to your OpenShift cluster configuration file. + +**Example:** + +```shell +mv ~/Downloads/cluster-bot-2025-08-06-082741.kubeconfig ~/.kube/cluster-bot.kubeconfig +export KUBECONFIG=~/.kube/cluster-bot.kubeconfig +``` + +3. Run the tests using the `openshift-apiserver-tests-ext` binary. + +**Example:** +```shell +./test/extended/tests-extension/bin/openshift-apiserver-tests-ext run-suite openshift/openshift-apiserver/all +``` + +Or using make from the root directory: +```shell +make run-suite SUITE=openshift/openshift-apiserver/all JUNIT_DIR=/tmp/junit-results +``` + +## Test Module Structure + +The test extension has been isolated into its own Go module to separate test dependencies from production code: + +``` +test/extended/tests-extension/ +├── bin/ # Test binaries (gitignored) +├── cmd/ # Test extension main package +├── .openshift-tests-extension/ # Test metadata +├── go.mod # Separate module with test dependencies +├── go.sum +├── Makefile # Test-specific build targets +├── main.go # Ginkgo test specs +└── README.md +``` + +### Key Benefits of Dependency Isolation + +- **Smaller production images**: Test dependencies (ginkgo, gomega, etc.) are not included in production builds +- **Faster builds**: Production builds don't need to vendor test dependencies (~388K+ lines removed from root vendor) +- **Cleaner dependency management**: Test dependencies isolated in `test/extended/tests-extension/go.mod` +- **Better CI performance**: Smaller images, faster pulls, less storage + +## Writing Tests + +You can write tests in the `test/extended/tests-extension/` directory. + +## Development Workflow + +- Add or update tests in: `test/extended/tests-extension/` +- Run `make build` to build the operator binary and `make tests-ext-build` for the test binary. +- You can run the full suite or one test using the commands in the table above. +- Before committing your changes: + - Run `make tests-ext-update` (updates test metadata) + - Run `make verify` to check formatting, linting, and validation + +## How to Rename a Test + +1. Run `./test/extended/tests-extension/bin/openshift-apiserver-tests-ext list` to see the current test names +2. Find the name of the test you want to rename +3. Add a Ginkgo label with the original name, like this: + +```go +It("should pass a renamed sanity check", + Label("original-name:[sig-openshift-apiserver] My Old Test Name"), + func(ctx context.Context) { + Expect(len("test")).To(BeNumerically(">", 0)) + }) +``` + +4. Run `make tests-ext-update` to update the metadata + +**Note:** Only add the label once. Do not update it again after future renames. + +## How to Delete a Test + +1. Run `./test/extended/tests-extension/bin/openshift-apiserver-tests-ext list` to find the test name +2. Add the test name to the `IgnoreObsoleteTests` block in `test/extended/tests-extension/cmd/main.go`, like this: + +```go +ext.IgnoreObsoleteTests( + "[sig-openshift-apiserver] My removed test name", +) +``` + +3. Delete the test code from your suite. +4. Run `make tests-ext-update` to clean the metadata + +**WARNING**: Deleting a test may cause issues with Sippy https://sippy.dptools.openshift.org/sippy-ng/ +or other tools that expected the Unique TestID tracked outside of this repository. [More info](https://github.com/openshift-eng/ci-test-mapping) +Check the status of https://issues.redhat.com/browse/TRT-2208 before proceeding with test deletions. + +## E2E Test Configuration + +Tests are configured in the `openshift/release` repository, under `ci-operator/config/openshift/openshift-apiserver`. + +Here is a CI job example: + +```yaml +- as: e2e-aws-techpreview-oas-ext + steps: + cluster_profile: aws + env: + FEATURE_SET: TechPreviewNoUpgrade + TEST_SUITE: openshift/openshift-apiserver/all + test: + - ref: openshift-e2e-test + workflow: openshift-e2e-aws +``` + +This uses the `openshift-tests` binary to run openshift-apiserver tests against a test OpenShift release. + +It works for pull request testing because of this: + +```yaml +releases: + latest: + integration: + include_built_images: true +``` + +More info: https://docs.ci.openshift.org/docs/architecture/ci-operator/#testing-with-an-ephemeral-openshift-release + +## Makefile Commands + +### Root Makefile (from repository root) + +| Target | Description | +|--------------------------|------------------------------------------------------------------------------| +| `make build` | Builds the operator binary. | +| `make tests-ext-build` | Builds the test extension binary (delegates to test Makefile). | +| `make tests-ext-update` | Updates test metadata (delegates to test Makefile). | +| `make tests-ext-clean` | Cleans test extension binaries (delegates to test Makefile). | +| `make run-suite SUITE= [JUNIT_DIR=]` | Runs a test suite (delegates to test Makefile). | +| `make clean` | Cleans both operator and test binaries. | +| `make verify` | Runs formatting, vet, and linter. | + +### Test Extension Makefile (from test/extended/tests-extension/) + +| Target | Description | +|--------------------------|------------------------------------------------------------------------------| +| `make build` | Builds the test extension binary to `bin/openshift-apiserver-tests-ext`. | +| `make update-metadata` | Builds and updates test metadata JSON file. | +| `make build-update` | Builds binary and updates metadata (cleans machine-specific codeLocations). | +| `make clean` | Removes the `bin/` directory. | +| `make run-suite SUITE= [JUNIT_DIR=]` | Runs a specific test suite with optional JUnit XML output. | +| `make list-test-names` | Lists all test names. | +| `make verify-metadata` | Verifies metadata is up to date. | + +**Note:** Metadata is stored in: `test/extended/tests-extension/.openshift-tests-extension/openshift_payload_openshift-apiserver.json` + +## FAQ + +### Why don't we have a Dockerfile for `openshift-apiserver-tests-ext`? + +We do not provide a Dockerfile for `openshift-apiserver-tests-ext` because building and shipping a +standalone image for this test binary would introduce unnecessary complexity. + +Technically, it is possible to create a new OpenShift component just for the +tests and add a corresponding test image to the payload. However, doing so requires +onboarding a new component, setting up build pipelines, and maintaining image promotion +and test configuration — all of which adds overhead. + +From the OpenShift architecture point of view: + +1. Tests for payload components are part of the product. Many users (such as storage vendors, or third-party CNIs) +rely on these tests to validate that their solutions are compatible and conformant with OpenShift. + +2. Adding new images to the payload comes with significant overhead and cost. +It is generally preferred to include tests in the same image as the component +being tested whenever possible. + +### Why do we need to run `make tests-ext-update`? + +Running `make tests-ext-update` ensures that each test gets a unique and stable **TestID** over time. + +The TestID is used to identify tests across the OpenShift CI/CD pipeline and reporting tools like Sippy. +It helps track test results, detect regressions, and ensures the correct tests are +executed and reported. + +This step is important whenever you add, rename, or delete a test. +More information: +- https://github.com/openshift/enhancements/blob/master/enhancements/testing/openshift-tests-extension.md#test-id +- https://github.com/openshift-eng/ci-test-mapping + +### How to get help with OTE? + +For help with the OpenShift Tests Extension (OTE), you can reach out on the #wg-openshift-tests-extension Slack channel. diff --git a/test/extended/tests-extension/cmd/openshift-apiserver-tests-ext/main.go b/test/extended/tests-extension/cmd/openshift-apiserver-tests-ext/main.go new file mode 100644 index 0000000000..f5db46511c --- /dev/null +++ b/test/extended/tests-extension/cmd/openshift-apiserver-tests-ext/main.go @@ -0,0 +1,113 @@ +/* +This command is used to run the OpenShift API Server tests extension for OpenShift. +It registers the OpenShift API Server tests with the OpenShift Tests Extension framework +and provides a command-line interface to execute them. + +For further information, please refer to the documentation at: +https://github.com/openshift-eng/openshift-tests-extension/blob/main/cmd/example-tests/main.go +*/ +package main + +import ( + "fmt" + "os" + "strings" + + "github.com/openshift-eng/openshift-tests-extension/pkg/cmd" + e "github.com/openshift-eng/openshift-tests-extension/pkg/extension" + et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" + g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo" + + "github.com/spf13/cobra" + + // The import below is necessary to ensure that the OAS operator tests are registered with the extension. + _ "github.com/openshift/openshift-apiserver/test/extended/tests-extension" +) + +func main() { + registry := e.NewRegistry() + ext := e.NewExtension("openshift", "payload", "openshift-apiserver") + + // Suite: conformance/parallel (fast, parallel-safe) + ext.AddSuite(e.Suite{ + Name: "openshift/openshift-apiserver/conformance/parallel", + Parents: []string{"openshift/conformance/parallel"}, + Qualifiers: []string{ + `!(name.contains("[Serial]") || name.contains("[Slow]"))`, + }, + }) + + // Suite: conformance/serial (explicitly serial tests) + ext.AddSuite(e.Suite{ + Name: "openshift/openshift-apiserver/conformance/serial", + Parents: []string{"openshift/conformance/serial"}, + Qualifiers: []string{ + `name.contains("[Serial]")`, + }, + }) + + // Suite: optional/slow (long-running tests) + ext.AddSuite(e.Suite{ + Name: "openshift/openshift-apiserver/optional/slow", + Parents: []string{"openshift/optional/slow"}, + Qualifiers: []string{ + `name.contains("[Slow]")`, + }, + }) + + // Suite: all (includes everything) + ext.AddSuite(e.Suite{ + Name: "openshift/openshift-apiserver/all", + }) + + specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() + if err != nil { + panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error())) + } + + // Ensure [Disruptive] tests are also [Serial] + specs = specs.Walk(func(spec *et.ExtensionTestSpec) { + if strings.Contains(spec.Name, "[Disruptive]") && !strings.Contains(spec.Name, "[Serial]") { + spec.Name = strings.ReplaceAll( + spec.Name, + "[Disruptive]", + "[Serial][Disruptive]", + ) + } + }) + + // Preserve original-name labels for renamed tests + specs = specs.Walk(func(spec *et.ExtensionTestSpec) { + for label := range spec.Labels { + if strings.HasPrefix(label, "original-name:") { + parts := strings.SplitN(label, "original-name:", 2) + if len(parts) > 1 { + spec.OriginalName = parts[1] + } + } + } + }) + + // Ignore obsolete tests + ext.IgnoreObsoleteTests( + // "[sig-openshift-apiserver] ", + ) + + // Initialize environment before running any tests + specs.AddBeforeAll(func() { + // do stuff + }) + + ext.AddSpecs(specs) + registry.Register(ext) + + root := &cobra.Command{ + Long: "OpenShift API Server Tests Extension", + } + + root.AddCommand(cmd.DefaultExtensionCommands(registry)...) + + if err := root.Execute(); err != nil { + os.Exit(1) + } +} diff --git a/test/extended/tests-extension/go.mod b/test/extended/tests-extension/go.mod new file mode 100644 index 0000000000..7b75282fa7 --- /dev/null +++ b/test/extended/tests-extension/go.mod @@ -0,0 +1,88 @@ +module github.com/openshift/openshift-apiserver/test/extended/tests-extension + +go 1.24.0 + +require ( + github.com/onsi/ginkgo/v2 v2.23.4 + github.com/onsi/gomega v1.38.0 + github.com/openshift-eng/openshift-tests-extension v0.0.0-20250804142706-7b3ab438a292 + github.com/openshift/client-go v0.0.0-20250811163556-6193816ae379 + github.com/spf13/cobra v1.8.1 + k8s.io/api v0.33.3 + k8s.io/apimachinery v0.33.3 + k8s.io/client-go v0.33.3 + k8s.io/kubectl v0.33.3 + k8s.io/kubernetes v1.33.3 +) + +require ( + cel.dev/expr v0.19.1 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/cel-go v0.23.2 // indirect + github.com/google/gnostic-models v0.6.9 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/moby/spdystream v0.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/openshift/api v0.0.0-20250820105013-6282350d0c39 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/client_golang v1.22.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/trace v1.33.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/term v0.32.0 // indirect + golang.org/x/text v0.26.0 // indirect + golang.org/x/time v0.9.0 // indirect + golang.org/x/tools v0.33.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/protobuf v1.36.6 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apiserver v0.33.3 // indirect + k8s.io/component-base v0.33.3 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect + k8s.io/pod-security-admission v0.0.0 // indirect + k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect + sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) + +replace ( + github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.33.3 +) diff --git a/test/extended/tests-extension/go.sum b/test/extended/tests-extension/go.sum new file mode 100644 index 0000000000..d1fdf5bde8 --- /dev/null +++ b/test/extended/tests-extension/go.sum @@ -0,0 +1,229 @@ +cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= +cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/cel-go v0.23.2 h1:UdEe3CvQh3Nv+E/j9r1Y//WO0K0cSyD7/y0bzyLIMI4= +github.com/google/cel-go v0.23.2/go.mod h1:52Pb6QsDbC5kvgxvZhiL9QX1oZEkcUF/ZqaPx1J5Wwo= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= +github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/onsi/gomega v1.38.0 h1:c/WX+w8SLAinvuKKQFh77WEucCnPk4j2OTUr7lt7BeY= +github.com/onsi/gomega v1.38.0/go.mod h1:OcXcwId0b9QsE7Y49u+BTrL4IdKOBOKnD6VQNTJEB6o= +github.com/openshift-eng/openshift-tests-extension v0.0.0-20250804142706-7b3ab438a292 h1:3athg6KQ+TaNfW4BWZDlGFt1ImSZEJWgzXtPC1VPITI= +github.com/openshift-eng/openshift-tests-extension v0.0.0-20250804142706-7b3ab438a292/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M= +github.com/openshift/api v0.0.0-20250820105013-6282350d0c39 h1:X42iTyo3AAHS36BkiBkU8FvxfK8NEDmnBi3QrnaCIlA= +github.com/openshift/api v0.0.0-20250820105013-6282350d0c39/go.mod h1:SPLf21TYPipzCO67BURkCfK6dcIIxx0oNRVWaOyRcXM= +github.com/openshift/client-go v0.0.0-20250811163556-6193816ae379 h1:Xr47DBqFVjpLdU4BTtCS5l2XojbRYap2FIPdSj8YYzU= +github.com/openshift/client-go v0.0.0-20250811163556-6193816ae379/go.mod h1:HouQRy4JgvTBpxcyw1YSD/Lp+wjOaUrxjWFHlMtZsk8= +github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12 h1:AKx/w1qpS8We43bsRgf8Nll3CGlDHpr/WAXvuedTNZI= +github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= +github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= +go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= +go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= +go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= +golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= +golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/apiserver v0.33.3 h1:Wv0hGc+QFdMJB4ZSiHrCgN3zL3QRatu56+rpccKC3J4= +k8s.io/apiserver v0.33.3/go.mod h1:05632ifFEe6TxwjdAIrwINHWE2hLwyADFk5mBsQa15E= +k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA= +k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg= +k8s.io/component-base v0.33.3 h1:mlAuyJqyPlKZM7FyaoM/LcunZaaY353RXiOd2+B5tGA= +k8s.io/component-base v0.33.3/go.mod h1:ktBVsBzkI3imDuxYXmVxZ2zxJnYTZ4HAsVj9iF09qp4= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= +k8s.io/kubectl v0.33.3 h1:r/phHvH1iU7gO/l7tTjQk2K01ER7/OAJi8uFHHyWSac= +k8s.io/kubectl v0.33.3/go.mod h1:euj2bG56L6kUGOE/ckZbCoudPwuj4Kud7BR0GzyNiT0= +k8s.io/kubernetes v1.33.3 h1:dBx5Z2ZhR8kNzAwCoCz4j1niUbUrNUDVxeSj4/Ienu0= +k8s.io/kubernetes v1.33.3/go.mod h1:nrt8sldmckKz2fCZhgRX3SKfS2e+CzXATPv6ITNkU00= +k8s.io/pod-security-admission v0.33.3 h1:QjpEeaWV8hzCDq8YEtNmKOKlG6dARMK3zTZ98m3OYVI= +k8s.io/pod-security-admission v0.33.3/go.mod h1:GhVxV5tSx0HlclRcEd00Y5idzagPgqYo5GvWC8QEkX4= +k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= +k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/test/extended/tests-extension/main.go b/test/extended/tests-extension/main.go new file mode 100644 index 0000000000..81cbe9646d --- /dev/null +++ b/test/extended/tests-extension/main.go @@ -0,0 +1,12 @@ +package extended + +import ( + g "github.com/onsi/ginkgo/v2" + o "github.com/onsi/gomega" +) + +var _ = g.Describe("[Jira:openshift-apiserver][sig-api-machinery] sanity test", func() { + g.It("should always pass [Suite:openshift/openshift-apiserver/conformance/parallel]", func() { + o.Expect(true).To(o.BeTrue()) + }) +}) diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/LICENSE b/vendor/github.com/openshift-eng/openshift-tests-extension/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmd.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmd.go deleted file mode 100644 index 2db8cfa6ea..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmd.go +++ /dev/null @@ -1,23 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages" - "github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo" - "github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist" - "github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun" - "github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate" - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" -) - -func DefaultExtensionCommands(registry *extension.Registry) []*cobra.Command { - return []*cobra.Command{ - cmdrun.NewRunSuiteCommand(registry), - cmdrun.NewRunTestCommand(registry), - cmdlist.NewListCommand(registry), - cmdinfo.NewInfoCommand(registry), - cmdupdate.NewUpdateCommand(registry), - cmdimages.NewImagesCommand(registry), - } -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages/cmdimages.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages/cmdimages.go deleted file mode 100644 index 33b458fac2..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages/cmdimages.go +++ /dev/null @@ -1,36 +0,0 @@ -package cmdimages - -import ( - "encoding/json" - "fmt" - "os" - - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -func NewImagesCommand(registry *extension.Registry) *cobra.Command { - componentFlags := flags.NewComponentFlags() - - cmd := &cobra.Command{ - Use: "images", - Short: "List test images", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - extension := registry.Get(componentFlags.Component) - if extension == nil { - return fmt.Errorf("couldn't find the component %q", componentFlags.Component) - } - images, err := json.Marshal(extension.Images) - if err != nil { - return err - } - fmt.Fprintf(os.Stdout, "%s\n", images) - return nil - }, - } - componentFlags.BindFlags(cmd.Flags()) - return cmd -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo/info.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo/info.go deleted file mode 100644 index 1d4237876d..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo/info.go +++ /dev/null @@ -1,38 +0,0 @@ -package cmdinfo - -import ( - "encoding/json" - "fmt" - "os" - - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -func NewInfoCommand(registry *extension.Registry) *cobra.Command { - componentFlags := flags.NewComponentFlags() - - cmd := &cobra.Command{ - Use: "info", - Short: "Display extension metadata", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - extension := registry.Get(componentFlags.Component) - if extension == nil { - return fmt.Errorf("couldn't find the component %q", componentFlags.Component) - } - - info, err := json.MarshalIndent(extension, "", " ") - if err != nil { - return err - } - - fmt.Fprintf(os.Stdout, "%s\n", string(info)) - return nil - }, - } - componentFlags.BindFlags(cmd.Flags()) - return cmd -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist/list.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist/list.go deleted file mode 100644 index 31a040b7c9..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist/list.go +++ /dev/null @@ -1,133 +0,0 @@ -package cmdlist - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -func NewListCommand(registry *extension.Registry) *cobra.Command { - opts := struct { - componentFlags *flags.ComponentFlags - suiteFlags *flags.SuiteFlags - outputFlags *flags.OutputFlags - environmentalFlags *flags.EnvironmentalFlags - }{ - suiteFlags: flags.NewSuiteFlags(), - componentFlags: flags.NewComponentFlags(), - outputFlags: flags.NewOutputFlags(), - environmentalFlags: flags.NewEnvironmentalFlags(), - } - - // Tests - listTestsCmd := &cobra.Command{ - Use: "tests", - Short: "List available tests", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - ext := registry.Get(opts.componentFlags.Component) - if ext == nil { - return fmt.Errorf("component not found: %s", opts.componentFlags.Component) - } - - // Find suite, if specified - var foundSuite *extension.Suite - var err error - if opts.suiteFlags.Suite != "" { - foundSuite, err = ext.GetSuite(opts.suiteFlags.Suite) - if err != nil { - return err - } - } - - // Filter for suite - specs := ext.GetSpecs() - if foundSuite != nil { - specs, err = specs.Filter(foundSuite.Qualifiers) - if err != nil { - return err - } - } - - specs, err = specs.FilterByEnvironment(*opts.environmentalFlags) - if err != nil { - return err - } - - data, err := opts.outputFlags.Marshal(specs) - if err != nil { - return err - } - fmt.Fprintf(os.Stdout, "%s\n", string(data)) - return nil - }, - } - opts.suiteFlags.BindFlags(listTestsCmd.Flags()) - opts.componentFlags.BindFlags(listTestsCmd.Flags()) - opts.environmentalFlags.BindFlags(listTestsCmd.Flags()) - opts.outputFlags.BindFlags(listTestsCmd.Flags()) - - // Suites - listSuitesCommand := &cobra.Command{ - Use: "suites", - Short: "List available suites", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - ext := registry.Get(opts.componentFlags.Component) - if ext == nil { - return fmt.Errorf("component not found: %s", opts.componentFlags.Component) - } - - suites := ext.Suites - - data, err := opts.outputFlags.Marshal(suites) - if err != nil { - return err - } - fmt.Fprintf(os.Stdout, "%s\n", string(data)) - return nil - }, - } - opts.componentFlags.BindFlags(listSuitesCommand.Flags()) - opts.outputFlags.BindFlags(listSuitesCommand.Flags()) - - // Components - listComponentsCmd := &cobra.Command{ - Use: "components", - Short: "List available components", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - var components []*extension.Component - registry.Walk(func(e *extension.Extension) { - components = append(components, &e.Component) - }) - - data, err := opts.outputFlags.Marshal(components) - if err != nil { - return err - } - fmt.Fprintf(os.Stdout, "%s\n", string(data)) - return nil - }, - } - opts.outputFlags.BindFlags(listComponentsCmd.Flags()) - - var listCmd = &cobra.Command{ - Use: "list [subcommand]", - Short: "List items", - RunE: func(cmd *cobra.Command, args []string) error { - return listTestsCmd.RunE(cmd, args) - }, - } - opts.suiteFlags.BindFlags(listCmd.Flags()) - opts.componentFlags.BindFlags(listCmd.Flags()) - opts.outputFlags.BindFlags(listCmd.Flags()) - opts.environmentalFlags.BindFlags(listCmd.Flags()) - listCmd.AddCommand(listTestsCmd, listComponentsCmd, listSuitesCommand) - - return listCmd -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go deleted file mode 100644 index d81d07cb2b..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go +++ /dev/null @@ -1,114 +0,0 @@ -package cmdrun - -import ( - "context" - "fmt" - "os" - "os/signal" - "syscall" - "time" - - "github.com/pkg/errors" - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -func NewRunSuiteCommand(registry *extension.Registry) *cobra.Command { - opts := struct { - componentFlags *flags.ComponentFlags - outputFlags *flags.OutputFlags - concurrencyFlags *flags.ConcurrencyFlags - junitPath string - }{ - componentFlags: flags.NewComponentFlags(), - outputFlags: flags.NewOutputFlags(), - concurrencyFlags: flags.NewConcurrencyFlags(), - junitPath: "", - } - - cmd := &cobra.Command{ - Use: "run-suite NAME", - Short: "Run a group of tests by suite. This is more limited than origin, and intended for light local " + - "development use. Orchestration parameters, scheduling, isolation, etc are not obeyed, and Ginkgo tests are executed serially.", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - ctx, cancelCause := context.WithCancelCause(context.Background()) - defer cancelCause(errors.New("exiting")) - - abortCh := make(chan os.Signal, 2) - go func() { - <-abortCh - fmt.Fprintf(os.Stderr, "Interrupted, terminating tests") - cancelCause(errors.New("interrupt received")) - - select { - case sig := <-abortCh: - fmt.Fprintf(os.Stderr, "Interrupted twice, exiting (%s)", sig) - switch sig { - case syscall.SIGINT: - os.Exit(130) - default: - os.Exit(130) // if we were interrupted, never return zero. - } - - case <-time.After(30 * time.Minute): // allow time for cleanup. If we finish before this, we'll exit - fmt.Fprintf(os.Stderr, "Timed out during cleanup, exiting") - os.Exit(130) // if we were interrupted, never return zero. - } - }() - signal.Notify(abortCh, syscall.SIGINT, syscall.SIGTERM) - - ext := registry.Get(opts.componentFlags.Component) - if ext == nil { - return fmt.Errorf("component not found: %s", opts.componentFlags.Component) - } - if len(args) != 1 { - return fmt.Errorf("must specify one suite name") - } - suite, err := ext.GetSuite(args[0]) - if err != nil { - return errors.Wrapf(err, "couldn't find suite: %s", args[0]) - } - - compositeWriter := extensiontests.NewCompositeResultWriter() - defer func() { - if err = compositeWriter.Flush(); err != nil { - fmt.Fprintf(os.Stderr, "failed to write results: %v\n", err) - } - }() - - // JUnit writer if needed - if opts.junitPath != "" { - junitWriter, err := extensiontests.NewJUnitResultWriter(opts.junitPath, suite.Name) - if err != nil { - return errors.Wrap(err, "couldn't create junit writer") - } - compositeWriter.AddWriter(junitWriter) - } - - // JSON writer - jsonWriter, err := extensiontests.NewJSONResultWriter(os.Stdout, - extensiontests.ResultFormat(opts.outputFlags.Output)) - if err != nil { - return err - } - compositeWriter.AddWriter(jsonWriter) - - specs, err := ext.GetSpecs().Filter(suite.Qualifiers) - if err != nil { - return errors.Wrap(err, "couldn't filter specs") - } - - return specs.Run(ctx, compositeWriter, opts.concurrencyFlags.MaxConcurency) - }, - } - opts.componentFlags.BindFlags(cmd.Flags()) - opts.outputFlags.BindFlags(cmd.Flags()) - opts.concurrencyFlags.BindFlags(cmd.Flags()) - cmd.Flags().StringVarP(&opts.junitPath, "junit-path", "j", opts.junitPath, "write results to junit XML") - - return cmd -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go deleted file mode 100644 index c06894ed99..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go +++ /dev/null @@ -1,112 +0,0 @@ -package cmdrun - -import ( - "bufio" - "context" - "fmt" - "os" - "errors" - "os/signal" - "syscall" - "time" - - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -func NewRunTestCommand(registry *extension.Registry) *cobra.Command { - opts := struct { - componentFlags *flags.ComponentFlags - concurrencyFlags *flags.ConcurrencyFlags - nameFlags *flags.NamesFlags - outputFlags *flags.OutputFlags - }{ - componentFlags: flags.NewComponentFlags(), - nameFlags: flags.NewNamesFlags(), - outputFlags: flags.NewOutputFlags(), - concurrencyFlags: flags.NewConcurrencyFlags(), - } - - cmd := &cobra.Command{ - Use: "run-test [-n NAME...] [NAME]", - Short: "Runs tests by name", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - ctx, cancelCause := context.WithCancelCause(context.Background()) - defer cancelCause(errors.New("exiting")) - - abortCh := make(chan os.Signal, 2) - go func() { - <-abortCh - fmt.Fprintf(os.Stderr, "Interrupted, terminating tests") - cancelCause(errors.New("interrupt received")) - - select { - case sig := <-abortCh: - fmt.Fprintf(os.Stderr, "Interrupted twice, exiting (%s)", sig) - switch sig { - case syscall.SIGINT: - os.Exit(130) - default: - os.Exit(130) // if we were interrupted, never return zero. - } - - case <-time.After(30 * time.Minute): // allow time for cleanup. If we finish before this, we'll exit - fmt.Fprintf(os.Stderr, "Timed out during cleanup, exiting") - os.Exit(130) // if we were interrupted, never return zero. - } - }() - signal.Notify(abortCh, syscall.SIGINT, syscall.SIGTERM) - - ext := registry.Get(opts.componentFlags.Component) - if ext == nil { - return fmt.Errorf("component not found: %s", opts.componentFlags.Component) - } - if len(args) > 1 { - return fmt.Errorf("use --names to specify more than one test") - } - opts.nameFlags.Names = append(opts.nameFlags.Names, args...) - - // allow reading tests from an stdin pipe - info, err := os.Stdin.Stat() - if err != nil { - return err - } - if info.Mode()&os.ModeCharDevice == 0 { // Check if input is from a pipe - scanner := bufio.NewScanner(os.Stdin) - for scanner.Scan() { - opts.nameFlags.Names = append(opts.nameFlags.Names, scanner.Text()) - } - if err := scanner.Err(); err != nil { - return fmt.Errorf("error reading from stdin: %v", err) - } - } - - if len(opts.nameFlags.Names) == 0 { - return fmt.Errorf("must specify at least one test") - } - - specs, err := ext.FindSpecsByName(opts.nameFlags.Names...) - if err != nil { - return err - } - - w, err := extensiontests.NewJSONResultWriter(os.Stdout, extensiontests.ResultFormat(opts.outputFlags.Output)) - if err != nil { - return err - } - defer w.Flush() - - return specs.Run(ctx, w, opts.concurrencyFlags.MaxConcurency) - }, - } - opts.componentFlags.BindFlags(cmd.Flags()) - opts.nameFlags.BindFlags(cmd.Flags()) - opts.outputFlags.BindFlags(cmd.Flags()) - opts.concurrencyFlags.BindFlags(cmd.Flags()) - - return cmd -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate/update.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate/update.go deleted file mode 100644 index 5d847308e5..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate/update.go +++ /dev/null @@ -1,84 +0,0 @@ -package cmdupdate - -import ( - "encoding/json" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/spf13/cobra" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension" - "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -const metadataDirectory = ".openshift-tests-extension" - -// NewUpdateCommand adds an "update" command used to generate and verify the metadata we keep track of. This should -// be a black box to end users, i.e. we can add more criteria later they'll consume when revendoring. For now, -// we prevent a test to be renamed without updating other names, or a test to be deleted. -func NewUpdateCommand(registry *extension.Registry) *cobra.Command { - componentFlags := flags.NewComponentFlags() - - cmd := &cobra.Command{ - Use: "update", - Short: "Update test metadata", - SilenceUsage: true, - RunE: func(cmd *cobra.Command, args []string) error { - ext := registry.Get(componentFlags.Component) - if ext == nil { - return fmt.Errorf("couldn't find the component %q", componentFlags.Component) - } - - // Create the metadata directory if it doesn't exist - if err := os.MkdirAll(metadataDirectory, 0755); err != nil { - return fmt.Errorf("failed to create directory %s: %w", metadataDirectory, err) - } - - // Read existing specs - metadataPath := filepath.Join(metadataDirectory, fmt.Sprintf("%s.json", strings.ReplaceAll(ext.Component.Identifier(), ":", "_"))) - var oldSpecs extensiontests.ExtensionTestSpecs - source, err := os.Open(metadataPath) - if err != nil { - if !os.IsNotExist(err) { - return fmt.Errorf("failed to open file: %s: %+w", metadataPath, err) - } - } else { - if err := json.NewDecoder(source).Decode(&oldSpecs); err != nil { - return fmt.Errorf("failed to decode file: %s: %+w", metadataPath, err) - } - - missing, err := ext.FindRemovedTestsWithoutRename(oldSpecs) - if err != nil && len(missing) > 0 { - fmt.Fprintf(os.Stderr, "Missing Tests:\n") - for _, name := range missing { - fmt.Fprintf(os.Stdout, " * %s\n", name) - } - fmt.Fprintf(os.Stderr, "\n") - - return fmt.Errorf("missing tests, if you've renamed tests you must add their names to OriginalName, " + - "or mark them obsolete") - } - } - - // no missing tests, write the results - newSpecs := ext.GetSpecs() - data, err := json.MarshalIndent(newSpecs, "", " ") - if err != nil { - return fmt.Errorf("failed to marshal specs to JSON: %w", err) - } - - // Write the JSON data to the file - if err := os.WriteFile(metadataPath, data, 0644); err != nil { - return fmt.Errorf("failed to write file %s: %w", metadataPath, err) - } - - fmt.Printf("successfully updated metadata\n") - return nil - }, - } - componentFlags.BindFlags(cmd.Flags()) - return cmd -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/dbtime/time.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/dbtime/time.go deleted file mode 100644 index b7651ba022..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/dbtime/time.go +++ /dev/null @@ -1,26 +0,0 @@ -package dbtime - -import "time" - -// DBTime is a type suitable for direct importing into databases like BigQuery, -// formatted like 2006-01-02 15:04:05.000000 UTC. -type DBTime time.Time - -func Ptr(t time.Time) *DBTime { - return (*DBTime)(&t) -} - -func (dbt *DBTime) MarshalJSON() ([]byte, error) { - formattedTime := time.Time(*dbt).Format(`"2006-01-02 15:04:05.000000 UTC"`) - return []byte(formattedTime), nil -} - -func (dbt *DBTime) UnmarshalJSON(b []byte) error { - timeStr := string(b[1 : len(b)-1]) - parsedTime, err := time.Parse("2006-01-02 15:04:05.000000 UTC", timeStr) - if err != nil { - return err - } - *dbt = (DBTime)(parsedTime) - return nil -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extension.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extension.go deleted file mode 100644 index b9fbfb2ece..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extension.go +++ /dev/null @@ -1,165 +0,0 @@ -package extension - -import ( - "fmt" - "strings" - - et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" - "github.com/openshift-eng/openshift-tests-extension/pkg/util/sets" - "github.com/openshift-eng/openshift-tests-extension/pkg/version" -) - -func NewExtension(product, kind, name string) *Extension { - return &Extension{ - APIVersion: CurrentExtensionAPIVersion, - Source: Source{ - Commit: version.CommitFromGit, - BuildDate: version.BuildDate, - GitTreeState: version.GitTreeState, - }, - Component: Component{ - Product: product, - Kind: kind, - Name: name, - }, - } -} - -func (e *Extension) GetSuite(name string) (*Suite, error) { - var suite *Suite - - for _, s := range e.Suites { - if s.Name == name { - suite = &s - break - } - } - - if suite == nil { - return nil, fmt.Errorf("no such suite: %s", name) - } - - return suite, nil -} - -func (e *Extension) GetSpecs() et.ExtensionTestSpecs { - return e.specs -} - -func (e *Extension) AddSpecs(specs et.ExtensionTestSpecs) { - specs.Walk(func(spec *et.ExtensionTestSpec) { - spec.Source = e.Component.Identifier() - }) - - e.specs = append(e.specs, specs...) -} - -// IgnoreObsoleteTests allows removal of a test. -func (e *Extension) IgnoreObsoleteTests(testNames ...string) { - if e.obsoleteTests == nil { - e.obsoleteTests = sets.New[string](testNames...) - } else { - e.obsoleteTests.Insert(testNames...) - } -} - -// FindRemovedTestsWithoutRename compares the current set of test specs against oldSpecs, including consideration of the original name, -// we return an error. Can be used to detect test renames or removals. -func (e *Extension) FindRemovedTestsWithoutRename(oldSpecs et.ExtensionTestSpecs) ([]string, error) { - currentSpecs := e.GetSpecs() - currentMap := make(map[string]bool) - - // Populate current specs into a map for quick lookup by both Name and OriginalName. - for _, spec := range currentSpecs { - currentMap[spec.Name] = true - if spec.OriginalName != "" { - currentMap[spec.OriginalName] = true - } - } - - var removedTests []string - - // Check oldSpecs against current specs. - for _, oldSpec := range oldSpecs { - // Skip if the test is marked as obsolete. - if e.obsoleteTests.Has(oldSpec.Name) { - continue - } - - // Check if oldSpec is missing in currentSpecs by both Name and OriginalName. - if !currentMap[oldSpec.Name] && (oldSpec.OriginalName == "" || !currentMap[oldSpec.OriginalName]) { - removedTests = append(removedTests, oldSpec.Name) - } - } - - // Return error if any removed tests were found. - if len(removedTests) > 0 { - return removedTests, fmt.Errorf("tests removed without rename: %v", removedTests) - } - - return nil, nil -} - -// AddGlobalSuite adds a suite whose qualifiers will apply to all tests, -// not just this one. Allowing a developer to create a composed suite of -// tests from many sources. -func (e *Extension) AddGlobalSuite(suite Suite) *Extension { - if e.Suites == nil { - e.Suites = []Suite{suite} - } else { - e.Suites = append(e.Suites, suite) - } - - return e -} - -// AddSuite adds a suite whose qualifiers will only apply to tests present -// in its own extension. -func (e *Extension) AddSuite(suite Suite) *Extension { - expr := fmt.Sprintf("source == %q", e.Component.Identifier()) - if len(suite.Qualifiers) == 0 { - suite.Qualifiers = []string{expr} - } else { - for i := range suite.Qualifiers { - suite.Qualifiers[i] = fmt.Sprintf("(%s) && (%s)", - expr, suite.Qualifiers[i]) - } - } - - e.AddGlobalSuite(suite) - return e -} - -func (e *Extension) RegisterImage(image Image) *Extension { - e.Images = append(e.Images, image) - return e -} - -func (e *Extension) FindSpecsByName(names ...string) (et.ExtensionTestSpecs, error) { - var specs et.ExtensionTestSpecs - var notFound []string - - for _, name := range names { - found := false - for i := range e.specs { - if e.specs[i].Name == name { - specs = append(specs, e.specs[i]) - found = true - break - } - } - if !found { - notFound = append(notFound, name) - } - } - - if len(notFound) > 0 { - return nil, fmt.Errorf("no such tests: %s", strings.Join(notFound, ", ")) - } - - return specs, nil -} - -func (e *Component) Identifier() string { - return fmt.Sprintf("%s:%s:%s", e.Product, e.Kind, e.Name) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/environment.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/environment.go deleted file mode 100644 index b5116a5359..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/environment.go +++ /dev/null @@ -1,92 +0,0 @@ -package extensiontests - -import ( - "fmt" - "strings" -) - -func PlatformEquals(platform string) string { - return fmt.Sprintf(`platform=="%s"`, platform) -} - -func NetworkEquals(network string) string { - return fmt.Sprintf(`network=="%s"`, network) -} - -func NetworkStackEquals(networkStack string) string { - return fmt.Sprintf(`networkStack=="%s"`, networkStack) -} - -func UpgradeEquals(upgrade string) string { - return fmt.Sprintf(`upgrade=="%s"`, upgrade) -} - -func TopologyEquals(topology string) string { - return fmt.Sprintf(`topology=="%s"`, topology) -} - -func ArchitectureEquals(arch string) string { - return fmt.Sprintf(`architecture=="%s"`, arch) -} - -func APIGroupEnabled(apiGroup string) string { - return fmt.Sprintf(`apiGroups.exists(api, api=="%s")`, apiGroup) -} - -func APIGroupDisabled(apiGroup string) string { - return fmt.Sprintf(`!apiGroups.exists(api, api=="%s")`, apiGroup) -} - -func FeatureGateEnabled(featureGate string) string { - return fmt.Sprintf(`featureGates.exists(fg, fg=="%s")`, featureGate) -} - -func FeatureGateDisabled(featureGate string) string { - return fmt.Sprintf(`!featureGates.exists(fg, fg=="%s")`, featureGate) -} - -func ExternalConnectivityEquals(externalConnectivity string) string { - return fmt.Sprintf(`externalConnectivity=="%s"`, externalConnectivity) -} - -func OptionalCapabilitiesIncludeAny(optionalCapability ...string) string { - for i := range optionalCapability { - optionalCapability[i] = OptionalCapabilityExists(optionalCapability[i]) - } - return fmt.Sprintf("(%s)", fmt.Sprint(strings.Join(optionalCapability, " || "))) -} - -func OptionalCapabilitiesIncludeAll(optionalCapability ...string) string { - for i := range optionalCapability { - optionalCapability[i] = OptionalCapabilityExists(optionalCapability[i]) - } - return fmt.Sprintf("(%s)", fmt.Sprint(strings.Join(optionalCapability, " && "))) -} - -func OptionalCapabilityExists(optionalCapability string) string { - return fmt.Sprintf(`optionalCapabilities.exists(oc, oc=="%s")`, optionalCapability) -} - -func NoOptionalCapabilitiesExist() string { - return "size(optionalCapabilities) == 0" -} - -func InstallerEquals(installer string) string { - return fmt.Sprintf(`installer=="%s"`, installer) -} - -func VersionEquals(version string) string { - return fmt.Sprintf(`version=="%s"`, version) -} - -func FactEquals(key, value string) string { - return fmt.Sprintf(`(fact_keys.exists(k, k=="%s") && facts["%s"].matches("%s"))`, key, key, value) -} - -func Or(cel ...string) string { - return fmt.Sprintf("(%s)", strings.Join(cel, " || ")) -} - -func And(cel ...string) string { - return fmt.Sprintf("(%s)", strings.Join(cel, " && ")) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go deleted file mode 100644 index 2e36969fe6..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go +++ /dev/null @@ -1,69 +0,0 @@ -package extensiontests - -import ( - "fmt" - "strings" - - "github.com/openshift-eng/openshift-tests-extension/pkg/junit" -) - -func (results ExtensionTestResults) Walk(walkFn func(*ExtensionTestResult)) { - for i := range results { - walkFn(results[i]) - } -} - -// AddDetails adds additional information to an ExtensionTestResult. Value must marshal to JSON. -func (result *ExtensionTestResult) AddDetails(name string, value interface{}) { - result.Details = append(result.Details, Details{Name: name, Value: value}) -} - -func (result ExtensionTestResult) ToJUnit() *junit.TestCase { - tc := &junit.TestCase{ - Name: result.Name, - Duration: float64(result.Duration) / 1000.0, - } - switch result.Result { - case ResultFailed: - tc.FailureOutput = &junit.FailureOutput{ - Message: result.Error, - Output: result.Error, - } - case ResultSkipped: - messages := []string{} - for _, detail := range result.Details { - messages = append(messages, fmt.Sprintf("%s: %s", detail.Name, detail.Value)) - } - tc.SkipMessage = &junit.SkipMessage{ - Message: strings.Join(messages, "\n"), - } - case ResultPassed: - tc.SystemOut = result.Output - } - - return tc -} - -func (results ExtensionTestResults) ToJUnit(suiteName string) junit.TestSuite { - suite := junit.TestSuite{ - Name: suiteName, - } - - results.Walk(func(result *ExtensionTestResult) { - suite.NumTests++ - switch result.Result { - case ResultFailed: - suite.NumFailed++ - case ResultSkipped: - suite.NumSkipped++ - case ResultPassed: - // do nothing - default: - panic(fmt.Sprintf("unknown result type: %s", result.Result)) - } - - suite.TestCases = append(suite.TestCases, result.ToJUnit()) - }) - - return suite -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go deleted file mode 100644 index aedc409c17..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go +++ /dev/null @@ -1,164 +0,0 @@ -package extensiontests - -import ( - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "os" - "sync" - - "github.com/openshift-eng/openshift-tests-extension/pkg/junit" -) - -type ResultWriter interface { - Write(result *ExtensionTestResult) - Flush() error -} - -type NullResultWriter struct{} - -func (NullResultWriter) Write(*ExtensionTestResult) {} -func (NullResultWriter) Flush() error { return nil } - -type CompositeResultWriter struct { - writers []ResultWriter -} - -func NewCompositeResultWriter(writers ...ResultWriter) *CompositeResultWriter { - return &CompositeResultWriter{ - writers: writers, - } -} - -func (w *CompositeResultWriter) AddWriter(writer ResultWriter) { - w.writers = append(w.writers, writer) -} - -func (w *CompositeResultWriter) Write(res *ExtensionTestResult) { - for _, writer := range w.writers { - writer.Write(res) - } -} - -func (w *CompositeResultWriter) Flush() error { - var errs []error - for _, writer := range w.writers { - if err := writer.Flush(); err != nil { - errs = append(errs, err) - } - } - - return errors.Join(errs...) -} - -type JUnitResultWriter struct { - lock sync.Mutex - testSuite *junit.TestSuite - out *os.File - suiteName string - path string - results ExtensionTestResults -} - -func NewJUnitResultWriter(path, suiteName string) (ResultWriter, error) { - file, err := os.Create(path) - if err != nil { - return nil, err - } - - return &JUnitResultWriter{ - testSuite: &junit.TestSuite{ - Name: suiteName, - }, - out: file, - suiteName: suiteName, - path: path, - }, nil -} - -func (w *JUnitResultWriter) Write(res *ExtensionTestResult) { - w.lock.Lock() - defer w.lock.Unlock() - w.results = append(w.results, res) -} - -func (w *JUnitResultWriter) Flush() error { - w.lock.Lock() - defer w.lock.Unlock() - data, err := xml.MarshalIndent(w.results.ToJUnit(w.suiteName), "", " ") - if err != nil { - return fmt.Errorf("failed to marshal JUnit XML: %w", err) - } - if _, err := w.out.Write(data); err != nil { - return err - } - if err := w.out.Close(); err != nil { - return err - } - - return nil -} - -type ResultFormat string - -var ( - JSON ResultFormat = "json" - JSONL ResultFormat = "jsonl" -) - -type JSONResultWriter struct { - lock sync.Mutex - out io.Writer - format ResultFormat - results ExtensionTestResults -} - -func NewJSONResultWriter(out io.Writer, format ResultFormat) (*JSONResultWriter, error) { - switch format { - case JSON, JSONL: - // do nothing - default: - return nil, fmt.Errorf("unsupported result format: %s", format) - } - - return &JSONResultWriter{ - out: out, - format: format, - }, nil -} - -func (w *JSONResultWriter) Write(result *ExtensionTestResult) { - w.lock.Lock() - defer w.lock.Unlock() - switch w.format { - case JSONL: - // JSONL gets written to out as we get the items - data, err := json.Marshal(result) - if err != nil { - panic(err) - } - fmt.Fprintf(w.out, "%s\n", string(data)) - case JSON: - w.results = append(w.results, result) - } -} - -func (w *JSONResultWriter) Flush() error { - w.lock.Lock() - defer w.lock.Unlock() - switch w.format { - case JSONL: - // we already wrote it out - case JSON: - data, err := json.MarshalIndent(w.results, "", " ") - if err != nil { - return err - } - _, err = w.out.Write(data) - return err - } - - return nil -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go deleted file mode 100644 index 4e77842451..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go +++ /dev/null @@ -1,613 +0,0 @@ -package extensiontests - -import ( - "context" - "fmt" - "os" - "strings" - "sync" - "sync/atomic" - "time" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/types" - - "github.com/openshift-eng/openshift-tests-extension/pkg/dbtime" - "github.com/openshift-eng/openshift-tests-extension/pkg/flags" -) - -// Walk iterates over all test specs, and executions the function provided. The test spec can be mutated. -func (specs ExtensionTestSpecs) Walk(walkFn func(*ExtensionTestSpec)) ExtensionTestSpecs { - for i := range specs { - walkFn(specs[i]) - } - - return specs -} - -type SelectFunction func(spec *ExtensionTestSpec) bool - -// Select filters the ExtensionTestSpecs to only those that match the provided SelectFunction -func (specs ExtensionTestSpecs) Select(selectFn SelectFunction) ExtensionTestSpecs { - filtered := ExtensionTestSpecs{} - for _, spec := range specs { - if selectFn(spec) { - filtered = append(filtered, spec) - } - } - - return filtered -} - -// MustSelect filters the ExtensionTestSpecs to only those that match the provided SelectFunction. -// if no specs are selected, it will throw an error -func (specs ExtensionTestSpecs) MustSelect(selectFn SelectFunction) (ExtensionTestSpecs, error) { - filtered := specs.Select(selectFn) - if len(filtered) == 0 { - return filtered, fmt.Errorf("no specs selected with specified SelectFunctions") - } - - return filtered, nil -} - -// SelectAny filters the ExtensionTestSpecs to only those that match any of the provided SelectFunctions -func (specs ExtensionTestSpecs) SelectAny(selectFns []SelectFunction) ExtensionTestSpecs { - filtered := ExtensionTestSpecs{} - for _, spec := range specs { - for _, selectFn := range selectFns { - if selectFn(spec) { - filtered = append(filtered, spec) - break - } - } - } - - return filtered -} - -// MustSelectAny filters the ExtensionTestSpecs to only those that match any of the provided SelectFunctions. -// if no specs are selected, it will throw an error -func (specs ExtensionTestSpecs) MustSelectAny(selectFns []SelectFunction) (ExtensionTestSpecs, error) { - filtered := specs.SelectAny(selectFns) - if len(filtered) == 0 { - return filtered, fmt.Errorf("no specs selected with specified SelectFunctions") - } - - return filtered, nil -} - -// SelectAll filters the ExtensionTestSpecs to only those that match all the provided SelectFunctions -func (specs ExtensionTestSpecs) SelectAll(selectFns []SelectFunction) ExtensionTestSpecs { - filtered := ExtensionTestSpecs{} - for _, spec := range specs { - anyFalse := false - for _, selectFn := range selectFns { - if !selectFn(spec) { - anyFalse = true - break - } - } - if !anyFalse { - filtered = append(filtered, spec) - } - } - - return filtered -} - -// MustSelectAll filters the ExtensionTestSpecs to only those that match all the provided SelectFunctions. -// if no specs are selected, it will throw an error -func (specs ExtensionTestSpecs) MustSelectAll(selectFns []SelectFunction) (ExtensionTestSpecs, error) { - filtered := specs.SelectAll(selectFns) - if len(filtered) == 0 { - return filtered, fmt.Errorf("no specs selected with specified SelectFunctions") - } - - return filtered, nil -} - -// ModuleTestsOnly ensures that ginkgo tests from vendored sources aren't selected. Unfortunately, making -// use of kubernetes test helpers results in the entire Ginkgo suite being initialized (ginkgo loves global state), -// so we need to be careful about which tests we select. -// -// A test is excluded if ALL of its code locations with full paths are external (vendored or from external test -// suites). If at least one code location with a full path is from the local module, the test is included, because -// local tests may legitimately call helper functions from vendored test frameworks. -func ModuleTestsOnly() SelectFunction { - return func(spec *ExtensionTestSpec) bool { - hasLocalCode := false - - for _, cl := range spec.CodeLocations { - // Short-form code locations (e.g., "set up framework | framework.go:200") are ignored in this determination. - if !strings.Contains(cl, "/") { - continue - } - - // If this code location is not external (vendored or k8s test), it's local code - if !(strings.Contains(cl, "/vendor/") || strings.HasPrefix(cl, "k8s.io/kubernetes")) { - hasLocalCode = true - break - } - } - - // Include the test only if it has at least one local code location - return hasLocalCode - } -} - -// AllTestsIncludingVendored is an alternative to ModuleTestsOnly, which would explicitly opt-in -// to including vendored tests. -func AllTestsIncludingVendored() SelectFunction { - return func(spec *ExtensionTestSpec) bool { - return true - } -} - -// NameContains returns a function that selects specs whose name contains the provided string -func NameContains(name string) SelectFunction { - return func(spec *ExtensionTestSpec) bool { - return strings.Contains(spec.Name, name) - } -} - -// NameContainsAll returns a function that selects specs whose name contains each of the provided contents strings -func NameContainsAll(contents ...string) SelectFunction { - return func(spec *ExtensionTestSpec) bool { - for _, content := range contents { - if !strings.Contains(spec.Name, content) { - return false - } - } - return true - } -} - -// HasLabel returns a function that selects specs with the provided label -func HasLabel(label string) SelectFunction { - return func(spec *ExtensionTestSpec) bool { - return spec.Labels.Has(label) - } -} - -// HasTagWithValue returns a function that selects specs containing a tag with the provided key and value -func HasTagWithValue(key, value string) SelectFunction { - return func(spec *ExtensionTestSpec) bool { - return spec.Tags[key] == value - } -} - -// WithLifecycle returns a function that selects specs with the provided Lifecycle -func WithLifecycle(lifecycle Lifecycle) SelectFunction { - return func(spec *ExtensionTestSpec) bool { - return spec.Lifecycle == lifecycle - } -} - -func (specs ExtensionTestSpecs) Names() []string { - var names []string - for _, spec := range specs { - names = append(names, spec.Name) - } - return names -} - -// Run executes all the specs in parallel, up to maxConcurrent at the same time. Results -// are written to the given ResultWriter after each spec has completed execution. BeforeEach, -// BeforeAll, AfterEach, AfterAll hooks are executed when specified. "Each" hooks must be thread -// safe. Returns an error if any test spec failed, indicating the quantity of failures. -func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConcurrent int) error { - queue := make(chan *ExtensionTestSpec) - terminalFailures := atomic.Int64{} - nonTerminalFailures := atomic.Int64{} - - // Execute beforeAll - for _, spec := range specs { - for _, beforeAllTask := range spec.beforeAll { - beforeAllTask.Run() - } - } - - // Feed the queue - go func() { - specs.Walk(func(spec *ExtensionTestSpec) { - queue <- spec - }) - close(queue) - }() - - // if we have only a single spec to run, we do that differently than running multiple. - // multiple specs can run in parallel and do so by exec-ing back into the binary with `run-test` with a single test to execute. - // This means that to avoid infinite recursion, when requesting a single test to run - // we need to run it in process. - runSingleSpec := len(specs) == 1 - - // Start consumers - var wg sync.WaitGroup - for i := 0; i < maxConcurrent; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for spec := range queue { - for _, beforeEachTask := range spec.beforeEach { - beforeEachTask.Run(*spec) - } - - res := runSpec(ctx, spec, runSingleSpec) - if res.Result == ResultFailed { - if res.Lifecycle.IsTerminal() { - terminalFailures.Add(1) - } else { - nonTerminalFailures.Add(1) - } - } - - for _, afterEachTask := range spec.afterEach { - afterEachTask.Run(res) - } - - // We can't assume the runner will set the name of a test; it may not know it. Even if - // it does, we may want to modify it (e.g. k8s-tests for annotations currently). - res.Name = spec.Name - w.Write(res) - } - }() - } - - // Wait for all consumers to finish - wg.Wait() - - // Execute afterAll - for _, spec := range specs { - for _, afterAllTask := range spec.afterAll { - afterAllTask.Run() - } - } - - terminalFailCount := terminalFailures.Load() - nonTerminalFailCount := nonTerminalFailures.Load() - - // Non-terminal failures don't cause exit 1, but we still log them - if nonTerminalFailCount > 0 { - fmt.Fprintf(os.Stderr, "%d informing tests failed (not terminal)\n", nonTerminalFailCount) - } - - // Only exit with error if terminal lifecycle tests failed - if terminalFailCount > 0 { - if nonTerminalFailCount > 0 { - return fmt.Errorf("%d tests failed (%d informing)", terminalFailCount+nonTerminalFailCount, nonTerminalFailCount) - } - return fmt.Errorf("%d tests failed", terminalFailCount) - } - - return nil -} - -// AddBeforeAll adds a function to be run once before all tests start executing. -func (specs ExtensionTestSpecs) AddBeforeAll(fn func()) { - task := &OneTimeTask{fn: fn} - specs.Walk(func(spec *ExtensionTestSpec) { - spec.beforeAll = append(spec.beforeAll, task) - }) -} - -// AddAfterAll adds a function to be run once after all tests have finished. -func (specs ExtensionTestSpecs) AddAfterAll(fn func()) { - task := &OneTimeTask{fn: fn} - specs.Walk(func(spec *ExtensionTestSpec) { - spec.afterAll = append(spec.afterAll, task) - }) -} - -// AddBeforeEach adds a function that runs before each test starts executing. The ExtensionTestSpec is -// passed in for contextual information, but must not be modified. The provided function must be thread -// safe. -func (specs ExtensionTestSpecs) AddBeforeEach(fn func(spec ExtensionTestSpec)) { - task := &SpecTask{fn: fn} - specs.Walk(func(spec *ExtensionTestSpec) { - spec.beforeEach = append(spec.beforeEach, task) - }) -} - -// AddAfterEach adds a function that runs after each test has finished executing. The ExtensionTestResult -// can be modified if needed. The provided function must be thread safe. -func (specs ExtensionTestSpecs) AddAfterEach(fn func(task *ExtensionTestResult)) { - task := &TestResultTask{fn: fn} - specs.Walk(func(spec *ExtensionTestSpec) { - spec.afterEach = append(spec.afterEach, task) - }) -} - -// MustFilter filters specs using the given celExprs. Each celExpr is OR'd together, if any -// match the spec is included in the filtered set. If your CEL expression is invalid or filtering -// otherwise fails, this function panics. -func (specs ExtensionTestSpecs) MustFilter(celExprs []string) ExtensionTestSpecs { - specs, err := specs.Filter(celExprs) - if err != nil { - panic(fmt.Sprintf("filter did not succeed: %s", err.Error())) - } - - return specs -} - -// Filter filters specs using the given celExprs. Each celExpr is OR'd together, if any -// match the spec is included in the filtered set. -func (specs ExtensionTestSpecs) Filter(celExprs []string) (ExtensionTestSpecs, error) { - var filteredSpecs ExtensionTestSpecs - - // Empty filters returns all - if len(celExprs) == 0 { - return specs, nil - } - - env, err := cel.NewEnv( - cel.Declarations( - decls.NewVar("source", decls.String), - decls.NewVar("name", decls.String), - decls.NewVar("originalName", decls.String), - decls.NewVar("labels", decls.NewListType(decls.String)), - decls.NewVar("codeLocations", decls.NewListType(decls.String)), - decls.NewVar("tags", decls.NewMapType(decls.String, decls.String)), - ), - ) - if err != nil { - return nil, fmt.Errorf("failed to create CEL environment: %w", err) - } - - // OR all expressions together - for _, spec := range specs { - include := false - for _, celExpr := range celExprs { - prg, err := programForCEL(env, celExpr) - if err != nil { - return nil, err - } - out, _, err := prg.Eval(map[string]interface{}{ - "name": spec.Name, - "source": spec.Source, - "originalName": spec.OriginalName, - "labels": spec.Labels.UnsortedList(), - "codeLocations": spec.CodeLocations, - "tags": spec.Tags, - }) - if err != nil { - return nil, fmt.Errorf("error evaluating CEL expression: %v", err) - } - - // If any CEL expression evaluates to true, include the TestSpec - if out == types.True { - include = true - break - } - } - if include { - filteredSpecs = append(filteredSpecs, spec) - } - } - - return filteredSpecs, nil -} - -func programForCEL(env *cel.Env, celExpr string) (cel.Program, error) { - // Parse CEL expression - ast, iss := env.Parse(celExpr) - if iss.Err() != nil { - return nil, fmt.Errorf("error parsing CEL expression '%s': %v", celExpr, iss.Err()) - } - - // Check the AST - checked, iss := env.Check(ast) - if iss.Err() != nil { - return nil, fmt.Errorf("error checking CEL expression '%s': %v", celExpr, iss.Err()) - } - - // Create a CEL program from the checked AST - prg, err := env.Program(checked) - if err != nil { - return nil, fmt.Errorf("error creating CEL program: %v", err) - } - return prg, nil -} - -// FilterByEnvironment checks both the Include and Exclude fields of the ExtensionTestSpec to return those specs which match. -// Tests will be included by default unless they are explicitly excluded. If Include is specified, only those tests matching -// the CEL expression will be included. -// -// See helper functions in extensiontests/environment.go to craft CEL expressions -func (specs ExtensionTestSpecs) FilterByEnvironment(envFlags flags.EnvironmentalFlags) (ExtensionTestSpecs, error) { - var filteredSpecs ExtensionTestSpecs - if envFlags.IsEmpty() { - return specs, nil - } - - env, err := cel.NewEnv( - cel.Declarations( - decls.NewVar("apiGroups", decls.NewListType(decls.String)), - decls.NewVar("architecture", decls.String), - decls.NewVar("externalConnectivity", decls.String), - decls.NewVar("fact_keys", decls.NewListType(decls.String)), - decls.NewVar("facts", decls.NewMapType(decls.String, decls.String)), - decls.NewVar("featureGates", decls.NewListType(decls.String)), - decls.NewVar("network", decls.String), - decls.NewVar("networkStack", decls.String), - decls.NewVar("optionalCapabilities", decls.NewListType(decls.String)), - decls.NewVar("platform", decls.String), - decls.NewVar("topology", decls.String), - decls.NewVar("upgrade", decls.String), - decls.NewVar("version", decls.String), - ), - ) - if err != nil { - return nil, fmt.Errorf("failed to create CEL environment: %w", err) - } - factKeys := make([]string, len(envFlags.Facts)) - for k := range envFlags.Facts { - factKeys = append(factKeys, k) - } - vars := map[string]interface{}{ - "apiGroups": envFlags.APIGroups, - "architecture": envFlags.Architecture, - "externalConnectivity": envFlags.ExternalConnectivity, - "fact_keys": factKeys, - "facts": envFlags.Facts, - "featureGates": envFlags.FeatureGates, - "network": envFlags.Network, - "networkStack": envFlags.NetworkStack, - "optionalCapabilities": envFlags.OptionalCapabilities, - "platform": envFlags.Platform, - "topology": envFlags.Topology, - "upgrade": envFlags.Upgrade, - "version": envFlags.Version, - } - - for _, spec := range specs { - envSel := spec.EnvironmentSelector - // If there is no include or exclude CEL, include it implicitly - if envSel.IsEmpty() { - filteredSpecs = append(filteredSpecs, spec) - continue - } - - if envSel.Exclude != "" { - prg, err := programForCEL(env, envSel.Exclude) - if err != nil { - return nil, err - } - out, _, err := prg.Eval(vars) - if err != nil { - return nil, fmt.Errorf("error evaluating CEL expression: %v", err) - } - // If it is explicitly excluded, don't check include - if out == types.True { - continue - } - } - - if envSel.Include != "" { - prg, err := programForCEL(env, envSel.Include) - if err != nil { - return nil, err - } - out, _, err := prg.Eval(vars) - if err != nil { - return nil, fmt.Errorf("error evaluating CEL expression: %v", err) - } - - if out == types.True { - filteredSpecs = append(filteredSpecs, spec) - } - } else { // If it hasn't been excluded, and there is no "include" it will be implicitly included - filteredSpecs = append(filteredSpecs, spec) - } - - } - - return filteredSpecs, nil -} - -// AddLabel adds the labels to each spec. -func (specs ExtensionTestSpecs) AddLabel(labels ...string) ExtensionTestSpecs { - for i := range specs { - specs[i].Labels.Insert(labels...) - } - - return specs -} - -// RemoveLabel removes the labels from each spec. -func (specs ExtensionTestSpecs) RemoveLabel(labels ...string) ExtensionTestSpecs { - for i := range specs { - specs[i].Labels.Delete(labels...) - } - - return specs -} - -// SetTag specifies a key/value pair for each spec. -func (specs ExtensionTestSpecs) SetTag(key, value string) ExtensionTestSpecs { - for i := range specs { - specs[i].Tags[key] = value - } - - return specs -} - -// UnsetTag removes the specified key from each spec. -func (specs ExtensionTestSpecs) UnsetTag(key string) ExtensionTestSpecs { - for i := range specs { - delete(specs[i].Tags, key) - } - - return specs -} - -// Include adds the specified CEL expression to explicitly include tests by environment to each spec -func (specs ExtensionTestSpecs) Include(includeCEL string) ExtensionTestSpecs { - for _, spec := range specs { - spec.Include(includeCEL) - } - return specs -} - -// Exclude adds the specified CEL expression to explicitly exclude tests by environment to each spec -func (specs ExtensionTestSpecs) Exclude(excludeCEL string) ExtensionTestSpecs { - for _, spec := range specs { - spec.Exclude(excludeCEL) - } - return specs -} - -// Include adds the specified CEL expression to explicitly include tests by environment. -// If there is already an "include" defined, it will OR the expressions together -func (spec *ExtensionTestSpec) Include(includeCEL string) *ExtensionTestSpec { - existingInclude := spec.EnvironmentSelector.Include - if existingInclude != "" { - includeCEL = fmt.Sprintf("(%s) || (%s)", existingInclude, includeCEL) - } - - spec.EnvironmentSelector.Include = includeCEL - return spec -} - -// Exclude adds the specified CEL expression to explicitly exclude tests by environment. -// If there is already an "exclude" defined, it will OR the expressions together -func (spec *ExtensionTestSpec) Exclude(excludeCEL string) *ExtensionTestSpec { - existingExclude := spec.EnvironmentSelector.Exclude - if existingExclude != "" { - excludeCEL = fmt.Sprintf("(%s) || (%s)", existingExclude, excludeCEL) - } - - spec.EnvironmentSelector.Exclude = excludeCEL - return spec -} - -func runSpec(ctx context.Context, spec *ExtensionTestSpec, runSingleSpec bool) *ExtensionTestResult { - startTime := time.Now().UTC() - var res *ExtensionTestResult - if runSingleSpec || spec.RunParallel == nil { - res = spec.Run(ctx) - } else { - res = spec.RunParallel(ctx) - } - duration := time.Since(startTime) - endTime := startTime.Add(duration).UTC() - if res == nil { - // this shouldn't happen - panic(fmt.Sprintf("test produced no result: %s", spec.Name)) - } - - res.Lifecycle = spec.Lifecycle - - // If the runner doesn't populate this info, we should set it - if res.StartTime == nil { - res.StartTime = dbtime.Ptr(startTime) - } - if res.EndTime == nil { - res.EndTime = dbtime.Ptr(endTime) - } - if res.Duration == 0 { - res.Duration = duration.Milliseconds() - } - - return res -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/task.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/task.go deleted file mode 100644 index e808bea87b..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/task.go +++ /dev/null @@ -1,31 +0,0 @@ -package extensiontests - -import "sync/atomic" - -type SpecTask struct { - fn func(spec ExtensionTestSpec) -} - -func (t *SpecTask) Run(spec ExtensionTestSpec) { - t.fn(spec) -} - -type TestResultTask struct { - fn func(result *ExtensionTestResult) -} - -func (t *TestResultTask) Run(result *ExtensionTestResult) { - t.fn(result) -} - -type OneTimeTask struct { - fn func() - executed int32 // Atomic boolean to indicate whether the function has been run -} - -func (t *OneTimeTask) Run() { - // Ensure one-time tasks are only run once - if atomic.CompareAndSwapInt32(&t.executed, 0, 1) { - t.fn() - } -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go deleted file mode 100644 index cd23be81ff..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go +++ /dev/null @@ -1,119 +0,0 @@ -package extensiontests - -import ( - "context" - - "github.com/openshift-eng/openshift-tests-extension/pkg/dbtime" - "github.com/openshift-eng/openshift-tests-extension/pkg/util/sets" -) - -type Lifecycle string - -var LifecycleInforming Lifecycle = "informing" -var LifecycleBlocking Lifecycle = "blocking" - -// IsTerminal returns true if failures in tests with this lifecycle should cause -// the test run to exit with a non-zero exit code. -func (l Lifecycle) IsTerminal() bool { - return l != LifecycleInforming -} - -type ExtensionTestSpecs []*ExtensionTestSpec - -type ExtensionTestSpec struct { - Name string `json:"name"` - - // OriginalName contains the very first name this test was ever known as, used to preserve - // history across all names. - OriginalName string `json:"originalName,omitempty"` - - // Labels are single string values to apply to the test spec - Labels sets.Set[string] `json:"labels"` - - // Tags are key:value pairs - Tags map[string]string `json:"tags,omitempty"` - - // Resources gives optional information about what's required to run this test. - Resources Resources `json:"resources"` - - // Source is the origin of the test. - Source string `json:"source"` - - // CodeLocations are the files where the spec originates from. - CodeLocations []string `json:"codeLocations,omitempty"` - - // Lifecycle informs the executor whether the test is informing only, and should not cause the - // overall job run to fail, or if it's blocking where a failure of the test is fatal. - // Informing lifecycle tests can be used temporarily to gather information about a test's stability. - // Tests must not remain informing forever. - Lifecycle Lifecycle `json:"lifecycle"` - - // EnvironmentSelector allows for CEL expressions to be used to control test inclusion - EnvironmentSelector EnvironmentSelector `json:"environmentSelector,omitempty"` - - // Run invokes a test in-process. It must not call back into `ote-binary run-test` because that will usually - // cause an infinite recursion. - Run func(ctx context.Context) *ExtensionTestResult `json:"-"` - - // RunParallel invokes a test in parallel with other tests. This is usually done by exec-ing out - // to the `ote-binary run-test "test name"` commmand and interpretting the result. - RunParallel func(ctx context.Context) *ExtensionTestResult `json:"-"` - - // Hook functions - afterAll []*OneTimeTask - beforeAll []*OneTimeTask - afterEach []*TestResultTask - beforeEach []*SpecTask -} - -type Resources struct { - Isolation Isolation `json:"isolation"` - Memory string `json:"memory,omitempty"` - Duration string `json:"duration,omitempty"` - Timeout string `json:"timeout,omitempty"` -} - -type Isolation struct { - Mode string `json:"mode,omitempty"` - Conflict []string `json:"conflict,omitempty"` - Taint []string `json:"taint,omitempty"` - Toleration []string `json:"toleration,omitempty"` -} - -type EnvironmentSelector struct { - Include string `json:"include,omitempty"` - Exclude string `json:"exclude,omitempty"` -} - -func (e EnvironmentSelector) IsEmpty() bool { - return e.Include == "" && e.Exclude == "" -} - -type ExtensionTestResults []*ExtensionTestResult - -type Result string - -var ResultPassed Result = "passed" -var ResultSkipped Result = "skipped" -var ResultFailed Result = "failed" - -type ExtensionTestResult struct { - Name string `json:"name"` - Lifecycle Lifecycle `json:"lifecycle"` - Duration int64 `json:"duration"` - StartTime *dbtime.DBTime `json:"startTime"` - EndTime *dbtime.DBTime `json:"endTime"` - Result Result `json:"result"` - Output string `json:"output"` - Error string `json:"error,omitempty"` - Details []Details `json:"details,omitempty"` -} - -// Details are human-readable messages to further explain skips, timeouts, etc. -// It can also be used to provide contemporaneous information about failures -// that may not be easily returned by must-gather. For larger artifacts (greater than -// 10KB, write them to $EXTENSION_ARTIFACTS_DIR. -type Details struct { - Name string `json:"name"` - Value interface{} `json:"value"` -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/registry.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/registry.go deleted file mode 100644 index bbae421df7..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/registry.go +++ /dev/null @@ -1,39 +0,0 @@ -package extension - -const DefaultExtension = "default" - -type Registry struct { - extensions map[string]*Extension -} - -func NewRegistry() *Registry { - var r Registry - return &r -} - -func (r *Registry) Walk(walkFn func(*Extension)) { - for k := range r.extensions { - if k == DefaultExtension { - continue - } - walkFn(r.extensions[k]) - } -} - -func (r *Registry) Get(name string) *Extension { - return r.extensions[name] -} - -func (r *Registry) Register(extension *Extension) { - if r.extensions == nil { - r.extensions = make(map[string]*Extension) - // first extension is default - r.extensions[DefaultExtension] = extension - } - - r.extensions[extension.Component.Identifier()] = extension -} - -func (r *Registry) Deregister(name string) { - delete(r.extensions, name) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/types.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/types.go deleted file mode 100644 index 00d2d9d663..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/types.go +++ /dev/null @@ -1,94 +0,0 @@ -package extension - -import ( - "time" - - "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" - "github.com/openshift-eng/openshift-tests-extension/pkg/util/sets" -) - -const CurrentExtensionAPIVersion = "v1.1" - -// Extension represents an extension to openshift-tests. -type Extension struct { - APIVersion string `json:"apiVersion"` - Source Source `json:"source"` - Component Component `json:"component"` - - // Suites that the extension wants to advertise/participate in. - Suites []Suite `json:"suites"` - - Images []Image `json:"images"` - - // Private data - specs extensiontests.ExtensionTestSpecs - obsoleteTests sets.Set[string] -} - -// Source contains the details of the commit and source URL. -type Source struct { - // Commit from which this binary was compiled. - Commit string `json:"commit"` - // BuildDate ISO8601 string of when the binary was built - BuildDate string `json:"build_date"` - // GitTreeState lets you know the status of the git tree (clean/dirty) - GitTreeState string `json:"git_tree_state"` - // SourceURL contains the url of the git repository (if known) that this extension was built from. - SourceURL string `json:"source_url,omitempty"` -} - -// Component represents the component the binary acts on. -type Component struct { - // The product this component is part of. - Product string `json:"product"` - // The type of the component. - Kind string `json:"type"` - // The name of the component. - Name string `json:"name"` -} - -type ClusterStability string - -var ( - // ClusterStabilityStable means that at no point during testing do we expect a component to take downtime and upgrades are not happening. - ClusterStabilityStable ClusterStability = "Stable" - - // ClusterStabilityDisruptive means that the suite is expected to induce outages to the cluster. - ClusterStabilityDisruptive ClusterStability = "Disruptive" - - // ClusterStabilityUpgrade was previously defined, but was removed by @deads2k. Please contact him if you find a use - // case for it and needs to be reintroduced. - // ClusterStabilityUpgrade ClusterStability = "Upgrade" -) - -// Suite represents additional suites the extension wants to advertise. Child suites when being executed in the context -// of a parent will have their count, parallelism, stability, and timeout options superseded by the parent's suite. -type Suite struct { - Name string `json:"name"` - Description string `json:"description"` - - // Parents are the parent suites this suite is part of. - Parents []string `json:"parents,omitempty"` - // Qualifiers are CEL expressions that are OR'd together for test selection that are members of the suite. - Qualifiers []string `json:"qualifiers,omitempty"` - - // Count is the default number of times to execute each test in this suite. - Count int `json:"count,omitempty"` - // Parallelism is the maximum parallelism of this suite. - Parallelism int `json:"parallelism,omitempty"` - // ClusterStability informs openshift-tests whether this entire test suite is expected to be disruptive or not - // to normal cluster operations. - ClusterStability ClusterStability `json:"clusterStability,omitempty"` - // TestTimeout is the default timeout for tests in this suite. - TestTimeout *time.Duration `json:"testTimeout,omitempty"` -} - -type Image struct { - Index int `json:"index"` - Registry string `json:"registry"` - Name string `json:"name"` - Version string `json:"version"` - // Mapped is the image reference that this image is mirrored to by the image mirror tool. - // This field should be populated if the mirrored image reference is predetermined by the test extensions. - Mapped *Image `json:"mapped,omitempty"` -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/component.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/component.go deleted file mode 100644 index ca9e425c44..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/component.go +++ /dev/null @@ -1,25 +0,0 @@ -package flags - -import ( - "github.com/spf13/pflag" -) - -const DefaultExtension = "default" - -// ComponentFlags contains information for specifying the component. -type ComponentFlags struct { - Component string -} - -func NewComponentFlags() *ComponentFlags { - return &ComponentFlags{ - Component: DefaultExtension, - } -} - -func (f *ComponentFlags) BindFlags(fs *pflag.FlagSet) { - fs.StringVar(&f.Component, - "component", - f.Component, - "specify the component to enable") -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/concurrency.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/concurrency.go deleted file mode 100644 index 2db07c7654..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/concurrency.go +++ /dev/null @@ -1,23 +0,0 @@ -package flags - -import "github.com/spf13/pflag" - -// ConcurrencyFlags contains information for configuring concurrency -type ConcurrencyFlags struct { - MaxConcurency int -} - -func NewConcurrencyFlags() *ConcurrencyFlags { - return &ConcurrencyFlags{ - MaxConcurency: 10, - } -} - -func (f *ConcurrencyFlags) BindFlags(fs *pflag.FlagSet) { - fs.IntVarP(&f.MaxConcurency, - "max-concurrency", - "c", - f.MaxConcurency, - "maximum number of tests to run in parallel", - ) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/environment.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/environment.go deleted file mode 100644 index af7a0258e2..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/environment.go +++ /dev/null @@ -1,114 +0,0 @@ -package flags - -import ( - "reflect" - - "github.com/spf13/pflag" -) - -type EnvironmentalFlags struct { - APIGroups []string - Architecture string - ExternalConnectivity string - Facts map[string]string - FeatureGates []string - Network string - NetworkStack string - OptionalCapabilities []string - Platform string - Topology string - Upgrade string - Version string -} - -func NewEnvironmentalFlags() *EnvironmentalFlags { - return &EnvironmentalFlags{} -} - -func (f *EnvironmentalFlags) BindFlags(fs *pflag.FlagSet) { - fs.StringArrayVar(&f.APIGroups, - "api-group", - f.APIGroups, - "The API groups supported by this cluster. Since: v1.1") - fs.StringVar(&f.Architecture, - "architecture", - "", - "The CPU architecture of the target cluster (\"amd64\", \"arm64\"). Since: v1.0") - fs.StringVar(&f.ExternalConnectivity, - "external-connectivity", - "", - "The External Connectivity of the target cluster (\"Disconnected\", \"Direct\", \"Proxied\"). Since: v1.0") - fs.StringArrayVar(&f.FeatureGates, - "feature-gate", - f.FeatureGates, - "The feature gates enabled on this cluster. Since: v1.1") - fs.StringToStringVar(&f.Facts, - "fact", - make(map[string]string), - "Facts advertised by cluster components. Since: v1.0") - fs.StringVar(&f.Network, - "network", - "", - "The network of the target cluster (\"ovn\", \"sdn\"). Since: v1.0") - fs.StringVar(&f.NetworkStack, - "network-stack", - "", - "The network stack of the target cluster (\"ipv6\", \"ipv4\", \"dual\"). Since: v1.0") - fs.StringSliceVar(&f.OptionalCapabilities, - "optional-capability", - []string{}, - "An Optional Capability of the target cluster. Can be passed multiple times. Since: v1.0") - fs.StringVar(&f.Platform, - "platform", - "", - "The hardware or cloud platform (\"aws\", \"gcp\", \"metal\", ...). Since: v1.0") - fs.StringVar(&f.Topology, - "topology", - "", - "The target cluster topology (\"ha\", \"microshift\", ...). Since: v1.0") - fs.StringVar(&f.Upgrade, - "upgrade", - "", - "The upgrade that was performed prior to the test run (\"micro\", \"minor\"). Since: v1.0") - fs.StringVar(&f.Version, - "version", - "", - "\"major.minor\" version of target cluster. Since: v1.0") -} - -func (f *EnvironmentalFlags) IsEmpty() bool { - v := reflect.ValueOf(*f) - - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - - switch field.Kind() { - case reflect.Slice, reflect.Map: - if !field.IsNil() && field.Len() > 0 { - return false - } - default: - if !reflect.DeepEqual(field.Interface(), reflect.Zero(field.Type()).Interface()) { - return false - } - } - } - - return true -} - -// EnvironmentFlagVersions holds the "Since" version metadata for each flag. -var EnvironmentFlagVersions = map[string]string{ - "api-group": "v1.1", - "architecture": "v1.0", - "external-connectivity": "v1.0", - "fact": "v1.0", - "feature-gate": "v1.1", - "network": "v1.0", - "network-stack": "v1.0", - "optional-capability": "v1.0", - "platform": "v1.0", - "topology": "v1.0", - "upgrade": "v1.0", - "version": "v1.0", -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/names.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/names.go deleted file mode 100644 index 9e58648395..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/names.go +++ /dev/null @@ -1,24 +0,0 @@ -package flags - -import ( - "github.com/spf13/pflag" -) - -// NamesFlags contains information for specifying multiple test names. -type NamesFlags struct { - Names []string -} - -func NewNamesFlags() *NamesFlags { - return &NamesFlags{ - Names: []string{}, - } -} - -func (f *NamesFlags) BindFlags(fs *pflag.FlagSet) { - fs.StringArrayVarP(&f.Names, - "names", - "n", - f.Names, - "specify test name (can be specified multiple times)") -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/output.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/output.go deleted file mode 100644 index 24f49f6387..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/output.go +++ /dev/null @@ -1,95 +0,0 @@ -package flags - -import ( - "encoding/json" - "reflect" - "strings" - - "github.com/pkg/errors" - "github.com/spf13/pflag" -) - -// OutputFlags contains information for specifying multiple test names. -type OutputFlags struct { - Output string -} - -func NewOutputFlags() *OutputFlags { - return &OutputFlags{ - Output: "json", - } -} - -func (f *OutputFlags) BindFlags(fs *pflag.FlagSet) { - fs.StringVarP(&f.Output, - "output", - "o", - f.Output, - "output mode") -} - -func (o *OutputFlags) Marshal(v interface{}) ([]byte, error) { - switch o.Output { - case "", "json": - j, err := json.MarshalIndent(&v, "", " ") - if err != nil { - return nil, err - } - return j, nil - case "jsonl": - // Check if v is a slice or array - val := reflect.ValueOf(v) - if val.Kind() == reflect.Slice || val.Kind() == reflect.Array { - var result []byte - for i := 0; i < val.Len(); i++ { - item := val.Index(i).Interface() - j, err := json.Marshal(item) - if err != nil { - return nil, err - } - result = append(result, j...) - result = append(result, '\n') // Append newline after each item - } - return result, nil - } - return nil, errors.New("jsonl format requires a slice or array") - case "names": - val := reflect.ValueOf(v) - if val.Kind() == reflect.Slice || val.Kind() == reflect.Array { - var names []string - outerLoop: - for i := 0; i < val.Len(); i++ { - item := val.Index(i) - // Check for Name() or Identifier() methods - itemInterface := item.Interface() - nameFuncs := []string{"Name", "Identifier"} - for _, fn := range nameFuncs { - method := reflect.ValueOf(itemInterface).MethodByName(fn) - if method.IsValid() && method.Kind() == reflect.Func && method.Type().NumIn() == 0 && method.Type().NumOut() == 1 && method.Type().Out(0).Kind() == reflect.String { - name := method.Call(nil)[0].String() - names = append(names, name) - continue outerLoop - } - } - - // Dereference pointer if needed - if item.Kind() == reflect.Ptr { - item = item.Elem() - } - // Check for struct with Name field - if item.Kind() == reflect.Struct { - nameField := item.FieldByName("Name") - if nameField.IsValid() && nameField.Kind() == reflect.String { - names = append(names, nameField.String()) - } - } else { - return nil, errors.New("items must have a Name field or a Name() method") - } - } - return []byte(strings.Join(names, "\n")), nil - } - return nil, errors.New("names format requires an array of structs") - default: - return nil, errors.Errorf("invalid output format: %s", o.Output) - } -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/suite.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/suite.go deleted file mode 100644 index 23de832a85..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/flags/suite.go +++ /dev/null @@ -1,21 +0,0 @@ -package flags - -import ( - "github.com/spf13/pflag" -) - -// SuiteFlags contains information for specifying the suite. -type SuiteFlags struct { - Suite string -} - -func NewSuiteFlags() *SuiteFlags { - return &SuiteFlags{} -} - -func (f *SuiteFlags) BindFlags(fs *pflag.FlagSet) { - fs.StringVar(&f.Suite, - "suite", - f.Suite, - "specify the suite to use") -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/junit/types.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/junit/types.go deleted file mode 100644 index 0309fbd514..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/junit/types.go +++ /dev/null @@ -1,104 +0,0 @@ -package junit - -import ( - "encoding/xml" -) - -// The below types are directly marshalled into XML. The types correspond to jUnit -// XML schema, but do not contain all valid fields. For instance, the class name -// field for test cases is omitted, as this concept does not directly apply to Go. -// For XML specifications see http://help.catchsoftware.com/display/ET/JUnit+Format -// or view the XSD included in this package as 'junit.xsd' - -// TestSuites represents a flat collection of jUnit test suites. -type TestSuites struct { - XMLName xml.Name `xml:"testsuites"` - - // Suites are the jUnit test suites held in this collection - Suites []*TestSuite `xml:"testsuite"` -} - -// TestSuite represents a single jUnit test suite, potentially holding child suites. -type TestSuite struct { - XMLName xml.Name `xml:"testsuite"` - - // Name is the name of the test suite - Name string `xml:"name,attr"` - - // NumTests records the number of tests in the TestSuite - NumTests uint `xml:"tests,attr"` - - // NumSkipped records the number of skipped tests in the suite - NumSkipped uint `xml:"skipped,attr"` - - // NumFailed records the number of failed tests in the suite - NumFailed uint `xml:"failures,attr"` - - // Duration is the time taken in seconds to run all tests in the suite - Duration float64 `xml:"time,attr"` - - // Properties holds other properties of the test suite as a mapping of name to value - Properties []*TestSuiteProperty `xml:"properties,omitempty"` - - // TestCases are the test cases contained in the test suite - TestCases []*TestCase `xml:"testcases"` - - // Children holds nested test suites - Children []*TestSuite `xml:"testsuites"` //nolint -} - -// TestSuiteProperty contains a mapping of a property name to a value -type TestSuiteProperty struct { - XMLName xml.Name `xml:"properties"` - - Name string `xml:"name,attr"` - Value string `xml:"value,attr"` -} - -// TestCase represents a jUnit test case -type TestCase struct { - XMLName xml.Name `xml:"testcase"` - - // Name is the name of the test case - Name string `xml:"name,attr"` - - // Classname is an attribute set by the package type and is required - Classname string `xml:"classname,attr,omitempty"` - - // Duration is the time taken in seconds to run the test - Duration float64 `xml:"time,attr"` - - // SkipMessage holds the reason why the test was skipped - SkipMessage *SkipMessage `xml:"skipped"` - - // FailureOutput holds the output from a failing test - FailureOutput *FailureOutput `xml:"failure"` - - // SystemOut is output written to stdout during the execution of this test case - SystemOut string `xml:"system-out,omitempty"` - - // SystemErr is output written to stderr during the execution of this test case - SystemErr string `xml:"system-err,omitempty"` -} - -// SkipMessage holds a message explaining why a test was skipped -type SkipMessage struct { - XMLName xml.Name `xml:"skipped"` - - // Message explains why the test was skipped - Message string `xml:"message,attr,omitempty"` -} - -// FailureOutput holds the output from a failing test -type FailureOutput struct { - XMLName xml.Name `xml:"failure"` - - // Message holds the failure message from the test - Message string `xml:"message,attr"` - - // Output holds verbose failure output from the test - Output string `xml:",chardata"` -} - -// TestResult is the result of a test case -type TestResult string diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/LICENSE b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/README.md b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/README.md deleted file mode 100644 index 1a5def7723..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This package is copy/pasted from [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery/tree/master/pkg/util/sets) -to avoid a circular dependency with `openshift/kubernetes` as it requires OTE and, without having done this, -OTE would require `kubernetes/kubernetes`. diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/byte.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/byte.go deleted file mode 100644 index 4d7a17c3af..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/byte.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -// Byte is a set of bytes, implemented via map[byte]struct{} for minimal memory consumption. -// -// Deprecated: use generic Set instead. -// new ways: -// s1 := Set[byte]{} -// s2 := New[byte]() -type Byte map[byte]Empty - -// NewByte creates a Byte from a list of values. -func NewByte(items ...byte) Byte { - return Byte(New[byte](items...)) -} - -// ByteKeySet creates a Byte from a keys of a map[byte](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func ByteKeySet[T any](theMap map[byte]T) Byte { - return Byte(KeySet(theMap)) -} - -// Insert adds items to the set. -func (s Byte) Insert(items ...byte) Byte { - return Byte(cast(s).Insert(items...)) -} - -// Delete removes all items from the set. -func (s Byte) Delete(items ...byte) Byte { - return Byte(cast(s).Delete(items...)) -} - -// Has returns true if and only if item is contained in the set. -func (s Byte) Has(item byte) bool { - return cast(s).Has(item) -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Byte) HasAll(items ...byte) bool { - return cast(s).HasAll(items...) -} - -// HasAny returns true if any items are contained in the set. -func (s Byte) HasAny(items ...byte) bool { - return cast(s).HasAny(items...) -} - -// Clone returns a new set which is a copy of the current set. -func (s Byte) Clone() Byte { - return Byte(cast(s).Clone()) -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Byte) Difference(s2 Byte) Byte { - return Byte(cast(s1).Difference(cast(s2))) -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Byte) SymmetricDifference(s2 Byte) Byte { - return Byte(cast(s1).SymmetricDifference(cast(s2))) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Byte) Union(s2 Byte) Byte { - return Byte(cast(s1).Union(cast(s2))) -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Byte) Intersection(s2 Byte) Byte { - return Byte(cast(s1).Intersection(cast(s2))) -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Byte) IsSuperset(s2 Byte) bool { - return cast(s1).IsSuperset(cast(s2)) -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Byte) Equal(s2 Byte) bool { - return cast(s1).Equal(cast(s2)) -} - -// List returns the contents as a sorted byte slice. -func (s Byte) List() []byte { - return List(cast(s)) -} - -// UnsortedList returns the slice with contents in random order. -func (s Byte) UnsortedList() []byte { - return cast(s).UnsortedList() -} - -// PopAny returns a single element from the set. -func (s Byte) PopAny() (byte, bool) { - return cast(s).PopAny() -} - -// Len returns the size of the set. -func (s Byte) Len() int { - return len(s) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/doc.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/doc.go deleted file mode 100644 index 997f5e0330..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package sets has generic set and specified sets. Generic set will -// replace specified ones over time. And specific ones are deprecated. -package sets // import "github.com/openshift-eng/openshift-tests-extension/pkg/util/sets" diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/empty.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/empty.go deleted file mode 100644 index fbb1df06d9..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/empty.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int.go deleted file mode 100644 index 5876fc9deb..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -// Int is a set of ints, implemented via map[int]struct{} for minimal memory consumption. -// -// Deprecated: use generic Set instead. -// new ways: -// s1 := Set[int]{} -// s2 := New[int]() -type Int map[int]Empty - -// NewInt creates a Int from a list of values. -func NewInt(items ...int) Int { - return Int(New[int](items...)) -} - -// IntKeySet creates a Int from a keys of a map[int](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func IntKeySet[T any](theMap map[int]T) Int { - return Int(KeySet(theMap)) -} - -// Insert adds items to the set. -func (s Int) Insert(items ...int) Int { - return Int(cast(s).Insert(items...)) -} - -// Delete removes all items from the set. -func (s Int) Delete(items ...int) Int { - return Int(cast(s).Delete(items...)) -} - -// Has returns true if and only if item is contained in the set. -func (s Int) Has(item int) bool { - return cast(s).Has(item) -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int) HasAll(items ...int) bool { - return cast(s).HasAll(items...) -} - -// HasAny returns true if any items are contained in the set. -func (s Int) HasAny(items ...int) bool { - return cast(s).HasAny(items...) -} - -// Clone returns a new set which is a copy of the current set. -func (s Int) Clone() Int { - return Int(cast(s).Clone()) -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int) Difference(s2 Int) Int { - return Int(cast(s1).Difference(cast(s2))) -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int) SymmetricDifference(s2 Int) Int { - return Int(cast(s1).SymmetricDifference(cast(s2))) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int) Union(s2 Int) Int { - return Int(cast(s1).Union(cast(s2))) -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int) Intersection(s2 Int) Int { - return Int(cast(s1).Intersection(cast(s2))) -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int) IsSuperset(s2 Int) bool { - return cast(s1).IsSuperset(cast(s2)) -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int) Equal(s2 Int) bool { - return cast(s1).Equal(cast(s2)) -} - -// List returns the contents as a sorted int slice. -func (s Int) List() []int { - return List(cast(s)) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int) UnsortedList() []int { - return cast(s).UnsortedList() -} - -// PopAny returns a single element from the set. -func (s Int) PopAny() (int, bool) { - return cast(s).PopAny() -} - -// Len returns the size of the set. -func (s Int) Len() int { - return len(s) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int32.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int32.go deleted file mode 100644 index 2c640c5d0f..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int32.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -// Int32 is a set of int32s, implemented via map[int32]struct{} for minimal memory consumption. -// -// Deprecated: use generic Set instead. -// new ways: -// s1 := Set[int32]{} -// s2 := New[int32]() -type Int32 map[int32]Empty - -// NewInt32 creates a Int32 from a list of values. -func NewInt32(items ...int32) Int32 { - return Int32(New[int32](items...)) -} - -// Int32KeySet creates a Int32 from a keys of a map[int32](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func Int32KeySet[T any](theMap map[int32]T) Int32 { - return Int32(KeySet(theMap)) -} - -// Insert adds items to the set. -func (s Int32) Insert(items ...int32) Int32 { - return Int32(cast(s).Insert(items...)) -} - -// Delete removes all items from the set. -func (s Int32) Delete(items ...int32) Int32 { - return Int32(cast(s).Delete(items...)) -} - -// Has returns true if and only if item is contained in the set. -func (s Int32) Has(item int32) bool { - return cast(s).Has(item) -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int32) HasAll(items ...int32) bool { - return cast(s).HasAll(items...) -} - -// HasAny returns true if any items are contained in the set. -func (s Int32) HasAny(items ...int32) bool { - return cast(s).HasAny(items...) -} - -// Clone returns a new set which is a copy of the current set. -func (s Int32) Clone() Int32 { - return Int32(cast(s).Clone()) -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int32) Difference(s2 Int32) Int32 { - return Int32(cast(s1).Difference(cast(s2))) -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int32) SymmetricDifference(s2 Int32) Int32 { - return Int32(cast(s1).SymmetricDifference(cast(s2))) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int32) Union(s2 Int32) Int32 { - return Int32(cast(s1).Union(cast(s2))) -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int32) Intersection(s2 Int32) Int32 { - return Int32(cast(s1).Intersection(cast(s2))) -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int32) IsSuperset(s2 Int32) bool { - return cast(s1).IsSuperset(cast(s2)) -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int32) Equal(s2 Int32) bool { - return cast(s1).Equal(cast(s2)) -} - -// List returns the contents as a sorted int32 slice. -func (s Int32) List() []int32 { - return List(cast(s)) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int32) UnsortedList() []int32 { - return cast(s).UnsortedList() -} - -// PopAny returns a single element from the set. -func (s Int32) PopAny() (int32, bool) { - return cast(s).PopAny() -} - -// Len returns the size of the set. -func (s Int32) Len() int { - return len(s) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int64.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int64.go deleted file mode 100644 index bf3eb3ffa2..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/int64.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -// Int64 is a set of int64s, implemented via map[int64]struct{} for minimal memory consumption. -// -// Deprecated: use generic Set instead. -// new ways: -// s1 := Set[int64]{} -// s2 := New[int64]() -type Int64 map[int64]Empty - -// NewInt64 creates a Int64 from a list of values. -func NewInt64(items ...int64) Int64 { - return Int64(New[int64](items...)) -} - -// Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func Int64KeySet[T any](theMap map[int64]T) Int64 { - return Int64(KeySet(theMap)) -} - -// Insert adds items to the set. -func (s Int64) Insert(items ...int64) Int64 { - return Int64(cast(s).Insert(items...)) -} - -// Delete removes all items from the set. -func (s Int64) Delete(items ...int64) Int64 { - return Int64(cast(s).Delete(items...)) -} - -// Has returns true if and only if item is contained in the set. -func (s Int64) Has(item int64) bool { - return cast(s).Has(item) -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int64) HasAll(items ...int64) bool { - return cast(s).HasAll(items...) -} - -// HasAny returns true if any items are contained in the set. -func (s Int64) HasAny(items ...int64) bool { - return cast(s).HasAny(items...) -} - -// Clone returns a new set which is a copy of the current set. -func (s Int64) Clone() Int64 { - return Int64(cast(s).Clone()) -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int64) Difference(s2 Int64) Int64 { - return Int64(cast(s1).Difference(cast(s2))) -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int64) SymmetricDifference(s2 Int64) Int64 { - return Int64(cast(s1).SymmetricDifference(cast(s2))) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int64) Union(s2 Int64) Int64 { - return Int64(cast(s1).Union(cast(s2))) -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int64) Intersection(s2 Int64) Int64 { - return Int64(cast(s1).Intersection(cast(s2))) -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int64) IsSuperset(s2 Int64) bool { - return cast(s1).IsSuperset(cast(s2)) -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int64) Equal(s2 Int64) bool { - return cast(s1).Equal(cast(s2)) -} - -// List returns the contents as a sorted int64 slice. -func (s Int64) List() []int64 { - return List(cast(s)) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int64) UnsortedList() []int64 { - return cast(s).UnsortedList() -} - -// PopAny returns a single element from the set. -func (s Int64) PopAny() (int64, bool) { - return cast(s).PopAny() -} - -// Len returns the size of the set. -func (s Int64) Len() int { - return len(s) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/set.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/set.go deleted file mode 100644 index cd961c8c59..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/set.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -import ( - "cmp" - "sort" -) - -// Set is a set of the same type elements, implemented via map[comparable]struct{} for minimal memory consumption. -type Set[T comparable] map[T]Empty - -// cast transforms specified set to generic Set[T]. -func cast[T comparable](s map[T]Empty) Set[T] { return s } - -// New creates a Set from a list of values. -// NOTE: type param must be explicitly instantiated if given items are empty. -func New[T comparable](items ...T) Set[T] { - ss := make(Set[T], len(items)) - ss.Insert(items...) - return ss -} - -// KeySet creates a Set from a keys of a map[comparable](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func KeySet[T comparable, V any](theMap map[T]V) Set[T] { - ret := make(Set[T], len(theMap)) - for keyValue := range theMap { - ret.Insert(keyValue) - } - return ret -} - -// Insert adds items to the set. -func (s Set[T]) Insert(items ...T) Set[T] { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -func Insert[T comparable](set Set[T], items ...T) Set[T] { - return set.Insert(items...) -} - -// Delete removes all items from the set. -func (s Set[T]) Delete(items ...T) Set[T] { - for _, item := range items { - delete(s, item) - } - return s -} - -// Clear empties the set. -// It is preferable to replace the set with a newly constructed set, -// but not all callers can do that (when there are other references to the map). -func (s Set[T]) Clear() Set[T] { - clear(s) - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Set[T]) Has(item T) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Set[T]) HasAll(items ...T) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Set[T]) HasAny(items ...T) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Set[T]) Clone() Set[T] { - result := make(Set[T], len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Set[T]) Difference(s2 Set[T]) Set[T] { - result := New[T]() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Set[T]) SymmetricDifference(s2 Set[T]) Set[T] { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Set[T]) Union(s2 Set[T]) Set[T] { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Set[T]) Intersection(s2 Set[T]) Set[T] { - var walk, other Set[T] - result := New[T]() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Set[T]) IsSuperset(s2 Set[T]) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Set[T]) Equal(s2 Set[T]) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfGeneric[T cmp.Ordered] []T - -func (g sortableSliceOfGeneric[T]) Len() int { return len(g) } -func (g sortableSliceOfGeneric[T]) Less(i, j int) bool { return less[T](g[i], g[j]) } -func (g sortableSliceOfGeneric[T]) Swap(i, j int) { g[i], g[j] = g[j], g[i] } - -// List returns the contents as a sorted T slice. -// -// This is a separate function and not a method because not all types supported -// by Generic are ordered and only those can be sorted. -func List[T cmp.Ordered](s Set[T]) []T { - res := make(sortableSliceOfGeneric[T], 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return res -} - -// UnsortedList returns the slice with contents in random order. -func (s Set[T]) UnsortedList() []T { - res := make([]T, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// PopAny returns a single element from the set. -func (s Set[T]) PopAny() (T, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue T - return zeroValue, false -} - -// Len returns the size of the set. -func (s Set[T]) Len() int { - return len(s) -} - -func less[T cmp.Ordered](lhs, rhs T) bool { - return lhs < rhs -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/string.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/string.go deleted file mode 100644 index 1dab6d13cc..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/util/sets/string.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sets - -// String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. -// -// Deprecated: use generic Set instead. -// new ways: -// s1 := Set[string]{} -// s2 := New[string]() -type String map[string]Empty - -// NewString creates a String from a list of values. -func NewString(items ...string) String { - return String(New[string](items...)) -} - -// StringKeySet creates a String from a keys of a map[string](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func StringKeySet[T any](theMap map[string]T) String { - return String(KeySet(theMap)) -} - -// Insert adds items to the set. -func (s String) Insert(items ...string) String { - return String(cast(s).Insert(items...)) -} - -// Delete removes all items from the set. -func (s String) Delete(items ...string) String { - return String(cast(s).Delete(items...)) -} - -// Has returns true if and only if item is contained in the set. -func (s String) Has(item string) bool { - return cast(s).Has(item) -} - -// HasAll returns true if and only if all items are contained in the set. -func (s String) HasAll(items ...string) bool { - return cast(s).HasAll(items...) -} - -// HasAny returns true if any items are contained in the set. -func (s String) HasAny(items ...string) bool { - return cast(s).HasAny(items...) -} - -// Clone returns a new set which is a copy of the current set. -func (s String) Clone() String { - return String(cast(s).Clone()) -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 String) Difference(s2 String) String { - return String(cast(s1).Difference(cast(s2))) -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 String) SymmetricDifference(s2 String) String { - return String(cast(s1).SymmetricDifference(cast(s2))) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 String) Union(s2 String) String { - return String(cast(s1).Union(cast(s2))) -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 String) Intersection(s2 String) String { - return String(cast(s1).Intersection(cast(s2))) -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 String) IsSuperset(s2 String) bool { - return cast(s1).IsSuperset(cast(s2)) -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 String) Equal(s2 String) bool { - return cast(s1).Equal(cast(s2)) -} - -// List returns the contents as a sorted string slice. -func (s String) List() []string { - return List(cast(s)) -} - -// UnsortedList returns the slice with contents in random order. -func (s String) UnsortedList() []string { - return cast(s).UnsortedList() -} - -// PopAny returns a single element from the set. -func (s String) PopAny() (string, bool) { - return cast(s).PopAny() -} - -// Len returns the size of the set. -func (s String) Len() int { - return len(s) -} diff --git a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/version/version.go b/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/version/version.go deleted file mode 100644 index 7d6a3309b3..0000000000 --- a/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/version/version.go +++ /dev/null @@ -1,11 +0,0 @@ -package version - -var ( - // CommitFromGit is a constant representing the source version that - // generated this build. It should be set during build via -ldflags. - CommitFromGit string - // BuildDate in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ') - BuildDate string - // GitTreeState has the state of git tree, either "clean" or "dirty" - GitTreeState string -) diff --git a/vendor/modules.txt b/vendor/modules.txt index daec7de98b..8547c7c65d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -381,21 +381,6 @@ github.com/opencontainers/runc/libcontainer/user # github.com/opencontainers/runtime-spec v1.2.0 ## explicit github.com/opencontainers/runtime-spec/specs-go -# github.com/openshift-eng/openshift-tests-extension v0.0.0-20251113163031-356b66aa5c24 -## explicit; go 1.23.0 -github.com/openshift-eng/openshift-tests-extension/pkg/cmd -github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages -github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdinfo -github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdlist -github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun -github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdupdate -github.com/openshift-eng/openshift-tests-extension/pkg/dbtime -github.com/openshift-eng/openshift-tests-extension/pkg/extension -github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests -github.com/openshift-eng/openshift-tests-extension/pkg/flags -github.com/openshift-eng/openshift-tests-extension/pkg/junit -github.com/openshift-eng/openshift-tests-extension/pkg/util/sets -github.com/openshift-eng/openshift-tests-extension/pkg/version # github.com/openshift/api v0.0.0-20250820105013-6282350d0c39 ## explicit; go 1.24.0 github.com/openshift/api