Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
289d1ab
prepare enablement of ui e2e tests
Jul 29, 2025
5645463
format
Jul 29, 2025
181065c
add test requirements
Jul 29, 2025
e5e582d
redo
Jul 29, 2025
481e279
improvements
Jul 30, 2025
439bbf9
Revert "improvements"
Jul 30, 2025
2362c47
remove
Jul 30, 2025
f3349f5
improvements
Jul 30, 2025
ea95cae
improvements
Jul 30, 2025
aa9536a
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 1, 2025
e84b951
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 2, 2025
75fecdd
improvements
Sep 4, 2025
7228cc1
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 4, 2025
5a4cce6
fix
Sep 4, 2025
622a774
fix
rsoaresd Sep 4, 2025
beb7403
improvements
rsoaresd Sep 4, 2025
129654e
try
rsoaresd Sep 4, 2025
20494ca
fix
rsoaresd Sep 5, 2025
c6ab616
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 8, 2025
0f14ffc
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 8, 2025
a97cf54
Merge branch 'master' into enable_ui_e2e_tests
mfrancisc Sep 8, 2025
e16c223
requested changes
rsoaresd Sep 9, 2025
9760f20
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 9, 2025
29111a1
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 11, 2025
90ec11f
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 16, 2025
e6291ed
requested changes
rsoaresd Sep 16, 2025
e947f20
requested changes
rsoaresd Sep 17, 2025
2611cc7
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 17, 2025
e4a310b
add libX11-xcb to Dockerfile
rsoaresd Sep 17, 2025
589e2d6
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 18, 2025
058e278
update doc
rsoaresd Sep 18, 2025
66752ae
Merge branch 'master' into enable_ui_e2e_tests
rsoaresd Sep 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions build/sandbox-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ RUN yum install -y \
RUN curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash \
&& mv kustomize /usr/local/bin

# Install Node.js 22 and yarn
RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
yum install -y nodejs && \
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && \
yum install -y yarn && \
yum clean all

# Install oc CLI
RUN curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz && \
tar -xzvf openshift-client-linux.tar.gz -C /usr/local/bin oc && \
Expand Down
7 changes: 1 addition & 6 deletions deploy/host-operator/ui-e2e-tests/toolchainconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ spec:
devSpaces:
segmentWriteKey: "test devspaces segment write key"
segmentWriteKey: "test sandbox segment write key"
auth:
authClientConfigRaw: '{ "realm": "sandbox-dev", "auth-server-url": "https://sso.devsandbox.dev/auth", "ssl-required": "none", "resource": "sandbox-public", "clientId": "sandbox-public", "public-client": true }'
authClientLibraryURL: "https://sso.devsandbox.dev/auth/js/keycloak.js"
authClientPublicKeysURL: "https://sso.devsandbox.dev/auth/realms/sandbox-dev/protocol/openid-connect/certs"
ssoBaseURL: "https://sso.devsandbox.dev"
ssoRealm: sandbox-dev
# default auth in dev environment points to the devsandbox sso
environment: dev
# same number that is set in https://github.com/codeready-toolchain/host-operator/blob/master/deploy/registration-service/registration-service.yaml#L272-L273
replicas: 3
Expand Down
133 changes: 100 additions & 33 deletions make/sandbox-ui.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@ SANDBOX_UI_NS := sandbox-ui
SANDBOX_PLUGIN_IMAGE_NAME := sandbox-rhdh-plugin
TAG := latest
PLATFORM ?= linux/amd64
RHDH_PLUGINS_DIR ?= $(TMPDIR)rhdh-plugins
RHDH_PLUGINS_TMP ?= $(TMPDIR)rhdh-plugins
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix TMPDIR path join; current value can resolve to “/tmprhdh-plugins”.

Ensure a slash between TMPDIR and directory name and add a sane default for TMPDIR. Also update the equality check accordingly.

