Skip to content

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

Draft
anon-pradip wants to merge 6 commits intomasterfrom
test/run-pw-tests-parallelly
Draft

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

Conversation

@anon-pradip
Copy link
Copy Markdown
Contributor

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

Description

Problem Statement

When running E2E tests with fullyParallel: true, tests failed due to two categories of backend conflicts:

  1. Resource naming collisions — parallel workers created groups/users with identical names, causing 409 errors.
  2. User identity mismatches — auth and user-lookup code still referenced original plain names after workers created uniquely-named users, causing auth failures and "user not found" errors.

Solution

Part 1: Worker-Aware Resource Naming

Each parallel worker now generates unique resource identifiers while test code stays readable.

  • world.ts — generates stable, cached IDs: aliceAlice-w0-abc123, salessales-w1-xyz
  • userManagement.ts — applies transformation when world is passed; group display names get a (workerIndex) suffix for UI matching; user display names are kept clean
  • playwright.config.tsfullyParallel: true with configurable worker count

Part 2: Auth and Identity Fixes (spaces tests)

Four specific bugs surfaced when enabling the spaces spec for parallel execution:

Bug File Fix
OIDC logon used alice (doesn't exist on backend) api/token/utils.ts Try transformed user.id first, fall back to user.originalId
setToken keyed by user.id, getToken by user.originalId — mismatch environment/token.ts Both now use originalId || id
createUser stored under transformed ID, lookups used original — "user not found" api/graph/userManagement.ts createUser/deleteUser/addUserToGroup all key by originalId || id
Role assignment used base user (no UUID) because world wasn't passed steps/api/api.ts Pass world to getUser in userHasAssignedRolesToUsers

Files Changed

File Change
playwright.config.ts fullyParallel: true, configurable workers
world.ts workerIndex, testId, idCache, ID generators
test.ts Inject workerIndex/testId into World
environment/userManagement.ts World-aware ID transform; clean display names
types.ts Added originalId?: string to User
environment/token.ts setToken/getToken use originalId || id
api/token/utils.ts Logon tries transformed ID first
api/graph/userManagement.ts User store keyed by originalId || id
steps/api/api.ts Pass world for role assignment
adminSettings.ts, groups/index.ts Pass world to group helpers

Backward compatible — all transformations are gated on world being present; 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 10 times, most recently from bde5a25 to 4436173 Compare April 24, 2026 07:50
@sonarqubecloud
Copy link
Copy Markdown

@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 3 times, most recently from 07c303a to c5e6ebf Compare April 30, 2026 11:50
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch 5 times, most recently from 68c0887 to 4fc8d4f Compare May 5, 2026 13:14
@anon-pradip anon-pradip force-pushed the test/run-pw-tests-parallelly branch from 4fc8d4f to 1ffd292 Compare May 5, 2026 13:25
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

1 participant