Skip to content

Commit ae92cf5

Browse files
committed
feat: Attempt to slow down OS X tests.
1 parent 5556dcd commit ae92cf5

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
os: [ubuntu-latest, macos-latest]
24+
include:
25+
- os: ubuntu-latest
26+
BLOCKLY_WDIO_PAUSE_TIME_MS: donotoverride
27+
- os: macos-latest
28+
BLOCKLY_WDIO_PAUSE_TIME_MS: 100
2529

2630
steps:
2731
- name: Checkout experimentation plugin
@@ -64,6 +68,8 @@ jobs:
6468
run: |
6569
cd main
6670
npm run test:ci
71+
env:
72+
BLOCKLY_WDIO_PAUSE_TIME_MS: ${{ matrix.BLOCKLY_WDIO_PAUSE_TIME_MS }}
6773

6874
webdriverio_tests:
6975
name: WebdriverIO tests (against pinned v12)

test/webdriverio/test/test_setup.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let driver: webdriverio.Browser | null = null;
4242
* the browser.wait* functions if you need your test to wait for
4343
* something to happen after sending input.
4444
*/
45-
export const PAUSE_TIME = 0;
45+
export const PAUSE_TIME = fetchEnvironmentPauseTime() ?? 0;
4646

4747
/**
4848
* Start up WebdriverIO and load the test page. This should only be
@@ -93,6 +93,20 @@ export async function driverSetup(
9393
return driver;
9494
}
9595

96+
/**
97+
* Fetches the environmentally configured pause time for tests.
98+
*
99+
* @return The paues time, in milliseconds, for tests or null if one isn't
100+
* correctly configured.
101+
*/
102+
function fetchEnvironmentPauseTime(): number | null {
103+
const envPauseTimeMsStr = process.env.BLOCKLY_WDIO_PAUSE_TIME_MS;
104+
if (!envPauseTimeMsStr) return null;
105+
const envPauseTimeMs = parseInt(envPauseTimeMsStr);
106+
if (isNaN(envPauseTimeMs)) return null;
107+
return envPauseTimeMs;
108+
}
109+
96110
/**
97111
* End the WebdriverIO session.
98112
*

0 commit comments

Comments
 (0)