-RHDH_PLUGINS_TMP ?= $(TMPDIR)rhdh-plugins
+TMPDIR ?= /tmp
+RHDH_PLUGINS_TMP ?= $(TMPDIR)/rhdh-plugins
@@
-ifeq ($(strip $(RHDH_PLUGINS_TMP)), $(TMPDIR)rhdh-plugins)
+ifeq ($(strip $(RHDH_PLUGINS_TMP)), $(TMPDIR)/rhdh-plugins)

Also applies to: 112-113

🤖 Prompt for AI Agents
In make/sandbox-ui.mk around lines 5 (and also apply the same change at lines
112-113), TMPDIR is not given a safe default and is concatenated without a
separating slash causing paths like “/tmprhdh-plugins”; set a sane default (e.g.
TMPDIR ?= /tmp/) and change the plugin path to use a slash: RHDH_PLUGINS_TMP ?=
$(TMPDIR)/rhdh-plugins, then update any equality/comparison checks that
reference the old string to compare against $(TMPDIR)/rhdh-plugins (or use
shell-safe comparisons that include the trailing slash) so the path joins and
checks are correct.

AUTH_FILE := /tmp/auth.json
IMAGE_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE)/sandbox-rhdh-plugin:$(TAG)
OPENID_SECRET_NAME=openid-sandbox-public-client-secret
PUSH_SANDBOX_IMAGE ?= true
PUSH_SANDBOX_IMAGE ?= false
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)
Comment thread
coderabbitai[bot] marked this conversation as resolved.

TAG := $(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 "from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \
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 "from.$(REPO_NAME).PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \
fi; \
else \
echo "latest"; \
fi)
Comment on lines +13 to +27
Copy link
Copy Markdown
Contributor

@mfrancisc mfrancisc Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this correctly the tags will be something like : rhdh-plugins.199.123ed6 where:

  • rhdh-plugins is the name of the repo with the UI code
  • 199 is a pr number
  • 123ed6 is a short commit sha

I'm wondering if we really need to add all this information to the image tag or if just the short commit sha ( 7 chars ) would be enough ? In order to simplify a bit the code and the tag names. Also I'f I'm not mistaken there is a limit in the length of the tag which is 128 chars.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfrancisc thanks for all your suggestions!

If I understand this correctly the tags will be something like : rhdh-plugins.199.123ed6 where:

rhdh-plugins is the name of the repo with the UI code
199 is a pr number
123ed6 is a short commit sha

Yes, exactly!

I'm wondering if we really need to add all this information to the image tag or if just the short commit sha ( 7 chars )
would be enough ? In order to simplify a bit the code and the tag names. Also I'f I'm not mistaken there is a limit in the length of the tag which is 128 chars.

I used the same approach as we use for pushing host and member images.
I think we will not have any problem regarding the tag limit length. For example, in from.rhdh-plugins.PR1980.a1b2c3d we have only 32 chars.
I believe the format from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX} was implemented to ensure that we can identify the tag on our quay org and also to ensure we do not push the same tag (at least, from my understanding, and it was the intention that I reused the approach). But it is something that we can discuss with the team

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense! Thanks for your additional details. Let's keep it consistent with the other tags than I agree 👍


Comment thread
coderabbitai[bot] marked this conversation as resolved.

IMAGE_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE)/sandbox-rhdh-plugin:$(TAG)


.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}')
Expand All @@ -21,34 +43,46 @@ ifeq ($(PUSH_SANDBOX_IMAGE),true)
$(MAKE) push-sandbox-plugin
endif
kustomize build deploy/sandbox-ui/ui-e2e-tests | REGISTRATION_SERVICE_API=${REGISTRATION_SERVICE_API} \
HOST_NS=${HOST_NS} \
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 -
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" ] || [ -z "$$SSO_PASSWORD" ]; then \
echo "SSO_USERNAME or SSO_PASSWORD not set"; \
@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" \
-d "password=$$SSO_PASSWORD"); \
-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"
Expand All @@ -70,38 +104,73 @@ create-namespace:

.PHONY: get-rhdh-plugins
get-rhdh-plugins:
ifeq ($(strip $(RHDH_PLUGINS_DIR)), $(TMPDIR)rhdh-plugins)
echo "using rhdh-plugins repo from master"
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}'))
Comment on lines +114 to +115
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Unsafe curl output redirection may expose sensitive data.

