Skip to content

[full-ci][tests-only] test: run tests in parallel#13657

Draft
anon-pradip wants to merge 21 commits into
masterfrom
test/run-pw-tests-parallelly
Draft

[full-ci][tests-only] test: run tests in parallel#13657
anon-pradip wants to merge 21 commits into
masterfrom
test/run-pw-tests-parallelly

Conversation

@anon-pradip

@anon-pradip anon-pradip commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Description

Problem Statement

Running E2E tests with fullyParallel: true caused failures from two categories of backend conflicts:

  1. Resource naming collisions — parallel workers created groups/users/emails with identical names, causing 409 errors and auth mismatches.
  2. Verbose world threading — every step/support function accepted and passed world as a parameter, making the code noisy and hard to refactor.

Solution

Part 1: Module-Level World Context Store

Replaced parameter threading with a module-level context store (getWorld()/setWorld()). Any function can now access the current worker context without world in its signature.

  • world.ts — exports getWorld(), setWorld(), and the World class
  • All step filesconst world = getWorld() replaces world parameter in every function
  • All support functionsgetUser, getGroup, getCreatedGroup, getSpace, getCreatedUser etc. call getWorld() internally
  • deleteGroup/addUserToGroup — removed the unused world param entirely (already dead)

Part 2: Worker-Aware Resource Isolation

  • User emails — unique per worker (alice+w0-abc@example.org) to avoid Keycloak 409 duplicate email errors
  • Group display names(workerIndex) suffix for UI matching
  • Spaces/Resources — IDs and names transformed per worker for collision-free parallel execution
  • Token auth — logon tries user.id first, falls back to user.originalId for backward compatibility
  • Keycloak setupbeforeAll reads directly from store.userStore since no World is available there

Backward Compatibility

All transformations are gated on getWorld() returning a valid World instance. Running without parallel workers (fullyParallel: false) bypasses all ID transformations — non-parallel test paths are unaffected.


Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

Open tasks:

  • ...

@anon-pradip anon-pradip self-assigned this Apr 8, 2026
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch from 671aadf to cc57e41 Compare April 8, 2026 11:01
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 12 times, most recently from 69e0afe to 07c303a Compare April 29, 2026 07:24
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 10 times, most recently from d9f8640 to ea95d4f Compare May 7, 2026 07:31
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 5 times, most recently from d40460d to 1c33bca Compare May 14, 2026 08:27
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch from 7dcf10f to a66ae8b Compare June 5, 2026 11:45
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 2 times, most recently from 3fec540 to 7dacc81 Compare June 10, 2026 07:28
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch from 7dacc81 to cb6cc3e Compare June 10, 2026 09:41
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch from a659d28 to 6122402 Compare June 10, 2026 12:05
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 3 times, most recently from 05c2d50 to fb49582 Compare June 12, 2026 10:38
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
7.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[QA] run e2e tests in parallel

2 participants