mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-23 08:16:14 +00:00
devops: balance playwright shards (#13064)
This patch uses Flakiness.io Playwright shard balancing to evenly distribute tests across shards.
This commit is contained in:
1 parent
daeec1f775
commit
113cc830dc
4 files changed
+2421
-2
No files matched your search
@@ -6,7 +6,8 @@ exclude: |
|
|||||||
src/backend/InvenTree/locale/.*|
|
src/backend/InvenTree/locale/.*|
|
||||||
src/frontend/src/locales/.* |
|
src/frontend/src/locales/.* |
|
||||||
.*/migrations/.* |
|
.*/migrations/.* |
|
||||||
src/frontend/yarn.lock
|
src/frontend/yarn.lock |
|
||||||
|
src/frontend/playwright/timings.json
|
||||||
)$
|
)$
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import * as path from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
|
||||||
import { defineConfig, devices } from '@playwright/test';
|
import { defineConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
import { mockOidcPort, mockSsoUser } from './tests/defaults';
|
import { mockOidcPort, mockSsoUser } from './tests/defaults';
|
||||||
@@ -5,6 +8,16 @@ import { mockOidcPort, mockSsoUser } from './tests/defaults';
|
|||||||
// Detect if running in CI
|
// Detect if running in CI
|
||||||
const IS_CI = !!process.env.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:
|
/* We optionally spin-up services based on the testing mode:
|
||||||
*
|
*
|
||||||
* Local Development:
|
* Local Development:
|
||||||
@@ -49,7 +62,13 @@ export default defineConfig({
|
|||||||
['html', { open: 'never' }],
|
['html', { open: 'never' }],
|
||||||
['blob'],
|
['blob'],
|
||||||
['github'],
|
['github'],
|
||||||
['@flakiness/playwright', { flakinessProject: 'InvenTree/InvenTree' }]
|
[
|
||||||
|
'@flakiness/playwright',
|
||||||
|
{
|
||||||
|
flakinessProject: 'InvenTree/InvenTree',
|
||||||
|
shardBalancing: { timingsFile: TIMINGS_FILE }
|
||||||
|
}
|
||||||
|
]
|
||||||
]
|
]
|
||||||
: 'list',
|
: 'list',
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
# Ignore auth cache
|
# Ignore auth cache
|
||||||
auth/
|
auth/
|
||||||
*.json
|
*.json
|
||||||
|
|
||||||
|
# Committed shard-balancing timings (see playwright.config.ts)
|
||||||
|
!timings.json
|
||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user