Line 118 uses curl ... --output - which outputs the raw git protocol response to stdout. This could potentially expose sensitive repository information in CI logs.

-	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}'))
+	@echo "Checking for branch ${BRANCH_NAME} in ${AUTHOR_LINK}/rhdh-plugins..."
+	$(eval REMOTE_RHDH_PLUGINS_BRANCH := $(shell curl -s ${AUTHOR_LINK}/rhdh-plugins.git/info/refs?service=git-upload-pack 2>/dev/null | grep -a "refs/heads/${BRANCH_NAME}$$" | awk '{print $$2}'))
🤖 Prompt for AI Agents
In make/sandbox-ui.mk around lines 118-119 the curl invocation uses --output -
which writes the raw git-upload-pack info/refs response to stdout (exposing
sensitive repo data in CI logs); replace this with a safe call that suppresses
raw output (for example use curl --silent --show-error --fail or redirect stdout
to /dev/null) or, better, replace the curl approach with a non-verbose git
protocol command such as git ls-remote to fetch branch refs; ensure the command
returns only the branch ref value to the shell evaluation (no raw protocol on
stdout) and preserve existing grep/awk logic to set REMOTE_RHDH_PLUGINS_BRANCH.


# 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
endif
else
echo "using local rhdh-plugins repo: ${RHDH_PLUGINS_DIR}"
@echo "using local rhdh-plugins repo, no pairing needed: ${RHDH_PLUGINS_TMP}"
endif

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_DIR}; \
git clone https://github.com/redhat-developer/rhdh-plugins $(RHDH_PLUGINS_DIR) && \
echo "cloned to $(RHDH_PLUGINS_DIR)"
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_DIR)/workspaces/sandbox && \
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)
--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..."
Expand All @@ -112,24 +181,23 @@ e2e-run-sandbox-ui:
$(GOPATH)/bin/playwright install firefox

@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 -count=1
SANDBOX_UI_NS=${SANDBOX_UI_NS} go test "./test/e2e/sandbox-ui/setup" -v -timeout=10m -failfast

@echo "Running Developer Sandbox UI e2e tests in firefox..."
SSO_USERNAME=${SSO_USERNAME} SSO_PASSWORD=${SSO_PASSWORD} BASE_URL=${RHDH} BROWSER=firefox envsubst < deploy/sandbox-ui/ui-e2e-tests/.env > testsupport/sandbox-ui/.env
# NOTE: The "-count=1" is the idiomatic way of turning off the test result cache according to https://pkg.go.dev/cmd/go#hdr-Testing_flags.
go test "./test/e2e/sandbox-ui" -v -timeout=10m -failfast -count=1
@oc delete usersignup ${SSO_USERNAME} -n ${HOST_NS}
@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"


.PHONY: test-ui-e2e
test-ui-e2e:
$(MAKE) prepare-and-deploy-e2e deploy-sandbox-ui e2e-run-sandbox-ui ENVIRONMENT=${UI_ENVIRONMENT}
$(MAKE) deploy-sandbox-ui e2e-run-sandbox-ui ENVIRONMENT=${UI_ENVIRONMENT}

.PHONY: test-ui-e2e-local
test-ui-e2e-local:
$(MAKE) prepare-and-deploy-e2e deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_DIR=${PWD}/../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT}
$(MAKE) deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_TMP=${PWD}/../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT}


