Skip to content

Commit 12d05ee

Browse files
authored
Cypress e2e - Github Actions - Autotrigger after successful test.yml execution (non-gating) (opendatahub-io#5518)
* Update testUserLogin.cy.ts * Update pipelines.cy.ts * Update testClusterStorageCreation.cy.ts * Update testConnectionCreation.cy.ts * Update testModelStopStart.cy.ts * Update workbenches.cy.ts * Update testProjectCreation.cy.ts * Update testAdminClusterSettings.cy.ts * Update cypress-e2e-test.yml * Update package.json * Update package.json * Update package.json * Update cypress-e2e-test.yml * Update cypress-e2e-test.yml * Update package.json * Update package.json * Removing Electron from package.json * Update workbenches.cy.ts * Update testModelStopStart.cy.ts * Dynamic Port Logic Added * Additional Debugging for Cypress failing to connect to Chrome * Additional debugging for chrome browser * Fixed --browser-args * Further additional debugging * Revert to use 4010 * Reverted to working version with dynamic port * Pass baseUrl via --config * Setting ODH_DASHBOARD_URL to http://localhost:${CYPRESS_PORT} * Added replacement of all occurences of dashboard_url * Make ODH_DASHBOARD_URL Global * Dynamic Port Change to Test Matrix * Test Variables Update * Reverting to Friday's version * Reverting to Friday's version 2 * Nested ODH_Dashboard_URL update * Root level ODH_Dashboard_URL change * ODH_PORT change 2 * added chrome back * additional cleanup added * Additional debugging and xfvb checks * Remved XFVB Calcs * Switching back to electron * Switching back to electron * FD Limit Increase * Reverting to working version * Removing checkout of current branch * Updated cypress execution command to use localhost * Minimal test config update * Added Cypress Debugging * Running 1 tag with debugging * Added WDS_SOCKET_PORT=${CYPRESS_PORT} * Update webpack.dev.js to specify port * Minor change to accomodate webpack changes * Additional webpack.dev.js updates * XFVB changes * Remved xfvb * Added additional logging to webpack * Adding additional logging * Webpack IPv4 changes * Port cleanup change * Adding export Base_URL * Added Cypress and Base URLs * Test-variables command update * Updated base_url * Cypress debug and Video Disable * Addeed DEBUG=cypress:server * Removed Cypress Debugging * Reverting webpack.dev.js changes * Renabling chrome * Removed cluster detail * Fix js-yaml import in testProjectCreation.cy.ts and update test tags * Fix TypeScript path mapping for #~/ alias in Cypress tsconfig * Revert TypeScript path mapping change - leave as is in main * feat: override RHOAI namespaces with ODH values from GitHub secret - Add step to override namespace values from ODH_NAMESPACES secret - Parse comma-separated values: OPERATOR_NAMESPACE,APPLICATIONS_NAMESPACE,NOTEBOOKS_NAMESPACE,OPERATOR_NAME,ODH_DASHBOARD_PROJECT_NAME - Mask secret values in logs for security - Add description noting workflow only supports ODH dash-e2e pipeline currently - Switch from Electron to Chrome browser for Cypress tests * feat: improve E2E workflow for multi-user parallel execution - Improve port allocation: use modulo 1000 with 5-port spacing (1000 possible ports) - Add port ownership tracking with run_id files to prevent collisions - Remove Cypress dependencies installation step (managed on runners) - Add port ownership checking before killing processes (prevents killing other users' jobs) - Enable video recording on test failure (videoUploadOnPasses: false) - Improve cleanup job: only kill processes owned by current run_id - Add Chrome process cleanup to prevent orphaned browser processes - Add alternative port finding if primary port is owned by another run These changes ensure the workflow can safely handle up to 5 users running pipelines in parallel without port collisions or process interference. * fix: remove invalid videoUploadOnPasses Cypress config option Cypress automatically uploads videos on failure by default when video=true, so the videoUploadOnPasses option is not needed and is invalid. * fix: add timeouts to cache operations to prevent hanging - Add timeout-minutes: 10 to npm dependencies cache (largest cache) - Add timeout-minutes: 5 to turbo and oc cache steps - Add continue-on-error: true to all cache steps to prevent job failure - Add job-level timeout-minutes: 30 to prevent jobs from hanging indefinitely This addresses jobs getting stuck during post-job cache cleanup, particularly when multiple jobs run in parallel and try to save large caches. * fix: use restore-only caching to eliminate save conflicts - Convert all cache steps to actions/cache/restore@v4 (read-only) - Remove cache save operations that were causing 3-5 minute post-job delays - Jobs still benefit from cache when available, but won't update it - Eliminates 'Unable to reserve cache' conflicts from parallel jobs * chore: linting fixes * feat: trigger E2E tests after test.yml with concurrency and label support - Change trigger from push/PR to workflow_run after test.yml completes - Add PR-aware concurrency control (e2e-pr-{number} for PRs, e2e-branch-{name} for branches) - Only latest E2E run executes per PR/branch (cancels in-progress runs) - Add label update job (e2e-Pass/e2e-Fail) based on test results - Checkout PR code using refs/pull/{number}/head format - E2E results do not gate code merging (non-blocking) * feat: improve E2E workflow fork support and documentation - Add test names in comments for @ci-dashboard-set-1 and @ci-dashboard-set-2 - Update checkout comment to clarify fork PR support - Align secret handling with current implementation (graceful fallback) - Add ODH_DASHBOARD_URL fallback to localhost for fork PRs
1 parent 6e66218 commit 12d05ee

10 files changed

Lines changed: 381 additions & 356 deletions

File tree

.github/workflows/cypress-e2e-test.yml

Lines changed: 344 additions & 347 deletions
Large diffs are not rendered by default.

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"cypress:run:mock:coverage": "rimraf src/__tests__/cypress/coverage src/__tests__/cypress/.nyc_output && CY_COVERAGE=true npm run cypress:run:mock -- {@}",
5050
"cypress:open:record": "CY_RECORD=1 npm run cypress:open",
5151
"cypress:run:electron": "cypress run -b electron --project src/__tests__/cypress",
52+
"cypress:run:chrome": "cypress run -b chrome --project src/__tests__/cypress",
5253
"cypress:run:record": "CY_RECORD=1 npm run cypress:run && npm run cypress:format",
5354
"cypress:server:build": "MF_DEV=true ODH_DIST_DIR=./public-cypress POLL_INTERVAL=9999999 FAST_POLL_INTERVAL=9999999 WS_HOSTNAME=localhost:9002 npm run build",
5455
"cypress:server:build:coverage": "COVERAGE=true npm run cypress:server:build",

frontend/src/__tests__/cypress/cypress/tests/e2e/Pipelines/pipelines.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe(
3434

3535
it(
3636
'An admin User can Import and Run a Pipeline',
37-
{ tags: ['@Smoke', '@SmokeSet1', '@Dashboard', '@Pipelines', '@Bug'] },
37+
{ tags: ['@Smoke', '@SmokeSet1', '@Dashboard', '@Pipelines', '@ci-dashboard-set-1', '@Bug'] },
3838
() => {
3939
cy.step('Navigate to Pipelines ${projectName}');
4040
cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER);

frontend/src/__tests__/cypress/cypress/tests/e2e/dashboardNavigation/testUserLogin.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { header } from '#~/__tests__/cypress/cypress/pages/components/Header';
77
describe('Verify that logged in users display on the Dashboard', () => {
88
it(
99
'Verify that Admin Users can login and that login information displays on the dashboard',
10-
{ tags: ['@Sanity', '@SanitySet2', '@ODS-354', '@Dashboard'] },
10+
{ tags: ['@Sanity', '@SanitySet2', '@ODS-354', '@Dashboard', '@ci-dashboard-set-1'] },
1111
() => {
1212
// Authentication and navigation
1313
cy.step('Log into the application');

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/clusterStorage/testClusterStorageCreation.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Verify Cluster Storage - Creating, Editing and Deleting', () => {
7070

7171
it(
7272
'Create, Edit and Delete a Persistent Volume Storage',
73-
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1824', '@Dashboard'] },
73+
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1824', '@Dashboard', '@ci-dashboard-set-2'] },
7474
() => {
7575
// Authentication and navigation
7676
cy.step('Log into the application');

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/connections/testConnectionCreation.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Verify Connections - Creation and Deletion', () => {
5656

5757
it(
5858
'Create and Delete a Connection',
59-
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1826', '@Dashboard'] },
59+
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1826', '@Dashboard', '@ci-dashboard-set-2'] },
6060
() => {
6161
// Authentication and navigation
6262
cy.step('Log into the application');

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/models/testModelStopStart.cy.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ describe('[Product Bug: RHOAIENG-38674] A model can be stopped and started', ()
5757
it(
5858
'Verify that a model can be stopped and started',
5959
{
60-
tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@ModelServing', '@NonConcurrent', '@Bug'],
60+
tags: [
61+
'@Smoke',
62+
'@SmokeSet3',
63+
'@Dashboard',
64+
'@ModelServing',
65+
'@NonConcurrent',
66+
'@ci-dashboard-set-2',
67+
'@Bug',
68+
],
6169
},
6270
() => {
6371
cy.log('Model Name:', modelName);

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/testProjectCreation.cy.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import yaml from 'js-yaml';
1+
import * as yaml from 'js-yaml';
22
import { HTPASSWD_CLUSTER_ADMIN_USER } from '#~/__tests__/cypress/cypress/utils/e2eUsers';
33
import {
44
projectListPage,
@@ -55,7 +55,17 @@ describe('Verify Project - Creation and Deletion', () => {
5555

5656
it(
5757
'Create and Delete a Project in RHOAI',
58-
{ tags: ['@Smoke', '@SmokeSet2', '@ODS-1875', '@ODS-1783', '@ODS-1775', '@Dashboard'] },
58+
{
59+
tags: [
60+
'@Smoke',
61+
'@SmokeSet2',
62+
'@ODS-1875',
63+
'@ODS-1783',
64+
'@ODS-1775',
65+
'@Dashboard',
66+
'@ci-dashboard-set-1',
67+
],
68+
},
5969
() => {
6070
// Authentication and navigation
6171
cy.step('Log into the application');

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/workbenches/workbenches.cy.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ describe('Workbench and PVSs tests', () => {
7474

7575
it(
7676
'Verify users can create a workbench and connect an existent PersistentVolume',
77-
{ tags: ['@Smoke', '@SmokeSet1', '@ODS-1814', '@Dashboard', '@Workbenches'] },
77+
{
78+
tags: [
79+
'@Smoke',
80+
'@SmokeSet1',
81+
'@ODS-1814',
82+
'@Dashboard',
83+
'@Workbenches',
84+
'@ci-dashboard-set-1',
85+
],
86+
},
7887
() => {
7988
const workbenchName = projectName.replace('dsp-', '');
8089
let selectedImageStream: string;

frontend/src/__tests__/cypress/cypress/tests/e2e/settings/clusterSettings/testAdminClusterSettings.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('Verify that only the Cluster Admin can access Cluster Settings', () =>
6464

6565
it(
6666
'Admin should access Cluster Settings and see UI fields matching OpenShift configurations',
67-
{ tags: ['@Smoke', '@SmokeSet2', '@ODS-1216', '@Dashboard'] },
67+
{ tags: ['@Smoke', '@SmokeSet2', '@ODS-1216', '@Dashboard', '@ci-dashboard-set-2'] },
6868
() => {
6969
// Authentication and navigation
7070
cy.step('Log into the application');

0 commit comments

Comments
 (0)