From 1b2e3e851323e5a4998ab687a18c5bb39942b4a0 Mon Sep 17 00:00:00 2001 From: Dmitrii Tikhomirov Date: Sun, 22 Dec 2024 17:30:28 -0800 Subject: [PATCH 1/2] setup kind on e2e run --- packages/kn-plugin-workflow/Makefile | 36 +++++++++++++++++++++++- packages/kn-plugin-workflow/package.json | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/packages/kn-plugin-workflow/Makefile b/packages/kn-plugin-workflow/Makefile index b5657d347a0..b6030836389 100644 --- a/packages/kn-plugin-workflow/Makefile +++ b/packages/kn-plugin-workflow/Makefile @@ -33,6 +33,8 @@ SET_VERSION := $(METADATA_PATH).PluginVersion=$(PLUGIN_VERSION SET_KOGITO_VERSION := $(METADATA_PATH).KogitoVersion=$(KOGITO_VERSION) LDFLAGS := "-X $(SET_QUARKUS_PLATFORM_GROUP_ID) -X $(SET_QUARKUS_VERSION) -X $(SET_VERSION) -X $(SET_DEV_MODE_IMAGE) -X $(SET_KOGITO_VERSION)" +KIND_VERSION ?= v0.20.0 + ARCH := $(shell uname -m) ifeq ($(ARCH),arm64) GOARCH = arm64 @@ -61,4 +63,36 @@ build-win32-amd64: clean: go clean - rm -rf $(BIN_PATH) $(TEST_PATH) \ No newline at end of file + rm -rf $(BIN_PATH) $(TEST_PATH) + +.PHONY: test-e2e +test-e2e: + @$(MAKE) install-kind + @$(MAKE) create-cluster + @$(MAKE) install-operator + @$(MAKE) go-test-e2e + +.PHONY: go-test-e2e +go-test-e2e: + rm -rf dist-tests-e2e + mkdir dist-tests-e2e + go test -v ./e2e-tests/... -tags e2e_tests -timeout 20m 2>&1 | tee ./dist-tests-e2e/go-test-output-e2e.txt + +.PHONY: install-kind +install-kind: + command -v kind >/dev/null || go install sigs.k8s.io/kind@$(KIND_VERSION) + +.PHONY: create-cluster +create-cluster: install-kind + kind create cluster + +.PHONY: install-operator +install-operator: + kubectl apply -f https://github.com/apache/incubator-kie-tools/blob/c690d462602da4cf2c01b90279815b60a1959162/packages/sonataflow-operator/operator.yaml + +.PHONY: go-test-e2e-report +go-test-e2e-report: + go run github.com/jstemmer/go-junit-report/v2 \ + -set-exit-code \ + -in ./dist-tests-e2e/go-test-output-e2e.txt \ + -out ./dist-tests-e2e/junit-report-it.xml \ No newline at end of file diff --git a/packages/kn-plugin-workflow/package.json b/packages/kn-plugin-workflow/package.json index b860ec7803c..de17d096537 100644 --- a/packages/kn-plugin-workflow/package.json +++ b/packages/kn-plugin-workflow/package.json @@ -42,7 +42,7 @@ "setup:env": "cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env versions.quarkus) PLUGIN_VERSION=$(build-env knPluginWorkflow.version) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env versions.kogito)", "setup:env:win32": "pnpm powershell \"cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env versions.quarkus) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env versions.kogito) PLUGIN_VERSION=$(build-env knPluginWorkflow.version)\"", "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"pnpm go:test\" \"pnpm go:test:report\"", - "test-e2e": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e\" \"pnpm go:test-e2e:report\"", + "test-e2e": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"make go-test-e2e\" \"make go-test-e2e-report\"", "test-e2e:logs": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:logs\" \"pnpm go:test-e2e:report\"", "test-e2e:not:quarkus": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:not:quarkus\" \"pnpm go:test-e2e:report\"", "test-e2e:not:quarkus:logs": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:not:quarkus:logs\" \"pnpm go:test-e2e:report\"", From 436d693c4c9adc49ec77e4ae645876ea124acf14 Mon Sep 17 00:00:00 2001 From: Dmitrii Tikhomirov Date: Sun, 22 Dec 2024 19:29:19 -0800 Subject: [PATCH 2/2] use operator.yaml from sonataflow-operator --- packages/kn-plugin-workflow/Makefile | 14 ++++++++------ packages/kn-plugin-workflow/package.json | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/kn-plugin-workflow/Makefile b/packages/kn-plugin-workflow/Makefile index b6030836389..d2ea6cce538 100644 --- a/packages/kn-plugin-workflow/Makefile +++ b/packages/kn-plugin-workflow/Makefile @@ -71,12 +71,8 @@ test-e2e: @$(MAKE) create-cluster @$(MAKE) install-operator @$(MAKE) go-test-e2e + @$(MAKE) go-test-e2e-report -.PHONY: go-test-e2e -go-test-e2e: - rm -rf dist-tests-e2e - mkdir dist-tests-e2e - go test -v ./e2e-tests/... -tags e2e_tests -timeout 20m 2>&1 | tee ./dist-tests-e2e/go-test-output-e2e.txt .PHONY: install-kind install-kind: @@ -88,7 +84,13 @@ create-cluster: install-kind .PHONY: install-operator install-operator: - kubectl apply -f https://github.com/apache/incubator-kie-tools/blob/c690d462602da4cf2c01b90279815b60a1959162/packages/sonataflow-operator/operator.yaml + kubectl create -f ../sonataflow-operator/operator.yaml + +.PHONY: go-test-e2e +go-test-e2e: + rm -rf dist-tests-e2e + mkdir dist-tests-e2e + go test -v ./e2e-tests/... -tags e2e_tests -timeout 20m 2>&1 | tee ./dist-tests-e2e/go-test-output-e2e.txt .PHONY: go-test-e2e-report go-test-e2e-report: diff --git a/packages/kn-plugin-workflow/package.json b/packages/kn-plugin-workflow/package.json index de17d096537..4ad15ea5eb7 100644 --- a/packages/kn-plugin-workflow/package.json +++ b/packages/kn-plugin-workflow/package.json @@ -42,7 +42,7 @@ "setup:env": "cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env versions.quarkus) PLUGIN_VERSION=$(build-env knPluginWorkflow.version) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env versions.kogito)", "setup:env:win32": "pnpm powershell \"cross-env QUARKUS_PLATFORM_GROUP_ID=$(build-env knPluginWorkflow.quarkusPlatformGroupId) QUARKUS_VERSION=$(build-env versions.quarkus) DEV_MODE_IMAGE_URL=$(build-env knPluginWorkflow.devModeImageUrl) KOGITO_VERSION=$(build-env versions.kogito) PLUGIN_VERSION=$(build-env knPluginWorkflow.version)\"", "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"pnpm go:test\" \"pnpm go:test:report\"", - "test-e2e": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"make go-test-e2e\" \"make go-test-e2e-report\"", + "test-e2e": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"make test-e2e\"", "test-e2e:logs": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:logs\" \"pnpm go:test-e2e:report\"", "test-e2e:not:quarkus": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:not:quarkus\" \"pnpm go:test-e2e:report\"", "test-e2e:not:quarkus:logs": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm go:test-e2e:not:quarkus:logs\" \"pnpm go:test-e2e:report\"",