Skip to content

Commit 6bce0de

Browse files
author
Luca Forstner
committed
Make E2E tests pass so we don't fail master
1 parent d46c984 commit 6bce0de

File tree

7 files changed

+8
-33
lines changed

7 files changed

+8
-33
lines changed

packages/e2e-tests/run.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,13 @@ const recipeResults = recipePaths.map(recipePath => {
129129
const buildCommandProcess = childProcess.spawnSync(recipe.buildCommand, {
130130
cwd: path.dirname(recipePath),
131131
encoding: 'utf8',
132-
stdio: 'inherit',
133132
shell: true, // needed so we can pass the build command in as whole without splitting it up into args
134133
});
135134

135+
// Prepends some text to the output build command's output so we can distinguish it from logging in this script
136+
console.log(buildCommandProcess.stdout.replace(/^/gm, '[BUILD OUTPUT] '));
137+
console.log(buildCommandProcess.stderr.replace(/^/gm, '[BUILD OUTPUT] '));
138+
136139
if (buildCommandProcess.status !== 0) {
137140
process.exit(1);
138141
}
@@ -152,16 +155,17 @@ const recipeResults = recipePaths.map(recipePath => {
152155
cwd: path.dirname(recipePath),
153156
timeout: (test.timeoutSeconds ?? DEFAULT_TEST_TIMEOUT_SECONDS) * 1000,
154157
encoding: 'utf8',
155-
stdio: 'pipe',
156158
shell: true, // needed so we can pass the test command in as whole without splitting it up into args
157159
});
158160

161+
// Prepends some text to the output test command's output so we can distinguish it from logging in this script
159162
console.log(testProcessResult.stdout.replace(/^/gm, '[TEST OUTPUT] '));
160163
console.log(testProcessResult.stderr.replace(/^/gm, '[TEST OUTPUT] '));
161164

162165
const error: undefined | (Error & { code?: string }) = testProcessResult.error;
163166

164167
if (error?.code === 'ETIMEDOUT') {
168+
someTestFailed = true;
165169
printCIErrorMessage(
166170
`Test "${test.testName}" in test application "${recipe.testApplicationName}" (${path.dirname(
167171
recipePath,
@@ -183,7 +187,6 @@ const recipeResults = recipePaths.map(recipePath => {
183187
result: 'FAIL',
184188
};
185189
} else {
186-
someTestFailed = true;
187190
console.log(
188191
`Test "${test.testName}" in test application "${recipe.testApplicationName}" (${path.dirname(
189192
recipePath,

packages/e2e-tests/test-applications/temporary-app-1/bad.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/e2e-tests/test-applications/temporary-app-1/test-recipe.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@
55
"tests": [
66
{
77
"testName": "Example Test (Should Succeed)",
8-
"testCommand": "yarn start:good",
9-
"timeoutSeconds": 30
10-
},
11-
{
12-
"testName": "Example Test (Should Fail)",
13-
"testCommand": "yarn start:bad"
14-
},
15-
{
16-
"testName": "Example Test (Should time out)",
17-
"testCommand": "yarn start:timeout",
18-
"timeoutSeconds": 5
8+
"testCommand": "yarn start:good"
199
}
2010
]
2111
}

packages/e2e-tests/test-applications/temporary-app-1/timeout.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/e2e-tests/test-applications/temporary-app-2/bad.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/e2e-tests/test-applications/temporary-app-2/test-recipe.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@
55
"tests": [
66
{
77
"testName": "Example Test (Should Succeed)",
8-
"testCommand": "yarn start:good",
9-
"timeoutSeconds": 60
10-
},
11-
{
12-
"testName": "Example Test (Should Fail)",
13-
"testCommand": "yarn start:bad"
14-
},
15-
{
16-
"testName": "Example Test (Should time out)",
17-
"testCommand": "yarn start:timeout",
18-
"timeoutSeconds": 5
8+
"testCommand": "yarn start:good"
199
}
2010
]
2111
}

packages/e2e-tests/test-applications/temporary-app-2/timeout.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)