mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(e2e): skip supersync tests when server unavailable
Move health check into testRunId fixture so all supersync tests automatically skip when the server isn't running. Previously, tests would fail with ECONNREFUSED and count toward the 5-failure limit, interrupting the entire test run.
This commit is contained in:
parent
e046eb9100
commit
2e890fc0d6
1 changed files with 14 additions and 0 deletions
|
|
@ -44,8 +44,22 @@ export const test = base.extend<SuperSyncFixtures>({
|
|||
/**
|
||||
* Generate a unique test run ID for this test.
|
||||
* Used to isolate test data between parallel test runs.
|
||||
* Also checks server health and skips test if server unavailable.
|
||||
*/
|
||||
testRunId: async ({}, use, testInfo) => {
|
||||
// Check server health once per worker
|
||||
if (serverHealthyCache === null) {
|
||||
serverHealthyCache = await isServerHealthy();
|
||||
if (!serverHealthyCache) {
|
||||
console.warn(
|
||||
'SuperSync server not healthy at http://localhost:1901 - skipping tests',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Skip if server not healthy
|
||||
testInfo.skip(!serverHealthyCache, 'SuperSync server not running');
|
||||
|
||||
const id = generateTestRunId(testInfo.workerIndex);
|
||||
await use(id);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue