-
Notifications
You must be signed in to change notification settings - Fork 79
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
Merged
rsoaresd
merged 24 commits into
codeready-toolchain:master
from
rsoaresd:refactor_pairing_with_ui
Dec 9, 2025
Merged
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
330c59d
refactor ui pairing
rsoaresd dcda29c
improvements
rsoaresd dd1c0cb
clean
rsoaresd 9869090
clean
rsoaresd 24bfd6b
improve
rsoaresd 84bd98d
improve docs
rsoaresd 0713865
requested changes
rsoaresd 3d17596
publish-sandbox-ui-for-ui-e2e-tests
rsoaresd 045255e
improve
rsoaresd d1f5203
clean
rsoaresd 8fffe3e
revert renaming
rsoaresd 81cf5bf
improve
rsoaresd 5d73eef
revert
rsoaresd 0727b06
fix
rsoaresd 64095ac
rename
rsoaresd 14739a8
revert
rsoaresd 663201f
requested changes
rsoaresd f578e1d
improve
rsoaresd 3fc927d
improvements
rsoaresd 191c04a
requested changes
rsoaresd 7c92dfd
requested changes
rsoaresd c9c25f6
improvements
rsoaresd 9fb93fa
improvement
rsoaresd 9c124d8
requested changes
rsoaresd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| DEVSANDBOX_DASHBOARD_NS := devsandbox-dashboard | ||
| PLATFORM ?= linux/amd64 | ||
| 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 | ||
|
|
||
| PUBLISH_UI ?= false | ||
| DEPLOY_UI ?= true | ||
|
|
||
| .PHONY: get-and-publish-devsandbox-dashboard | ||
| get-and-publish-devsandbox-dashboard: | ||
| ifneq (${UI_REPO_PATH},"") | ||
| ifneq (${UI_REPO_PATH},) | ||
| $(eval UI_REPO_PATH_PARAM = -ur ${UI_REPO_PATH}) | ||
| endif | ||
| endif | ||
| ifneq (${FORCED_TAG},"") | ||
| ifneq (${FORCED_TAG},) | ||
| $(eval FORCED_TAG_PARAM = -ft ${FORCED_TAG}) | ||
| endif | ||
| endif | ||
| @echo "Publishing and installing the Developer Sandbox Dashboard" | ||
| OPENID_SECRET_NAME=${OPENID_SECRET_NAME} DEVSANDBOX_DASHBOARD_NS=${DEVSANDBOX_DASHBOARD_NS}\ | ||
| 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} | ||
|
|
||
| .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 | ||
|
|
||
| @echo "Running Developer Sandbox Dashboard setup e2e tests..." | ||
| DEVSANDBOX_DASHBOARD_NS=${DEVSANDBOX_DASHBOARD_NS} go test "./test/e2e/devsandbox-dashboard/setup" -v -timeout=10m -failfast | ||
|
|
||
| @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/devsandbox-dashboard/ui-e2e-tests/.env > testsupport/devsandbox-dashboard/.env | ||
| go test "./test/e2e/devsandbox-dashboard" -v -timeout=10m -failfast | ||
| @oc delete usersignup $(SSO_USERNAME_READ) -n $(HOST_NS) | ||
|
|
||
| @echo "The Developer Sandbox Dashboard e2e tests successfully finished" | ||
|
|
||
| .PHONY: test-ui-e2e | ||
|
rsoaresd marked this conversation as resolved.
Outdated
|
||
| test-ui-e2e: | ||
| $(MAKE) get-and-publish-devsandbox-dashboard e2e-run-devsandbox-dashboard ENVIRONMENT=${UI_ENVIRONMENT} | ||
|
|
||
| .PHONY: test-ui-e2e-local | ||
| test-ui-e2e-local: | ||
| $(MAKE) get-and-publish-devsandbox-dashboard e2e-run-devsandbox-dashboard UI_REPO_PATH=${PWD}/../devsandbox-dashboard ENVIRONMENT=${UI_ENVIRONMENT} PUBLISH_UI=true DEPLOY_UI=true | ||
|
|
||
| .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} | ||
|
|
||
|
|
||
| UNIT_TEST_IMAGE_NAME=devsandbox-dashboard-e2e-tests | ||
| UNIT_TEST_DOCKERFILE=build/devsandbox-dashboard/Dockerfile | ||
|
|
||
| # Build Developer Sandbox Dashboard e2e tests image using podman | ||
| .PHONY: build-devsandbox-dashboard-e2e-tests | ||
| build-devsandbox-dashboard-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 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 \ | ||
| -v $(KUBECONFIG):/root/.kube/config \ | ||
| -e KUBECONFIG=/root/.kube/config \ | ||
| -v ${PWD}:/root/toolchain-e2e \ | ||
| -e E2E_REPO_PATH=/root/toolchain-e2e \ | ||
| $(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 RUNNING_IN_CONTAINER=true \ | ||
| -e DEPLOY_UI=true \ | ||
| -e PUBLISH_UI=false \ | ||
| -e OPENID_SECRET_NAME=$(OPENID_SECRET_NAME) \ | ||
| -e DEVSANDBOX_DASHBOARD_NS=$(DEVSANDBOX_DASHBOARD_NS) \ | ||
| $(UNIT_TEST_IMAGE_NAME) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.