-
Notifications
You must be signed in to change notification settings - Fork 211
chore(ci): decouple namespace from Playwright project name #3796
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
base: main
Are you sure you want to change the base?
chore(ci): decouple namespace from Playwright project name #3796
Conversation
|
Skipping CI for Draft Pull Request. |
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
/test e2e-ocp-helm |
|
The image is available at: |
|
/test e2e-ocp-helm |
|
Consider updating documentation in |
| local playwright_project=$3 | ||
| local url="${4:-}" | ||
|
|
||
| CURRENT_DEPLOYMENT=$((CURRENT_DEPLOYMENT + 1)) |
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.
nit: 💡 Suggestion: Consider adding a comment explaining when CURRENT_DEPLOYMENT is incremented:
CURRENT_DEPLOYMENT tracking:
- Incremented here (run_tests) for successful test executions
- Incremented in check_and_test() error path for deployment failures
- Incremented in check_upgrade_and_test() error path for upgrade failures
CURRENT_DEPLOYMENT=$((CURRENT_DEPLOYMENT + 1))
This helps future maintainers understand the reporting flow.
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.
Yeah, you're right. I'm now thinking that it probably makes sense to open a Jira to refactor how the deployments are done, and that would result in the deployment and status saving being self-explanatory 🤔 Rather than describing the current juggling 😅
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.
Can this be incorporated in https://issues.redhat.com/browse/RHIDP-11006 ? 🤔
.ibm/pipelines/jobs/aks-helm.sh
Outdated
|
|
||
| initiate_aks_helm_deployment | ||
| check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" "https://${K8S_CLUSTER_ROUTER_BASE}" 50 30 | ||
| check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" "showcase-k8s" "https://${K8S_CLUSTER_ROUTER_BASE}" 50 30 |
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.
The Playwright project names are now hardcoded across multiple job files. Consider defining them as constants in env_variables.sh:
PLAYWRIGHT_PROJECT_K8S="showcase-k8s"
PLAYWRIGHT_PROJECT_RBAC_K8S="showcase-rbac-k8s"
PLAYWRIGHT_PROJECT_OPERATOR="showcase-operator"
PLAYWRIGHT_PROJECT_OPERATOR_RBAC="showcase-operator-rbac"
PLAYWRIGHT_PROJECT_RUNTIME="showcase-runtime"
PLAYWRIGHT_PROJECT_UPGRADE="showcase-upgrade"
Then use something like:
check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" "${PLAYWRIGHT_PROJECT_K8S}"
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.
I considered doing this, but then I thought that it might be more readable to have it configured directly.
Having too many global variables makes it less transparent 🤔
But I don't have a strong opinion here 😄
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.
Anyway, I refactored it further to use the variables for both Bash and Playwright Typescript.
d406e5b to
d7f5e75
Compare
|
The image is available at: |
625f91d to
4a1362b
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR TypeEnhancement Description
|
| Relevant files | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 12 files
| ||||||||||||||||||||||||
| Configuration changes | 1 files
| ||||||||||||||||||||||||
| Documentation | 4 files
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
The image is available at: |
4a1362b to
ec72a2b
Compare
|
The image is available at: |
|
/approve |
|
/approve |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gustavolira The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
The image is available at: |
|
New changes are detected. LGTM label has been removed. |
e5f378d to
4b2f96d
Compare
|
The image is available at: |
|
The image is available at: |
|
|
The image is available at: |



Description
This PR refactors the CI pipeline scripts to decouple the Kubernetes namespace from the Playwright project name, centralizes project names in a single source of truth, and fixes status reporting for the
showcase-runtimetest scenario.This enables more flexible use of namespaces and test projects, allowing them to be configured and reused independently.
Changes
1. Decouple namespace from Playwright project name
Previously, the CI scripts implicitly tied the namespace name to the Playwright project name (e.g., namespace
showcase-ci-nightlyalways ran projectshowcase). This created unnecessary coupling and prevented flexible reuse of namespaces with different test projects.Now,
check_and_test()andrun_tests()accept an explicitplaywright_projectargument separate from the namespace, allowing:Tests are executed directly via
npx playwright test --project="${playwright_project}"following Playwright's recommended approach.2. Single source of truth for Playwright project names
Created
e2e-tests/playwright/projects.jsonas the single source of truth for all Playwright project names. This file is consumed by:playwright.config.ts) viae2e-tests/playwright/projects.tsimport.ibm/pipelines/playwright-projects.shwhich exports$PW_PROJECT_*environment variablesAll CI job scripts now use these variables (e.g.,
${PW_PROJECT_SHOWCASE}) instead of hardcoded strings.3. Fix status saving for showcase-runtime
Moved the deployment status tracking (
CURRENT_DEPLOYMENTincrement andsave_status_deployment_namespace) to the beginning ofrun_tests()instead of only incheck_and_test(). This ensures tests likeshowcase-runtimethat callrun_tests()directly correctly report their deployment status.4. Clean up e2e-tests/package.json
Removed redundant
*-nightlyand*-ci-nightlyyarn script aliases that were only used for CI naming conventions.Which issue(s) does this PR fix
showcase-runtimein the fine-grained CI reporterPR acceptance criteria
How to test changes / Special notes to the reviewer
Key decoupling: Namespace and Playwright project are now independent:
Files modified:
.ibm/pipelines/utils.sh- Core functions updated with explicit project argument.ibm/pipelines/jobs/*.sh- All job handlers updatede2e-tests/playwright/projects.json- Single source of truth for project namese2e-tests/playwright/projects.ts- TypeScript exports.ibm/pipelines/playwright-projects.sh- Shell script to load project names as env varse2e-tests/package.json- Removed redundant script aliases