Skip to content

Commit f8a8baa

Browse files
committed
Use file instead of env var
Signed-off-by: Shubham Sharma <[email protected]>
1 parent 8689723 commit f8a8baa

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ jobs:
113113
- name: Check E2E test failure
114114
continue-on-error: false
115115
run: |
116-
echo "E2E_TEST_FAILURE=$E2E_TEST_FAILURE"
117-
if [[ -v E2E_TEST_FAILURE ]]; then
116+
FILENAME=E2E_TEST_ERROR
117+
if [[ -f "$FILENAME" ]]; then
118118
exit 1
119119
fi
120120

test/e2e/utils.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
var fs = require("fs");
2+
3+
const errorFilePath = "E2E_TEST_ERROR";
4+
15
export async function testIt(name: string, fn?: any, timeout?: number): Promise<void> {
26
test(name, async () => {
37
try {
48
await fn()
59
}
610
catch (error) {
7-
// set failure environment variable
8-
process.env.E2E_TEST_FAILURE = "true";
11+
// Create a new file to denote error.
12+
touchFile(errorFilePath);
913
throw error
1014
}
1115
}, timeout)
16+
}
17+
18+
// Creates an empty file at filepath.
19+
function touchFile(filepath: string) {
20+
fs.write(fs.openSync(filepath, 'w'));
1221
}

0 commit comments

Comments
 (0)