UNIT_TEST_IMAGE_NAME=sandbox-ui-e2e-tests
Expand All @@ -142,7 +210,7 @@ build-sandbox-ui-e2e-tests:
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
.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
Expand All @@ -152,12 +220,11 @@ test-sandbox-ui-in-container: build-sandbox-ui-e2e-tests
-e KUBECONFIG=/root/.kube/config \
-v ${PWD}:/root/toolchain-e2e \
-e E2E_REPO_PATH=/root/toolchain-e2e \
-v $(RHDH_PLUGINS_DIR):/root/rhdh-plugins \
-e RHDH_PLUGINS_DIR=/root/rhdh-plugins \
-v $(RHDH_PLUGINS_TMP):/root/rhdh-plugins \
-e RHDH_PLUGINS_TMP=/root/rhdh-plugins \
-e SSO_USERNAME=$(SSO_USERNAME) \
-e SSO_PASSWORD=$(SSO_PASSWORD) \
-e QUAY_NAMESPACE=$(QUAY_NAMESPACE) \
-e TMP=/tmp/ \
-e PUSH_SANDBOX_IMAGE=false \
-e RUNNING_IN_CONTAINER=true \
$(UNIT_TEST_IMAGE_NAME)
2 changes: 1 addition & 1 deletion make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ TESTS_RUN_FILTER_REGEXP ?= ""
.PHONY: test-e2e
## Run the e2e tests
test-e2e: INSTALL_OPERATOR=true
test-e2e: prepare-e2e verify-migration-and-deploy-e2e e2e-run-parallel e2e-run e2e-run-metrics
test-e2e: prepare-e2e verify-migration-and-deploy-e2e e2e-run-parallel e2e-run e2e-run-metrics test-ui-e2e
@echo "The tests successfully finished"
@echo "To clean the cluster run 'make clean-e2e-resources'"

Expand Down
17 changes: 0 additions & 17 deletions openshift-ci/Dockerfile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ RUN yum install -y \
libX11-xcb && \
yum clean all

# Install kustomize
RUN curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash \
&& mv kustomize /usr/local/bin

# Install Node.js 22 and yarn
RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
yum install -y nodejs && \
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && \
yum install -y yarn && \
yum clean all

# Install oc CLI
RUN curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz && \
tar -xzvf openshift-client-linux.tar.gz -C /usr/local/bin oc && \
chmod +x /usr/local/bin/oc && \
rm -f openshift-client-linux.tar.gz

WORKDIR /tmp

# download, verify and install golang
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/manage-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ wait_until_is_installed
wait_until_is_installed() {
PARAMS="-crd ${EXPECT_CRD} -cs ${CATALOGSOURCE_NAME} -n ${NAMESPACE} -s ${SUBSCRIPTION_NAME}"
scripts/ci/wait-until-is-installed.sh ${PARAMS}
}
}
8 changes: 4 additions & 4 deletions test/e2e/sandbox-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ The UI E2E tests are executed against the Developer Sandbox UI running in OpenSh
- to easily manage it, you can run `nvm use 22`
3. Ensure you have `yarn` installed
4. Make sure you can log in at <https://sso.devsandbox.dev/auth/realms/sandbox-dev/account> using your SSO_USERNAME and SSO_PASSWORD
5. Make sure you do not have any toolchain resources deployed on your cluster
5. Make sure you have toolchain resources deployed on your cluster (you can run `make prepare-and-deploy-e2e`)

### Running UI E2E Tests locally

`make test-ui-e2e SSO_USERNAME=${SSO_USERNAME} SSO_PASSWORD=${SSO_PASSWORD}`
`make test-ui-e2e SSO_USERNAME=${SSO_USERNAME} SSO_PASSWORD=${SSO_PASSWORD} PUSH_SANDBOX_IMAGE=true`

If you want to run and test the Developer Sandbox UI from your local rhdh-plugins repo, run `make test-ui-e2e-local SSO_USERNAME=${SSO_USERNAME} SSO_PASSWORD=${SSO_PASSWORD}`
If you want to run and test the Developer Sandbox UI from your local rhdh-plugins repo, run `make test-ui-e2e-local SSO_USERNAME=${SSO_USERNAME} SSO_PASSWORD=${SSO_PASSWORD} PUSH_SANDBOX_IMAGE=true`

For now, the UI E2E tests are running only through the Firefox browser.

### Running UI E2E Tests in Container

`make test-sandbox-ui-in-container SSO_USERNAME=<SSO_USERNAME> SSO_PASSWORD=<SSO_PASSWORD>`
`make test-sandbox-ui-in-container SSO_USERNAME=<SSO_USERNAME> SSO_PASSWORD=<SSO_PASSWORD> HOST_NS=<HOST_NS>`

### Running UI E2E Tests against dev/stage/prod

Expand Down
Loading