Skip to content

Commit 955f145

Browse files
authored
test: reenable ui e2e tests + improvements (codeready-toolchain#1206)
* reenable ui e2e tests + improvements * requested changes * fix * improvement * requested changes * undo * change quay.io/codeready-toolchain/sandbox-rhdh-plugin to use latest
1 parent 3f847aa commit 955f145

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

make/sandbox-ui.mk

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@ UI_ENVIRONMENT := ui-e2e-tests
1010
SSO_USERNAME_READ := $(shell if [ -n "$(CI)" ]; then cat /usr/local/sandbox-secrets/SSO_USERNAME 2>/dev/null || echo ""; else echo "${SSO_USERNAME}"; fi)
1111
SSO_PASSWORD_READ := $(shell if [ -n "$(CI)" ]; then cat /usr/local/sandbox-secrets/SSO_PASSWORD 2>/dev/null || echo ""; else echo "${SSO_PASSWORD}"; fi)
1212

13-
TAG := $(shell \
13+
QUAY_NAMESPACE ?= codeready-toolchain-test
14+
IMAGE_NAME_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE)/sandbox-rhdh-plugin
15+
16+
IMAGE_TO_PUSH_IN_QUAY := $(shell \
1417
if [ -n "$(CI)$(CLONEREFS_OPTIONS)" ]; then \
1518
if [ -n "$(GITHUB_ACTIONS)" ]; then \
1619
REPOSITORY_NAME=$$(basename "$(GITHUB_REPOSITORY)"); \
1720
COMMIT_ID_SUFFIX=$$(echo "$(PULL_PULL_SHA)" | cut -c1-7); \
18-
echo "from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \
21+
echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY):from.$${REPOSITORY_NAME}.PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \
1922
else \
20-
AUTHOR=$$(jq -r '.refs[0].pulls[0].author' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]'); \
21-
PULL_PULL_SHA=$${PULL_PULL_SHA:-$$(jq -r '.refs[0].pulls[0].sha' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]')}; \
22-
COMMIT_ID_SUFFIX=$$(echo "$${PULL_PULL_SHA}" | cut -c1-7); \
23-
echo "from.$(REPO_NAME).PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \
23+
: "if REPO_NAME is not set, it means that the E2E tests were triggered by periodic CI job"; \
24+
if [ -z "$(REPO_NAME)" ]; then \
25+
echo "quay.io/codeready-toolchain/sandbox-rhdh-plugin:latest"; \
26+
else \
27+
AUTHOR=$$(jq -r '.refs[0].pulls[0].author' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]'); \
28+
PULL_PULL_SHA=$${PULL_PULL_SHA:-$$(jq -r '.refs[0].pulls[0].sha' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]')}; \
29+
COMMIT_ID_SUFFIX=$$(echo "$${PULL_PULL_SHA}" | cut -c1-7); \
30+
echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY):from.$$(echo $(REPO_NAME) | sed 's/\"//g').PR$(PULL_NUMBER).$${COMMIT_ID_SUFFIX}"; \
31+
fi; \
2432
fi; \
2533
else \
26-
echo "latest"; \
34+
echo "$(IMAGE_NAME_TO_PUSH_IN_QUAY):latest"; \
2735
fi)
2836

2937

30-
IMAGE_TO_PUSH_IN_QUAY ?= quay.io/$(QUAY_NAMESPACE)/sandbox-rhdh-plugin:$(TAG)
31-
32-
3338
.PHONY: deploy-sandbox-ui
3439
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)
3540
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
@@ -197,7 +202,7 @@ test-ui-e2e:
197202

198203
.PHONY: test-ui-e2e-local
199204
test-ui-e2e-local:
200-
$(MAKE) deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_TMP=${PWD}/../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT}
205+
$(MAKE) deploy-sandbox-ui e2e-run-sandbox-ui RHDH_PLUGINS_TMP=${PWD}/../rhdh-plugins ENVIRONMENT=${UI_ENVIRONMENT} PUSH_SANDBOX_IMAGE=true
201206

202207

203208
UNIT_TEST_IMAGE_NAME=sandbox-ui-e2e-tests

make/test.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ TESTS_RUN_FILTER_REGEXP ?= ""
4242
.PHONY: test-e2e
4343
## Run the e2e tests
4444
test-e2e: INSTALL_OPERATOR=true
45-
test-e2e: prepare-e2e verify-migration-and-deploy-e2e e2e-run-parallel e2e-run e2e-run-metrics
45+
test-e2e: prepare-e2e verify-migration-and-deploy-e2e e2e-run-parallel e2e-run e2e-run-metrics test-ui-e2e
4646
@echo "The tests successfully finished"
4747
@echo "To clean the cluster run 'make clean-e2e-resources'"
4848

test/e2e/sandbox-ui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The UI E2E tests are executed against the Developer Sandbox UI running in OpenSh
1616

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

19-
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`
19+
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}`
2020

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

0 commit comments

Comments
 (0)