Skip to content

Commit 114ae0d

Browse files
author
Luca Forstner
committed
Add timeout for build command
1 parent abe4225 commit 114ae0d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/e2e-tests/run.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const PUBLISH_PACKAGES_DOCKER_IMAGE_NAME = 'publish-packages';
1313

1414
const publishScriptNodeVersion = process.env.E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION;
1515

16+
const DEFAULT_BUILD_TIMEOUT_SECONDS = 60;
1617
const DEFAULT_TEST_TIMEOUT_SECONDS = 60;
1718

1819
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
@@ -127,6 +128,7 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
127128
type Recipe = {
128129
testApplicationName: string;
129130
buildCommand?: string;
131+
buildTimeoutSeconds?: number;
130132
tests: {
131133
testName: string;
132134
testCommand: string;
@@ -142,6 +144,7 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
142144
cwd: path.dirname(recipePath),
143145
encoding: 'utf8',
144146
shell: true, // needed so we can pass the build command in as whole without splitting it up into args
147+
timeout: (recipe.buildTimeoutSeconds ?? DEFAULT_BUILD_TIMEOUT_SECONDS) * 1000,
145148
});
146149

147150
// Prepends some text to the output build command's output so we can distinguish it from logging in this script

packages/e2e-tests/test-recipe-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"type": "string",
1212
"description": "Command that is run to install dependencies and build the test application. This command is only run once before all tests. Working directory of the command is the root of the test application."
1313
},
14+
"buildTimeoutSeconds": {
15+
"type": "number",
16+
"description": "Timeout for the build command in seconds. Default: 60"
17+
},
1418
"tests": {
1519
"type": "array",
1620
"description": "Tests to run in this test application",

0 commit comments

Comments
 (0)