devops: balance playwright shards (#13064)

This patch uses Flakiness.io Playwright shard balancing to evenly
distribute tests across shards.
This commit is contained in:
Andrey Lushnikov authored and GitHub committed 2026-10-22 07:49:49 +11:00
1 parent daeec1f775
commit 113cc830dc
4 files changed
+2421 -2

No files matched your search

+2 -1
View File
@@ -6,7 +6,8 @@ exclude: |
src/backend/InvenTree/locale/.*|
src/frontend/src/locales/.* |
.*/migrations/.* |
src/frontend/yarn.lock
src/frontend/yarn.lock |
src/frontend/playwright/timings.json
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
+20 -1
View File
@@ -1,3 +1,6 @@
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig, devices } from '@playwright/test';
import { mockOidcPort, mockSsoUser } from './tests/defaults';
@@ -5,6 +8,16 @@ import { mockOidcPort, mockSsoUser } from './tests/defaults';
// Detect if running in CI
const IS_CI = !!process.env.CI;
/* Historical test durations used to balance CI shards by runtime (not test count).
* Refresh from flakiness.io (run from src/frontend):
* CI=1 npx flakiness-playwright-timings fetch -o playwright/timings.json
*/
const TIMINGS_FILE: string = path.join(
path.dirname(fileURLToPath(import.meta.url)),
'playwright',
'timings.json'
);
/* We optionally spin-up services based on the testing mode:
*
* Local Development:
@@ -49,7 +62,13 @@ export default defineConfig({
['html', { open: 'never' }],
['blob'],
['github'],
['@flakiness/playwright', { flakinessProject: 'InvenTree/InvenTree' }]
[
'@flakiness/playwright',
{
flakinessProject: 'InvenTree/InvenTree',
shardBalancing: { timingsFile: TIMINGS_FILE }
}
]
]
: 'list',
+3
View File
@@ -1,3 +1,6 @@
# Ignore auth cache
auth/
*.json
# Committed shard-balancing timings (see playwright.config.ts)
!timings.json
File diff suppressed because it is too large. Load diff