-
Notifications
You must be signed in to change notification settings - Fork 80
test: refactor pairing with UI code #1227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
330c59d
dcda29c
dd1c0cb
9869090
24bfd6b
84bd98d
0713865
3d17596
045255e
d1f5203
8fffe3e
81cf5bf
5d73eef
0727b06
64095ac
14739a8
663201f
f578e1d
3fc927d
191c04a
7c92dfd
c9c25f6
9fb93fa
9c124d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,235 +1,95 @@ | ||||||
| SANDBOX_UI_NS := sandbox-ui | ||||||
| SANDBOX_PLUGIN_IMAGE_NAME := sandbox-rhdh-plugin | ||||||
| TAG := latest | ||||||
| PLATFORM ?= linux/amd64 | ||||||
| RHDH_PLUGINS_TMP ?= $(TMPDIR)rhdh-plugins | ||||||
| AUTH_FILE := /tmp/auth.json | ||||||
| OPENID_SECRET_NAME=openid-sandbox-public-client-secret | ||||||
| PUSH_SANDBOX_IMAGE ?= false | ||||||
| DEVSANDBOX_DASHBOARD_NS := devsandbox-dashboard | ||||||
| IMAGE_PLATFORM ?= linux/amd64 | ||||||
| KUBECONFIG ?= $(HOME)/.kube/config | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious - why do we need to set the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh nvm, now I saw it's because you were using it here and about to remove it I guess ..
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be used on |
||||||
| OPENID_SECRET_NAME := openid-sandbox-public-client-secret | ||||||
| UI_ENVIRONMENT := ui-e2e-tests | ||||||
| SSO_USERNAME_READ := $(shell if [ -n "$(CI)" ]; then cat /usr/local/sandbox-secrets/SSO_USERNAME 2>/dev/null || echo ""; else echo "${SSO_USERNAME}"; fi) | ||||||
| SSO_PASSWORD_READ := $(shell if [ -n "$(CI)" ]; then cat /usr/local/sandbox-secrets/SSO_PASSWORD 2>/dev/null || echo ""; else echo "${SSO_PASSWORD}"; fi) | ||||||
|
|
||||||
| QUAY_NAMESPACE ?= codeready-toolchain-test | ||||||
|
rsoaresd marked this conversation as resolved.
Outdated
|
||||||
| IMAGE_NAME_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE)/sandbox-rhdh-plugin | ||||||
|
|
||||||
| IMAGE_TO_PUSH_IN_QUAY := $(shell \ | ||||||
| if [ -n "$(CI)$(CLONEREFS_OPTIONS)" ]; then \ | ||||||
| if [ -n "$(GITHUB_ACTIONS)" ]; then \ | ||||||
| REPOSITORY_NAME=$$(basename "$(GITHUB_REPOSITORY)"); \ | ||||||
| COMMIT_ID_SUFFIX=$$(echo "$(PULL_PULL_SHA)" | cut -c1-7); \ | ||||||
| echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY):from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \ | ||||||
| else \ | ||||||
| : "if REPO_NAME is not set, it means that the E2E tests were triggered by periodic CI job"; \ | ||||||
| if [ -z "$(REPO_NAME)" ]; then \ | ||||||
| echo "quay.io/codeready-toolchain/sandbox-rhdh-plugin:latest"; \ | ||||||
| else \ | ||||||
| AUTHOR=$$(jq -r '.refs[0].pulls[0].author' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]'); \ | ||||||
| PULL_PULL_SHA=$${PULL_PULL_SHA:-$$(jq -r '.refs[0].pulls[0].sha' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]')}; \ | ||||||
| COMMIT_ID_SUFFIX=$$(echo "$${PULL_PULL_SHA}" | cut -c1-7); \ | ||||||
| echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY):from.$$(echo $(REPO_NAME) | sed 's/\"//g').PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \ | ||||||
| fi; \ | ||||||
| fi; \ | ||||||
| else \ | ||||||
| echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY):latest"; \ | ||||||
| fi) | ||||||
| PUBLISH_UI ?= false | ||||||
| DEPLOY_UI ?= true | ||||||
|
|
||||||
|
|
||||||
| .PHONY: deploy-sandbox-ui | ||||||
| deploy-sandbox-ui: HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1) | ||||||
| deploy-sandbox-ui: REGISTRATION_SERVICE_API=https://$(shell oc get route registration-service -n ${HOST_NS} -o custom-columns=":spec.host" | tr -d '\n')/api/v1 | ||||||
| deploy-sandbox-ui: HOST_OPERATOR_API=https://$(shell oc get route api -n ${HOST_NS} -o custom-columns=":spec.host" | tr -d '\n') | ||||||
| deploy-sandbox-ui: RHDH=https://rhdh-${SANDBOX_UI_NS}.$(shell oc get ingress.config.openshift.io/cluster -o jsonpath='{.spec.domain}') | ||||||
| deploy-sandbox-ui: | ||||||
| $(MAKE) check-sso-credentials | ||||||
| @echo "sandbox ui will be deployed in '${SANDBOX_UI_NS}' namespace" | ||||||
| $(MAKE) create-namespace SANDBOX_UI_NS=${SANDBOX_UI_NS} | ||||||
| ifeq ($(PUSH_SANDBOX_IMAGE),true) | ||||||
| $(MAKE) push-sandbox-plugin | ||||||
| endif | ||||||
| oc kustomize deploy/sandbox-ui/ui-e2e-tests | REGISTRATION_SERVICE_API=${REGISTRATION_SERVICE_API} \ | ||||||
| HOST_OPERATOR_API=${HOST_OPERATOR_API} \ | ||||||
| SANDBOX_UI_NS=${SANDBOX_UI_NS} \ | ||||||
| SANDBOX_PLUGIN_IMAGE=${IMAGE_TO_PUSH_IN_QUAY} \ | ||||||
| RHDH=${RHDH} envsubst | oc apply -f - | ||||||
| $(MAKE) configure-oauth-idp | ||||||
| ifeq ($(ENVIRONMENT),ui-e2e-tests) | ||||||
| @echo "applying toolchainconfig changes" | ||||||
| @echo "HOST_NS: ${HOST_NS}" | ||||||
| @oc apply -f deploy/host-operator/ui-e2e-tests/toolchainconfig.yaml -n ${HOST_NS} | ||||||
| @echo "restarting registration-service to apply toolchainconfig changes" | ||||||
| @oc -n ${HOST_NS} rollout restart deploy/registration-service | ||||||
| else | ||||||
| @echo "skipping toolchainconfig changes - environment is not ui-e2e-tests" | ||||||
| endif | ||||||
| @oc -n ${SANDBOX_UI_NS} rollout status deploy/rhdh | ||||||
| @echo "Developer Sandbox UI running at ${RHDH}" | ||||||
|
|
||||||
|
|
||||||
| check-sso-credentials: | ||||||
| @echo "checking SSO credentials..." | ||||||
| @if [ -z "$(SSO_USERNAME_READ)" ] || [ -z "$(SSO_PASSWORD_READ)" ]; then \ | ||||||
| if [ -n "$(CI)" ]; then \ | ||||||
| echo "SSO credential files not found or empty in CI environment"; \ | ||||||
| else \ | ||||||
| echo "SSO_USERNAME or SSO_PASSWORD environment variables not set"; \ | ||||||
| fi; \ | ||||||
| exit 1; \ | ||||||
| fi | ||||||
| @echo "Validating SSO credentials..." | ||||||
| @status=$$(curl -s -o /dev/null -w "%{http_code}" \ | ||||||
| -X POST "https://sso.devsandbox.dev/auth/realms/sandbox-dev/protocol/openid-connect/token" \ | ||||||
| -d "grant_type=password" \ | ||||||
| -d "client_id=sandbox-public" \ | ||||||
| -d "username=$(SSO_USERNAME_READ)" \ | ||||||
| -d "password=$(SSO_PASSWORD_READ)"); \ | ||||||
| if [ "$$status" != "200" ]; then \ | ||||||
| echo "failed trying to login to 'https://sso.devsandbox.dev/auth/realms/sandbox-dev' ($$status) — check your SSO credentials."; \ | ||||||
| exit 1; \ | ||||||
| fi | ||||||
| @echo "SSO credentials validated successfully" | ||||||
|
|
||||||
| configure-oauth-idp: | ||||||
| @echo "configuring DevSandbox identity provider" | ||||||
| @oc create secret generic ${OPENID_SECRET_NAME} \ | ||||||
| --from-literal=clientSecret=dummy \ | ||||||
| --namespace=openshift-config | ||||||
| OPENID_SECRET_NAME=${OPENID_SECRET_NAME} envsubst < deploy/sandbox-ui/ui-e2e-tests/oauth-idp-patch.yaml | \ | ||||||
| oc patch oauths.config.openshift.io/cluster --type=merge --patch-file=/dev/stdin | ||||||
|
|
||||||
| create-namespace: | ||||||
| @if ! oc get project ${SANDBOX_UI_NS} >/dev/null 2>&1; then \ | ||||||
| echo "Creating namespace ${SANDBOX_UI_NS}"; \ | ||||||
| oc new-project ${SANDBOX_UI_NS} >/dev/null 2>&1 || true; \ | ||||||
| else \ | ||||||
| echo "Namespace ${SANDBOX_UI_NS} already exists"; \ | ||||||
| fi | ||||||
| @oc project ${SANDBOX_UI_NS} >/dev/null 2>&1 | ||||||
|
|
||||||
|
|
||||||
| .PHONY: get-rhdh-plugins | ||||||
| get-rhdh-plugins: | ||||||
| ifeq ($(strip $(RHDH_PLUGINS_TMP)), $(TMPDIR)rhdh-plugins) | ||||||
| ifeq ($(GITHUB_ACTIONS),true) | ||||||
| @echo "using author ${AUTHOR}" | ||||||
| $(eval AUTHOR_LINK = https://github.com/${AUTHOR}) | ||||||
| @echo "detected branch ${BRANCH_NAME}" | ||||||
| # check if a branch with the same ref exists in the user's fork of rhdh-plugins repo | ||||||
| @echo "branches of ${AUTHOR_LINK}/rhdh-plugins - checking if there is a branch ${BRANCH_NAME} we could pair with." | ||||||
| curl ${AUTHOR_LINK}/rhdh-plugins.git/info/refs?service=git-upload-pack --output - | ||||||
| $(eval REMOTE_RHDH_PLUGINS_BRANCH := $(shell curl ${AUTHOR_LINK}/rhdh-plugins.git/info/refs?service=git-upload-pack --output - 2>/dev/null | grep -a "refs/heads/${BRANCH_NAME}$$" | awk '{print $$2}')) | ||||||
|
|
||||||
| # check if the branch with the same name exists, if so then merge it with master and use the merge branch, if not then use master | ||||||
| @echo "REMOTE_RHDH_PLUGINS_BRANCH: ${REMOTE_RHDH_PLUGINS_BRANCH}" | ||||||
| @$(MAKE) pair-if-needed REMOTE_RHDH_PLUGINS_BRANCH=${REMOTE_RHDH_PLUGINS_BRANCH} AUTHOR_LINK=${AUTHOR_LINK} | ||||||
| else | ||||||
| @echo "using rhdh-plugins repo from master" | ||||||
| @$(MAKE) clone-rhdh-plugins | ||||||
| .PHONY: get-and-publish-devsandbox-dashboard | ||||||
| get-and-publish-devsandbox-dashboard: | ||||||
| ifneq (${UI_REPO_PATH},) | ||||||
| $(eval UI_REPO_PATH_PARAM = -ur ${UI_REPO_PATH}) | ||||||
| endif | ||||||
| else | ||||||
| @echo "using local rhdh-plugins repo, no pairing needed: ${RHDH_PLUGINS_TMP}" | ||||||
| ifneq (${FORCED_TAG},) | ||||||
| $(eval FORCED_TAG_PARAM = -ft ${FORCED_TAG}) | ||||||
| endif | ||||||
| @echo "Publishing and installing the Developer Sandbox Dashboard" | ||||||
| scripts/ci/manage-devsandbox-dashboard.sh -pp ${PUBLISH_UI} ${UI_REPO_PATH_PARAM} -ds ${DATE_SUFFIX} -qn ${QUAY_NAMESPACE} ${FORCED_TAG_PARAM} -du ${DEPLOY_UI} -ns ${DEVSANDBOX_DASHBOARD_NS} -os ${OPENID_SECRET_NAME} -en ${UI_ENVIRONMENT} | ||||||
|
|
||||||
| pair-if-needed: | ||||||
| ifneq ($(strip $(REMOTE_RHDH_PLUGINS_BRANCH)),) | ||||||
| @echo "Branch ref of the user's fork to be used for pairing: \"${REMOTE_RHDH_PLUGINS_BRANCH}\"" | ||||||
| git config --global user.email "devsandbox@redhat.com" | ||||||
| git config --global user.name "KubeSaw" | ||||||
| # clone | ||||||
| rm -rf ${RHDH_PLUGINS_TMP} | ||||||
| git clone --depth=1 https://github.com/redhat-developer/rhdh-plugins.git ${RHDH_PLUGINS_TMP} | ||||||
| # add the user's fork as remote repo | ||||||
| git --git-dir=${RHDH_PLUGINS_TMP}/.git --work-tree=${RHDH_PLUGINS_TMP} remote add external ${AUTHOR_LINK}/rhdh-plugins.git | ||||||
| # fetch the branch | ||||||
| git --git-dir=${RHDH_PLUGINS_TMP}/.git --work-tree=${RHDH_PLUGINS_TMP} fetch external ${REMOTE_RHDH_PLUGINS_BRANCH} | ||||||
| # merge the branch with master | ||||||
| git --git-dir=${RHDH_PLUGINS_TMP}/.git --work-tree=${RHDH_PLUGINS_TMP} merge --ff-only FETCH_HEAD | ||||||
| else | ||||||
| @echo "no pairing needed, using rhdh-plugins repo from master" | ||||||
| @$(MAKE) clone-rhdh-plugins | ||||||
| endif | ||||||
|
|
||||||
| .PHONY: clone-rhdh-plugins | ||||||
| clone-rhdh-plugins: | ||||||
| rm -rf ${RHDH_PLUGINS_TMP}; \ | ||||||
| git clone --depth=1 https://github.com/redhat-developer/rhdh-plugins $(RHDH_PLUGINS_TMP) && \ | ||||||
| echo "cloned to $(RHDH_PLUGINS_TMP)" | ||||||
|
|
||||||
| .PHONY: push-sandbox-plugin | ||||||
| push-sandbox-plugin: | ||||||
| $(MAKE) get-rhdh-plugins | ||||||
| cd $(RHDH_PLUGINS_TMP)/workspaces/sandbox && \ | ||||||
| rm -rf plugins/sandbox/dist-dynamic && \ | ||||||
| rm -rf red-hat-developer-hub-backstage-plugin-sandbox && \ | ||||||
| yarn install && \ | ||||||
| npx @janus-idp/cli@3.3.1 package package-dynamic-plugins \ | ||||||
| --tag $(IMAGE_TO_PUSH_IN_QUAY) \ | ||||||
| --platform $(PLATFORM) && \ | ||||||
| podman push $(IMAGE_TO_PUSH_IN_QUAY) | ||||||
|
|
||||||
| .PHONY: clean-sandbox-ui | ||||||
| clean-sandbox-ui: HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1) | ||||||
| clean-sandbox-ui: | ||||||
| @oc delete ns ${SANDBOX_UI_NS} | ||||||
| @oc delete secret ${OPENID_SECRET_NAME} -n openshift-config | ||||||
| @oc delete usersignup ${SSO_USERNAME} -n ${HOST_NS} | ||||||
|
|
||||||
| .PHONY: e2e-run-sandbox-ui | ||||||
| e2e-run-sandbox-ui: HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1) | ||||||
| e2e-run-sandbox-ui: RHDH=https://rhdh-${SANDBOX_UI_NS}.$(shell oc get ingress.config.openshift.io/cluster -o jsonpath='{.spec.domain}') | ||||||
| e2e-run-sandbox-ui: | ||||||
| @echo "Installing Playwright..." | ||||||
| .PHONY: e2e-run-devsandbox-dashboard | ||||||
| e2e-run-devsandbox-dashboard: HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1) | ||||||
| e2e-run-devsandbox-dashboard: RHDH=https://rhdh-${DEVSANDBOX_DASHBOARD_NS}.$(shell oc get ingress.config.openshift.io/cluster -o jsonpath='{.spec.domain}') | ||||||
| e2e-run-devsandbox-dashboard: | ||||||
| $(eval PWGO_VER := $(shell grep -oE "playwright-go v\S+" go.mod | sed 's/playwright-go //g')) | ||||||
| @echo "Installing Playwright CLI version: $(PWGO_VER)" | ||||||
| go install github.com/playwright-community/playwright-go/cmd/playwright@$(PWGO_VER) | ||||||
| @echo "Installing Firefox browser for Playwright..." | ||||||
| $(GOPATH)/bin/playwright install firefox | ||||||
|
Comment on lines
33
to
35
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that it wasn't changed in this PR so take it as an suggestion for later improvement.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once we upgrade to Go 1.24 I think we will be able to use go tool and run it with: |
||||||
|
|
||||||
| @echo "Running Developer Sandbox UI setup e2e tests..." | ||||||
| SANDBOX_UI_NS=${SANDBOX_UI_NS} go test "./test/e2e/sandbox-ui/setup" -v -timeout=10m -failfast | ||||||
| @echo "Running Developer Sandbox Dashboard setup e2e tests..." | ||||||
| DEVSANDBOX_DASHBOARD_NS=${DEVSANDBOX_DASHBOARD_NS} go test "./test/e2e/sandbox-ui/setup" -v -timeout=10m -failfast | ||||||
|
|
||||||
| @echo "Running Developer Sandbox UI e2e tests in firefox..." | ||||||
| @echo "Running Developer Sandbox Dashboard e2e tests in firefox..." | ||||||
| @SSO_USERNAME=$(SSO_USERNAME_READ) SSO_PASSWORD=$(SSO_PASSWORD_READ) BASE_URL=${RHDH} BROWSER=firefox envsubst < deploy/sandbox-ui/ui-e2e-tests/.env > testsupport/sandbox-ui/.env | ||||||
| go test "./test/e2e/sandbox-ui" -v -timeout=10m -failfast | ||||||
| @oc delete usersignup $(SSO_USERNAME_READ) -n $(HOST_NS) | ||||||
|
|
||||||
| @echo "The Developer Sandbox UI e2e tests successfully finished" | ||||||
| @echo "The Developer Sandbox Dashboard e2e tests successfully finished" | ||||||
|
|
||||||
| .PHONY: test-devsandbox-dashboard-e2e | ||||||
| test-devsandbox-dashboard-e2e: get-and-publish-devsandbox-dashboard e2e-run-devsandbox-dashboard | ||||||
|
|
||||||
| .PHONY: test-ui-e2e | ||||||
| test-ui-e2e: | ||||||
| $(MAKE) deploy-sandbox-ui e2e-run-sandbox-ui ENVIRONMENT=${UI_ENVIRONMENT} | ||||||
| .PHONY: test-devsandbox-dashboard-e2e-local | ||||||
| test-devsandbox-dashboard-e2e-local: | ||||||
| $(MAKE) get-and-publish-devsandbox-dashboard e2e-run-devsandbox-dashboard UI_REPO_PATH=${PWD}/../devsandbox-dashboard PUBLISH_UI=true DEPLOY_UI=true | ||||||
|
|
||||||
| .PHONY: test-ui-e2e-local | ||||||
| test-ui-e2e-local: | ||||||
| $(MAKE) deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_TMP=${PWD}/../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT} PUSH_SANDBOX_IMAGE=true | ||||||
|
|
||||||
|
|
||||||
| UNIT_TEST_IMAGE_NAME=sandbox-ui-e2e-tests | ||||||
| UNIT_TEST_DOCKERFILE=build/sandbox-ui/Dockerfile | ||||||
| .PHONY: clean-devsandbox-dashboard | ||||||
| clean-devsandbox-dashboard: HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1) | ||||||
| clean-devsandbox-dashboard: | ||||||
| @oc delete ns ${DEVSANDBOX_DASHBOARD_NS} | ||||||
| @oc delete secret ${OPENID_SECRET_NAME} -n openshift-config | ||||||
| @oc delete usersignup ${SSO_USERNAME} -n ${HOST_NS} | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
|
|
||||||
| # Build Developer Sandbox UI e2e tests image using podman | ||||||
| .PHONY: build-sandbox-ui-e2e-tests | ||||||
| build-sandbox-ui-e2e-tests: | ||||||
| @echo "building the $(UNIT_TEST_IMAGE_NAME) image with podman..." | ||||||
| podman build --platform $(PLATFORM) -t $(UNIT_TEST_IMAGE_NAME) -f $(UNIT_TEST_DOCKERFILE) . | ||||||
|
|
||||||
| # Run Developer Sandbox UI e2e tests image using podman | ||||||
| .PHONY: test-sandbox-ui-in-container | ||||||
| test-sandbox-ui-in-container: build-sandbox-ui-e2e-tests | ||||||
| @echo "pushing Developer Sandbox UI image..." | ||||||
| $(MAKE) push-sandbox-plugin | ||||||
| E2E_TEST_IMAGE_NAME=devsandbox-dashboard-e2e-tests | ||||||
| E2E_TEST_DOCKERFILE=build/sandbox-ui/Dockerfile | ||||||
|
|
||||||
| # Build Developer Sandbox Dashboard e2e tests image using podman | ||||||
| .PHONY: build-devsandbox-dashboard-e2e-tests | ||||||
| build-devsandbox-dashboard-e2e-tests: | ||||||
| @echo "building the $(E2E_TEST_IMAGE_NAME) image with podman..." | ||||||
| podman build --platform $(IMAGE_PLATFORM) -t $(E2E_TEST_IMAGE_NAME) -f $(E2E_TEST_DOCKERFILE) . | ||||||
|
|
||||||
| # Run Developer Sandbox Dashboard e2e tests image using podman | ||||||
| .PHONY: test-devsandbox-dashboard-in-container | ||||||
| test-devsandbox-dashboard-in-container: build-devsandbox-dashboard-e2e-tests | ||||||
| ifneq ($(UI_REPO_PATH),) | ||||||
| $(eval FORCED_TAG := $(DATE_SUFFIX)) | ||||||
| $(eval ABS_UI_REPO_PATH := $(abspath $(UI_REPO_PATH))) | ||||||
| @echo "Generated FORCED_TAG: $(FORCED_TAG)" | ||||||
| @echo "Using UI_REPO_PATH: $(ABS_UI_REPO_PATH)" | ||||||
| @echo "pushing Developer Dashboard image..." | ||||||
| $(MAKE) get-and-publish-devsandbox-dashboard PUBLISH_UI=true DEPLOY_UI=false FORCED_TAG=$(FORCED_TAG) UI_REPO_PATH=$(UI_REPO_PATH) | ||||||
| else | ||||||
| @echo "Skipping Developer Sandbox Dashboard publish - UI_REPO_PATH not set" | ||||||
| endif | ||||||
| @echo "running the e2e tests in podman container..." | ||||||
| podman run --platform $(PLATFORM) --rm \ | ||||||
| podman run --platform $(IMAGE_PLATFORM) --rm \ | ||||||
| -v $(KUBECONFIG):/root/.kube/config \ | ||||||
|
rsoaresd marked this conversation as resolved.
|
||||||
| -e KUBECONFIG=/root/.kube/config \ | ||||||
| -v ${PWD}:/root/toolchain-e2e \ | ||||||
| -e E2E_REPO_PATH=/root/toolchain-e2e \ | ||||||
| -v $(RHDH_PLUGINS_TMP):/root/rhdh-plugins \ | ||||||
| -e RHDH_PLUGINS_TMP=/root/rhdh-plugins \ | ||||||
| $(if $(ABS_UI_REPO_PATH),-v $(ABS_UI_REPO_PATH):/root/devsandbox-dashboard -e UI_REPO_PATH=/root/devsandbox-dashboard) \ | ||||||
| $(if $(ABS_UI_REPO_PATH),-e FORCED_TAG=$(FORCED_TAG)) \ | ||||||
| -e SSO_USERNAME=$(SSO_USERNAME) \ | ||||||
| -e SSO_PASSWORD=$(SSO_PASSWORD) \ | ||||||
| -e QUAY_NAMESPACE=$(QUAY_NAMESPACE) \ | ||||||
| -e TMP=/tmp/ \ | ||||||
| -e RUNNING_IN_CONTAINER=true \ | ||||||
| $(UNIT_TEST_IMAGE_NAME) | ||||||
| -e DEPLOY_UI=true \ | ||||||
| -e PUBLISH_UI=false \ | ||||||
| $(E2E_TEST_IMAGE_NAME) make test-devsandbox-dashboard-e2e | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,9 +49,9 @@ ifeq ($(CI),true) | |
| # if we are running on CI, we want to run the ui e2e tests in the toolchain-e2e presubmit and periodic CI jobs | ||
| # if REPO_NAME is not set, it means that the e2e tests were triggered by the periodic CI job | ||
| ifeq ($(filter-out toolchain-e2e,$(REPO_NAME)),) | ||
| $(MAKE) test-ui-e2e | ||
| $(MAKE) test-devsandbox-dashboard-e2e | ||
| @echo "UI E2E tests successfully finished" | ||
| @echo "To clean the Developer Sandbox UI run 'make clean-sandbox-ui'" | ||
| @echo "To clean the Developer Sandbox Dashboard run 'make clean-devsandbox-dashboard'" | ||
| endif | ||
| endif | ||
|
|
||
|
|
@@ -294,7 +294,9 @@ deploy-single-member-e2e-latest: | |
|
|
||
| .PHONY: publish-current-bundles-for-e2e | ||
| ## Target that is supposed to be called from CI - it builds & publishes the current operator bundles | ||
| publish-current-bundles-for-e2e: get-and-publish-operators | ||
| publish-current-bundles-for-e2e: PUBLISH_UI=true | ||
| publish-current-bundles-for-e2e: DEPLOY_UI=false | ||
|
Comment on lines
+297
to
+298
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering, couldn't we use the same default values as we use for operators? - to keep it consistent
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I set them in |
||
| publish-current-bundles-for-e2e: get-and-publish-operators get-and-publish-devsandbox-dashboard | ||
|
|
||
| .PHONY: get-and-publish-operators | ||
| get-and-publish-operators: PUBLISH_OPERATOR=true | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also suggestion for later - can you move this
yum installsection more up before copying the folder so it uses the cached snapshots? With the current order it always installs the dependency for every run