From bba88384936456c49dee59e9bf3b2efbcf3e900a Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Fri, 3 May 2024 21:08:35 +0530 Subject: [PATCH 01/26] added a way to generate reports --- make/test.mk | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/make/test.mk b/make/test.mk index 360a0eb56..2809b8faf 100644 --- a/make/test.mk +++ b/make/test.mk @@ -38,6 +38,8 @@ E2E_PARALLELISM=1 TESTS_RUN_FILTER_REGEXP ?= "" +REPORT_PORTAL_DIR := rp_preproc/results + .PHONY: test-e2e ## Run the e2e tests test-e2e: INSTALL_OPERATOR=true @@ -56,13 +58,13 @@ verify-migration-and-deploy-e2e: prepare-projects e2e-deploy-latest e2e-migratio .PHONY: e2e-migration-setup e2e-migration-setup: @echo "Setting up the environment before testing the operator migration..." - $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/migration/setup" + $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/migration/setup" REPORT_NAME="xunit_e2e_migration_setup.xml" @echo "Environment successfully setup." .PHONY: e2e-migration-verify e2e-migration-verify: @echo "Updating operators and verifying resources..." - $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/migration/verify" + $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/migration/verify" REPORT_NAME="xunit_e2e_migration_verify.xml" @echo "Migration tests successfully finished" .PHONY: e2e-deploy-latest @@ -121,13 +123,13 @@ test-e2e-registration-local: .PHONY: e2e-run-parallel e2e-run-parallel: @echo "Running e2e tests in parallel..." - $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/e2e/parallel" E2E_PARALLELISM=100 + $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/e2e/parallel" E2E_PARALLELISM=100 REPORT_NAME="xunit_e2e_parallel.xml" @echo "The parallel e2e tests successfully finished" .PHONY: e2e-run e2e-run: @echo "Running e2e tests..." - $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/e2e ./test/metrics" + $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/e2e ./test/metrics" REPORT_NAME="xunit_e2e.xml" @echo "The e2e tests successfully finished" .PHONY: execute-tests @@ -137,7 +139,7 @@ execute-tests: @echo "Status of ToolchainStatus" -oc get ToolchainStatus -n ${HOST_NS} -o yaml @echo "Starting test $(shell date)" - MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast || \ + MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) .PHONY: print-logs @@ -155,6 +157,17 @@ else $(MAKE) print-local-debug-info HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} endif +.PHONY: generate-report +generate-report: + @echo "Generating report" +ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) + mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} + go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} + @echo "xUnit Report Generation Successful" +else + @echo "Skipping Report as its a local run" +endif + .PHONY: deploy-e2e-local-and-print-local-debug deploy-e2e-local-and-print-local-debug: deploy-e2e-local print-local-debug-info From 754a54b518f6c1cbbabb7cb4f6968b1637732b1d Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Fri, 3 May 2024 21:14:13 +0530 Subject: [PATCH 02/26] install go-unit-report --- openshift-ci/Dockerfile.tools | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index b5301aded..551a52dde 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -43,4 +43,6 @@ RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} +RUN go install github.com/jstemmer/go-junit-report/v2@latest + ENTRYPOINT [ "/bin/bash" ] From 994ee26441958ab38f51de930d3c32da84d067db Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 13 May 2024 12:39:43 +0530 Subject: [PATCH 03/26] check and install go-junit-report --- make/test.mk | 8 ++++++++ openshift-ci/Dockerfile.tools | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index 9a45a2387..d5b15eea3 100644 --- a/make/test.mk +++ b/make/test.mk @@ -158,6 +158,8 @@ execute-tests: -oc get Space -n ${HOST_NS} @echo "Status of ToolchainStatus" -oc get ToolchainStatus -n ${HOST_NS} -o yaml + @echo "Check Reporting" + $(MAKE) check-go-junit-report @echo "Starting test $(shell date)" MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) @@ -177,6 +179,12 @@ else $(MAKE) print-local-debug-info HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} endif +.PHONY: check-go-junit-report + +check-go-junit-report: + @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report@latest; } + @echo "go-junit-report version:" && go-junit-report -version + .PHONY: generate-report generate-report: @echo "Generating report" diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 551a52dde..00052542e 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -43,6 +43,5 @@ RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} -RUN go install github.com/jstemmer/go-junit-report/v2@latest ENTRYPOINT [ "/bin/bash" ] From 9a4f036eb533cac0a43fd1a298612c22cafe68f8 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 13 May 2024 14:10:10 +0530 Subject: [PATCH 04/26] another try --- make/test.mk | 3 ++- openshift-ci/Dockerfile.tools | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/make/test.mk b/make/test.mk index d5b15eea3..7779033ab 100644 --- a/make/test.mk +++ b/make/test.mk @@ -182,8 +182,9 @@ endif .PHONY: check-go-junit-report check-go-junit-report: - @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report@latest; } + @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } @echo "go-junit-report version:" && go-junit-report -version + go env .PHONY: generate-report generate-report: diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 00052542e..70da32a84 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -37,11 +37,11 @@ RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOL && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && go version + && go version \ + && go install github.com/jstemmer/go-junit-report/v2@latest RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} - ENTRYPOINT [ "/bin/bash" ] From 3608890fcebbd79fa34597e94fed6cc4b00c8523 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 13 May 2024 15:22:41 +0530 Subject: [PATCH 05/26] another try 2 --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index 7779033ab..278670553 100644 --- a/make/test.mk +++ b/make/test.mk @@ -182,9 +182,9 @@ endif .PHONY: check-go-junit-report check-go-junit-report: + go env @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } @echo "go-junit-report version:" && go-junit-report -version - go env .PHONY: generate-report generate-report: From cfc77debe5b6566c2665ea57e38a9cd9514f0665 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 13 May 2024 16:49:42 +0530 Subject: [PATCH 06/26] add another path --- openshift-ci/Dockerfile.tools | 1 + 1 file changed, 1 insertion(+) diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 70da32a84..886474ed2 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -31,6 +31,7 @@ WORKDIR /tmp # download, verify and install golang ENV PATH=$PATH:/usr/local/go/bin +ENV PATH=$PATH:/go/bin RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ From ba52cf0efe1ec73f94805a04cc02f23d63c803b9 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 13 May 2024 18:35:31 +0530 Subject: [PATCH 07/26] changed the base image --- openshift-ci/Dockerfile.tool | 48 ++++++++++++++++++++++++++++++++++ openshift-ci/Dockerfile.tools | 49 ++++------------------------------- 2 files changed, 53 insertions(+), 44 deletions(-) create mode 100644 openshift-ci/Dockerfile.tool diff --git a/openshift-ci/Dockerfile.tool b/openshift-ci/Dockerfile.tool new file mode 100644 index 000000000..886474ed2 --- /dev/null +++ b/openshift-ci/Dockerfile.tool @@ -0,0 +1,48 @@ +FROM registry.access.redhat.com/ubi8/ubi:latest as build-tools + +LABEL maintainer "Devtools " +LABEL author "Devtools " + +ENV LANG=en_US.utf8 \ + GOPATH=/tmp/go \ + GOCACHE=/tmp/.cache \ + PATH=$PATH:$GOPATH/bin \ + GIT_COMMITTER_NAME=devtools \ + GIT_COMMITTER_EMAIL=devtools@redhat.com \ + GOLANG_VERSION=go1.20.11 \ + GOLANG_SHA256=ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe + +ARG GO_PACKAGE_PATH=github.com/codeready-toolchain/toolchain-e2e + +RUN yum install -y \ + findutils \ + git \ + make \ + procps-ng \ + tar \ + wget \ + which \ + bc \ + jq \ + gcc \ + && yum clean all + +WORKDIR /tmp + +# download, verify and install golang +ENV PATH=$PATH:/usr/local/go/bin +ENV PATH=$PATH:/go/bin +RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ + && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ + && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ + && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && go version \ + && go install github.com/jstemmer/go-junit-report/v2@latest + +RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ + +WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} + +ENTRYPOINT [ "/bin/bash" ] diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 886474ed2..9421b96b0 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -1,48 +1,9 @@ -FROM registry.access.redhat.com/ubi8/ubi:latest as build-tools +FROM registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1713833129 -LABEL maintainer "Devtools " -LABEL author "Devtools " +ARG GO_PACKAGE_PATH=/github.com/codeready-toolchain/toolchain-e2e -ENV LANG=en_US.utf8 \ - GOPATH=/tmp/go \ - GOCACHE=/tmp/.cache \ - PATH=$PATH:$GOPATH/bin \ - GIT_COMMITTER_NAME=devtools \ - GIT_COMMITTER_EMAIL=devtools@redhat.com \ - GOLANG_VERSION=go1.20.11 \ - GOLANG_SHA256=ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe +RUN go install github.com/jstemmer/go-junit-report/v2@latest -ARG GO_PACKAGE_PATH=github.com/codeready-toolchain/toolchain-e2e +WORKDIR ${GO_PACKAGE_PATH} -RUN yum install -y \ - findutils \ - git \ - make \ - procps-ng \ - tar \ - wget \ - which \ - bc \ - jq \ - gcc \ - && yum clean all - -WORKDIR /tmp - -# download, verify and install golang -ENV PATH=$PATH:/usr/local/go/bin -ENV PATH=$PATH:/go/bin -RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ - && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ - && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ - && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && go version \ - && go install github.com/jstemmer/go-junit-report/v2@latest - -RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ - -WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} - -ENTRYPOINT [ "/bin/bash" ] +ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file From 54d88be4a15835c8ea34e6063d8de9dc682aea69 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 15 May 2024 14:15:20 +0530 Subject: [PATCH 08/26] another try with path --- openshift-ci/Dockerfile.tool | 48 -------------------------------- openshift-ci/Dockerfile.tools | 52 ++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 52 deletions(-) delete mode 100644 openshift-ci/Dockerfile.tool diff --git a/openshift-ci/Dockerfile.tool b/openshift-ci/Dockerfile.tool deleted file mode 100644 index 886474ed2..000000000 --- a/openshift-ci/Dockerfile.tool +++ /dev/null @@ -1,48 +0,0 @@ -FROM registry.access.redhat.com/ubi8/ubi:latest as build-tools - -LABEL maintainer "Devtools " -LABEL author "Devtools " - -ENV LANG=en_US.utf8 \ - GOPATH=/tmp/go \ - GOCACHE=/tmp/.cache \ - PATH=$PATH:$GOPATH/bin \ - GIT_COMMITTER_NAME=devtools \ - GIT_COMMITTER_EMAIL=devtools@redhat.com \ - GOLANG_VERSION=go1.20.11 \ - GOLANG_SHA256=ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe - -ARG GO_PACKAGE_PATH=github.com/codeready-toolchain/toolchain-e2e - -RUN yum install -y \ - findutils \ - git \ - make \ - procps-ng \ - tar \ - wget \ - which \ - bc \ - jq \ - gcc \ - && yum clean all - -WORKDIR /tmp - -# download, verify and install golang -ENV PATH=$PATH:/usr/local/go/bin -ENV PATH=$PATH:/go/bin -RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ - && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ - && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ - && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && go version \ - && go install github.com/jstemmer/go-junit-report/v2@latest - -RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ - -WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} - -ENTRYPOINT [ "/bin/bash" ] diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 9421b96b0..7449f5087 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -1,9 +1,53 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1713833129 +FROM registry.access.redhat.com/ubi8/ubi:latest as build-tools -ARG GO_PACKAGE_PATH=/github.com/codeready-toolchain/toolchain-e2e +LABEL maintainer "Devtools " +LABEL author "Devtools " +ENV LANG=en_US.utf8 \ + GOPATH=/tmp/go \ + GOCACHE=/tmp/.cache \ + PATH=$PATH:$GOPATH/bin \ + GIT_COMMITTER_NAME=devtools \ + GIT_COMMITTER_EMAIL=devtools@redhat.com \ + GOLANG_VERSION=go1.20.11 \ + GOLANG_SHA256=ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe + +ARG GO_PACKAGE_PATH=github.com/codeready-toolchain/toolchain-e2e + +RUN yum install -y \ + findutils \ + git \ + make \ + procps-ng \ + tar \ + wget \ + which \ + bc \ + jq \ + gcc \ + && yum clean all + +WORKDIR /tmp + +# download, verify and install golang +ENV PATH=$PATH:/usr/local/go/bin +ENV PATH=$PATH:/go/bin +RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ + && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ + && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ + && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && go version + +RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ + +# Install the go-junit-report package RUN go install github.com/jstemmer/go-junit-report/v2@latest -WORKDIR ${GO_PACKAGE_PATH} +# Ensure the installed Go package is in the PATH +ENV PATH=$PATH:$GOPATH/bin + +WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} -ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file +ENTRYPOINT [ "/bin/bash" ] From 66d7085732abaea9554fd04b5d87463d7c7abfac Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 15 May 2024 15:17:15 +0530 Subject: [PATCH 09/26] try again with different base --- openshift-ci/Dockerfile.tools | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 7449f5087..0cc240b3b 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi:latest as build-tools +FROM registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1713833129 as build-tools LABEL maintainer "Devtools " LABEL author "Devtools " @@ -8,12 +8,13 @@ ENV LANG=en_US.utf8 \ GOCACHE=/tmp/.cache \ PATH=$PATH:$GOPATH/bin \ GIT_COMMITTER_NAME=devtools \ - GIT_COMMITTER_EMAIL=devtools@redhat.com \ - GOLANG_VERSION=go1.20.11 \ - GOLANG_SHA256=ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe + GIT_COMMITTER_EMAIL=devtools@redhat.com ARG GO_PACKAGE_PATH=github.com/codeready-toolchain/toolchain-e2e +# Switch to root user to install packages +USER root + RUN yum install -y \ findutils \ git \ @@ -27,18 +28,10 @@ RUN yum install -y \ gcc \ && yum clean all -WORKDIR /tmp +# Switch back to the default user +USER 1001 -# download, verify and install golang -ENV PATH=$PATH:/usr/local/go/bin -ENV PATH=$PATH:/go/bin -RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ - && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ - && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ - && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ - && go version +WORKDIR /tmp RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ @@ -48,6 +41,9 @@ RUN go install github.com/jstemmer/go-junit-report/v2@latest # Ensure the installed Go package is in the PATH ENV PATH=$PATH:$GOPATH/bin +# Verify the installation +RUN go-junit-report --version + WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} ENTRYPOINT [ "/bin/bash" ] From 5e782531fe6c8be2c16bc3e77b83e5c88f90bc94 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 15 May 2024 17:49:03 +0530 Subject: [PATCH 10/26] Update make/test.mk Co-authored-by: Francisc Munteanu --- make/test.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/make/test.mk b/make/test.mk index 278670553..10379e80a 100644 --- a/make/test.mk +++ b/make/test.mk @@ -191,6 +191,7 @@ generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} + PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report Generation Successful" else From c6b614550ab89096614e13748326a3cec73086fe Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 15 May 2024 17:56:15 +0530 Subject: [PATCH 11/26] added path --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index 10379e80a..39c8d8a43 100644 --- a/make/test.mk +++ b/make/test.mk @@ -182,7 +182,7 @@ endif .PHONY: check-go-junit-report check-go-junit-report: - go env + PATH=${PATH}:$(go env GOPATH)/bin @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } @echo "go-junit-report version:" && go-junit-report -version From 38e2527712110b89179eb9c29b6b4739d37f40b1 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Thu, 16 May 2024 16:00:29 +0530 Subject: [PATCH 12/26] Update make/test.mk Co-authored-by: Francisc Munteanu --- make/test.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/make/test.mk b/make/test.mk index 39c8d8a43..032c075ef 100644 --- a/make/test.mk +++ b/make/test.mk @@ -191,8 +191,7 @@ generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - PATH=${PATH}:$(go env GOPATH)/bin - go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} + PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report Generation Successful" else @echo "Skipping Report as its a local run" From 1261cef2c0e7c2c7de26bb8992dd1ecda9117bdc Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Thu, 16 May 2024 16:01:17 +0530 Subject: [PATCH 13/26] Update test.mk --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index 032c075ef..b5ad2ecb3 100644 --- a/make/test.mk +++ b/make/test.mk @@ -182,7 +182,7 @@ endif .PHONY: check-go-junit-report check-go-junit-report: - PATH=${PATH}:$(go env GOPATH)/bin + PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } @echo "go-junit-report version:" && go-junit-report -version From c566e6c8e472f7cf891dc6357ad8b4bb63965340 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Thu, 16 May 2024 18:38:45 +0530 Subject: [PATCH 14/26] remove check go-junit-report --- make/test.mk | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/make/test.mk b/make/test.mk index b5ad2ecb3..a77b7b038 100644 --- a/make/test.mk +++ b/make/test.mk @@ -158,8 +158,6 @@ execute-tests: -oc get Space -n ${HOST_NS} @echo "Status of ToolchainStatus" -oc get ToolchainStatus -n ${HOST_NS} -o yaml - @echo "Check Reporting" - $(MAKE) check-go-junit-report @echo "Starting test $(shell date)" MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) @@ -179,12 +177,12 @@ else $(MAKE) print-local-debug-info HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} endif -.PHONY: check-go-junit-report +#.PHONY: check-go-junit-report -check-go-junit-report: - PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} - @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } - @echo "go-junit-report version:" && go-junit-report -version +# check-go-junit-report: +# PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} +# @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } +# @echo "go-junit-report version:" && go-junit-report -version .PHONY: generate-report generate-report: From 395097d0e4c4454ff88a0c1e22d3b44e331ca5d5 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Thu, 16 May 2024 19:43:51 +0530 Subject: [PATCH 15/26] reinstall before trigger --- make/test.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/make/test.mk b/make/test.mk index a77b7b038..f0823c8f5 100644 --- a/make/test.mk +++ b/make/test.mk @@ -189,6 +189,7 @@ generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} + go install github.com/jstemmer/go-junit-report/v2@latest PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report Generation Successful" else From 8f42fb86a16861b5714f654fc999c8620a5093c2 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Tue, 21 May 2024 12:54:46 +0530 Subject: [PATCH 16/26] Update make/test.mk Co-authored-by: Francisc Munteanu --- make/test.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/test.mk b/make/test.mk index f0823c8f5..6ef5a3acb 100644 --- a/make/test.mk +++ b/make/test.mk @@ -189,8 +189,8 @@ generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - go install github.com/jstemmer/go-junit-report/v2@latest - PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} + GOBIN=$(PWD) go install github.com/jstemmer/go-junit-report/v2@latest + ./go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report Generation Successful" else @echo "Skipping Report as its a local run" From bd89da5691966778bf8631d9b0b4ee6b084c156f Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Tue, 21 May 2024 19:03:07 +0530 Subject: [PATCH 17/26] add metrics report --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index 022cb5a60..e2cd308da 100644 --- a/make/test.mk +++ b/make/test.mk @@ -155,7 +155,7 @@ e2e-run: .PHONY: e2e-run-metrics e2e-run-metrics: @echo "Running e2e metrics tests..." - $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/metrics" + $(MAKE) execute-tests MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} TESTS_TO_EXECUTE="./test/metrics" REPORT_NAME="xunit_e2e_metrics.xml" @echo "The e2e metrics tests successfully finished" .PHONY: execute-tests From b6edfad0a7720c23a7fee04c89b48d373de09fff Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 22 May 2024 13:11:21 +0530 Subject: [PATCH 18/26] tidy up --- make/test.mk | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/make/test.mk b/make/test.mk index e2cd308da..a58cb1fb0 100644 --- a/make/test.mk +++ b/make/test.mk @@ -165,6 +165,7 @@ execute-tests: @echo "Status of ToolchainStatus" -oc get ToolchainStatus -n ${HOST_NS} -o yaml @echo "Starting test $(shell date)" + $(MAKE) check-go-junit-report MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) @@ -183,21 +184,19 @@ else $(MAKE) print-local-debug-info HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} endif -#.PHONY: check-go-junit-report +.PHONY: check-go-junit-report -# check-go-junit-report: -# PATH=${PATH}:$(go env GOPATH)/bin go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} -# @command -v go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; go install github.com/jstemmer/go-junit-report/v2@latest; } -# @echo "go-junit-report version:" && go-junit-report -version +check-go-junit-report: + @command -v ./go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; GOBIN=$(PWD) go install github.com/jstemmer/go-junit-report/v2@latest; } + @echo "go-junit-report version:" && ./go-junit-report -version .PHONY: generate-report generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - GOBIN=$(PWD) go install github.com/jstemmer/go-junit-report/v2@latest ./go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} - @echo "xUnit Report Generation Successful" + @echo "xUnit Report ${REPORT_NAME} Generation Successful" else @echo "Skipping Report as its a local run" endif From a176b823762b53b12a6a4f31c39485924f556312 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 22 May 2024 15:58:43 +0530 Subject: [PATCH 19/26] Revert Dockerfile change --- openshift-ci/Dockerfile.tools | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/openshift-ci/Dockerfile.tools b/openshift-ci/Dockerfile.tools index 0cc240b3b..b5301aded 100644 --- a/openshift-ci/Dockerfile.tools +++ b/openshift-ci/Dockerfile.tools @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1713833129 as build-tools +FROM registry.access.redhat.com/ubi8/ubi:latest as build-tools LABEL maintainer "Devtools " LABEL author "Devtools " @@ -8,13 +8,12 @@ ENV LANG=en_US.utf8 \ GOCACHE=/tmp/.cache \ PATH=$PATH:$GOPATH/bin \ GIT_COMMITTER_NAME=devtools \ - GIT_COMMITTER_EMAIL=devtools@redhat.com + GIT_COMMITTER_EMAIL=devtools@redhat.com \ + GOLANG_VERSION=go1.20.11 \ + GOLANG_SHA256=ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe ARG GO_PACKAGE_PATH=github.com/codeready-toolchain/toolchain-e2e -# Switch to root user to install packages -USER root - RUN yum install -y \ findutils \ git \ @@ -28,21 +27,19 @@ RUN yum install -y \ gcc \ && yum clean all -# Switch back to the default user -USER 1001 - WORKDIR /tmp -RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ - -# Install the go-junit-report package -RUN go install github.com/jstemmer/go-junit-report/v2@latest - -# Ensure the installed Go package is in the PATH -ENV PATH=$PATH:$GOPATH/bin +# download, verify and install golang +ENV PATH=$PATH:/usr/local/go/bin +RUN curl -Lo ${GOLANG_VERSION}.linux-amd64.tar.gz https://dl.google.com/go/${GOLANG_VERSION}.linux-amd64.tar.gz \ + && echo "${GOLANG_SHA256} ${GOLANG_VERSION}.linux-amd64.tar.gz" > ${GOLANG_VERSION}.linux-amd64.sha256 \ + && sha256sum -c ${GOLANG_VERSION}.linux-amd64.sha256 \ + && tar xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && rm -f ${GOLANG_VERSION}.linux-amd64.tar.gz \ + && go version -# Verify the installation -RUN go-junit-report --version +RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH} From da34df6cec42be91e7bbebbc06107c12959692a8 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 19 Jun 2024 16:05:05 +0530 Subject: [PATCH 20/26] move the binary to /tmp --- make/test.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/make/test.mk b/make/test.mk index df1098966..866088df1 100644 --- a/make/test.mk +++ b/make/test.mk @@ -187,15 +187,15 @@ endif .PHONY: check-go-junit-report check-go-junit-report: - @command -v ./go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; GOBIN=$(PWD) go install github.com/jstemmer/go-junit-report/v2@latest; } - @echo "go-junit-report version:" && ./go-junit-report -version + @command -v /tmp/go-junit-report >/dev/null 2>&1 || { echo "go-junit-report is not installed. Installing..."; GOBIN=/tmp go install github.com/jstemmer/go-junit-report/v2@latest; } + @echo "go-junit-report version:" && /tmp/go-junit-report -version .PHONY: generate-report generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - ./go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} + ./tmp/go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report ${REPORT_NAME} Generation Successful" else @echo "Skipping Report as its a local run" From 40c634c5c9d7d726fd99120209357b8a42c782b9 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Wed, 19 Jun 2024 17:32:31 +0530 Subject: [PATCH 21/26] run only on openshift ci --- make/test.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/make/test.mk b/make/test.mk index 866088df1..797912cfd 100644 --- a/make/test.mk +++ b/make/test.mk @@ -165,7 +165,11 @@ execute-tests: @echo "Status of ToolchainStatus" -oc get ToolchainStatus -n ${HOST_NS} -o yaml @echo "Starting test $(shell date)" - $(MAKE) check-go-junit-report + ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) + $(MAKE) check-go-junit-report + else + @echo "Skipping Go Junit report check and install" + endif MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) @@ -195,7 +199,7 @@ generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - ./tmp/go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} + /tmp/go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report ${REPORT_NAME} Generation Successful" else @echo "Skipping Report as its a local run" From 9768327b55eddc892b52309ad83f31a2d41f18fd Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Thu, 20 Jun 2024 13:15:55 +0530 Subject: [PATCH 22/26] run only on openshift ci --- make/test.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/make/test.mk b/make/test.mk index 797912cfd..180fe0014 100644 --- a/make/test.mk +++ b/make/test.mk @@ -165,11 +165,11 @@ execute-tests: @echo "Status of ToolchainStatus" -oc get ToolchainStatus -n ${HOST_NS} -o yaml @echo "Starting test $(shell date)" - ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) - $(MAKE) check-go-junit-report - else - @echo "Skipping Go Junit report check and install" - endif +ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) + $(MAKE) check-go-junit-report +else + @echo "Skipping Go Junit report check and install" +endif MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) From 1ecbfe32ce4eaf15445c0fa0c183185c40d2b097 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Thu, 20 Jun 2024 15:38:02 +0530 Subject: [PATCH 23/26] Fix Pipe everyting --- make/test.mk | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/make/test.mk b/make/test.mk index 180fe0014..7ce33f8be 100644 --- a/make/test.mk +++ b/make/test.mk @@ -39,6 +39,7 @@ E2E_PARALLELISM=1 TESTS_RUN_FILTER_REGEXP ?= "" REPORT_PORTAL_DIR := rp_preproc/results +TEST_OUTPUT_FILE=test_output.log .PHONY: test-e2e ## Run the e2e tests @@ -170,7 +171,9 @@ ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) else @echo "Skipping Go Junit report check and install" endif - MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ + @echo "Running tests" + MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee test_output.log + $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) .PHONY: print-logs @@ -197,12 +200,12 @@ check-go-junit-report: .PHONY: generate-report generate-report: @echo "Generating report" -ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) - mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - /tmp/go-junit-report > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} +ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) + mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} + /tmp/go-junit-report < test_output.log > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report ${REPORT_NAME} Generation Successful" -else - @echo "Skipping Report as its a local run" +else + @echo "Skipping Report as it's a local run" endif .PHONY: deploy-e2e-local-and-print-local-debug From 0438d14dbdb4682a5546fc39d819f889d13c9438 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 24 Jun 2024 21:24:00 +0530 Subject: [PATCH 24/26] move test output to /tmp --- make/test.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/make/test.mk b/make/test.mk index 7ce33f8be..ccfe01e34 100644 --- a/make/test.mk +++ b/make/test.mk @@ -172,9 +172,9 @@ else @echo "Skipping Go Junit report check and install" endif @echo "Running tests" - MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee test_output.log - $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} || \ - ($(MAKE) print-logs HOST_NS=${HOST_NS} MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} && exit 1) + MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} \ + go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee test_output.log || ( $(MAKE) print-logs && exit 1 ) + $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} .PHONY: print-logs print-logs: @@ -202,7 +202,7 @@ generate-report: @echo "Generating report" ifneq ($(OPENSHIFT_BUILD_NAMESPACE),) mkdir -p ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR} - /tmp/go-junit-report < test_output.log > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} + /tmp/go-junit-report < /tmp/test_output.log > ${ARTIFACT_DIR}/${REPORT_PORTAL_DIR}/${REPORT_NAME} @echo "xUnit Report ${REPORT_NAME} Generation Successful" else @echo "Skipping Report as it's a local run" From 0519d8ed6186352084d01df5f15301a08456f711 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Mon, 24 Jun 2024 23:29:37 +0530 Subject: [PATCH 25/26] move test output to /tmp 2 --- make/test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/test.mk b/make/test.mk index ccfe01e34..5e564b72e 100644 --- a/make/test.mk +++ b/make/test.mk @@ -173,7 +173,7 @@ else endif @echo "Running tests" MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} \ - go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee test_output.log || ( $(MAKE) print-logs && exit 1 ) + go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee /tmp/test_output.log || ( $(MAKE) print-logs && exit 1 ) $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} .PHONY: print-logs From 873239820c2e1968fcb2313f75ef6b6f62ae5000 Mon Sep 17 00:00:00 2001 From: Meer Sawood Date: Tue, 25 Jun 2024 16:00:39 +0530 Subject: [PATCH 26/26] generate rp if failed --- make/test.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/make/test.mk b/make/test.mk index 5e564b72e..773e84051 100644 --- a/make/test.mk +++ b/make/test.mk @@ -173,9 +173,10 @@ else endif @echo "Running tests" MEMBER_NS=${MEMBER_NS} MEMBER_NS_2=${MEMBER_NS_2} HOST_NS=${HOST_NS} REGISTRATION_SERVICE_NS=${REGISTRATION_SERVICE_NS} \ - go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee /tmp/test_output.log || ( $(MAKE) print-logs && exit 1 ) - $(MAKE) generate-report REPORT_NAME=${REPORT_NAME} - + go test ${TESTS_TO_EXECUTE} -run ${TESTS_RUN_FILTER_REGEXP} -p 1 -parallel ${E2E_PARALLELISM} -v -timeout=90m -failfast 2>&1 | tee /tmp/test_output.log; \ + STATUS=$$?; \ + $(MAKE) generate-report REPORT_NAME=${REPORT_NAME}; \ + if [ $$STATUS -ne 0 ]; then $(MAKE) print-logs && exit 1; fi .PHONY: print-logs print-logs: @echo "Time: $(shell date)"