Skip to content

Commit

Permalink
Merge pull request #2 from stbenjam/example
Browse files Browse the repository at this point in the history
TRT-1834: initial version of openshift-tests-extension
  • Loading branch information
openshift-merge-bot[bot] authored Oct 2, 2024
2 parents 30fd119 + ff88840 commit cabe07f
Show file tree
Hide file tree
Showing 1,186 changed files with 563,833 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/framework-tests
/example-tests
230 changes: 230 additions & 0 deletions .openshift-tests-extension/openshift:framework:default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
[
{
"name": "[sig-testing] openshift-tests-extension should be run from the main directory",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension should run `make` command successfully",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension should have the example-tests binary",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests info should have build metadata",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests info should have the expected suites",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests info should have the correct component information",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests list should list all specs",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests list should populate fields",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests list should filter specs by suite",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests run-suite should contain a test that passed",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests run-suite should have the correct error message for the failed test",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] example-tests run-suite fast suite should not have a slow test",
"otherNames": null,
"labels": {
"framework": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:framework:default",
"lifecycle": "blocking"
}
]
106 changes: 106 additions & 0 deletions .openshift-tests-extension/openshift:payload:example-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[
{
"name": "[sig-testing] openshift-tests-extension ordered should run beforeAll once",
"otherNames": null,
"labels": {},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:payload:example-tests",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension setup should support beforeEach",
"otherNames": null,
"labels": {},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:payload:example-tests",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension should support passing tests",
"otherNames": null,
"labels": {},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:payload:example-tests",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension should support failing tests",
"otherNames": null,
"labels": {},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:payload:example-tests",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension should support panicking tests",
"otherNames": null,
"labels": {},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:payload:example-tests",
"lifecycle": "blocking"
},
{
"name": "[sig-testing] openshift-tests-extension should support slow tests",
"otherNames": null,
"labels": {
"SLOW": {}
},
"tags": null,
"resources": {
"isolation": {
"mode": "",
"conflict": null
},
"memory": "",
"duration": "",
"timeout": ""
},
"source": "openshift:payload:example-tests",
"lifecycle": "blocking"
}
]
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS builder
WORKDIR /go/src/github.com/openshift-eng/openshift-tests-extension
COPY . .
RUN make && \
mkdir -p /tmp/build && \
cp /go/src/github.com/openshift-eng/openshift-tests-extension/example-tests /tmp/build/example-tests && \
gzip /tmp/build/example-tests

FROM registry.ci.openshift.org/ocp/4.17:tools
COPY --from=builder /tmp/build/example-tests.gz /usr/bin/example-tests.gz
LABEL io.k8s.display-name="OpenShift Tests Extension" \
io.openshift.release.operator=true \
io.openshift.tags="openshift,tests,e2e,e2e-extension"
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
GO_PKG_NAME := github.com/openshift-eng/openshift-tests-extension

GIT_COMMIT := $(shell git rev-parse --short HEAD)
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
GIT_TREE_STATE := $(shell if git diff --quiet; then echo clean; else echo dirty; 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)'

.PHONY: verify test lint clean unit integration example-tests framework-tests

all: unit build integration

verify: lint

build: example-tests framework-tests

example-tests:
go build -ldflags "$(LDFLAGS)" ./cmd/example-tests/...

framework-tests:
go build -ldflags "$(LDFLAGS)" ./cmd/framework-tests/...

test: unit integration

unit:
go test ./...

integration: build
./framework-tests run-suite framework

lint:
./hack/go-lint.sh run ./...

clean:
rm -f example-tests framework-tests
Loading

0 comments on commit cabe07f

Please sign in to comment.