Skip to content

Commit e6331ff

Browse files
YunchuWangCopilot
andcommitted
test(functions-e2e): fail wrapper script fast on test-app build failure
The wrapper used set -uo pipefail (no -e) and did not check the test-app install/build subshell result, so a failed npm install/build would fall through to a skipped Jest run and exit 0, masking the failure. Guard the install/build and propagate a non-zero exit (stopping Azurite first). Addresses PR review feedback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e718bd1c-581f-4a9a-995a-62d4a38bbc86
1 parent 43c5a2b commit e6331ff

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

scripts/test-e2e-functions.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,17 @@ if ! azurite_up; then
4444
fi
4545

4646
# Install + build the ported BasicNode app against the published durable-functions
47-
# package so 'func start' has a dist/ to serve.
47+
# package so 'func start' has a dist/ to serve. If this fails there is no app to
48+
# run, so fail fast instead of letting the suite skip and masking the error.
4849
echo "Installing + building test-app..."
49-
( cd "$TEST_APP_DIR" && npm install && npm run build )
50+
if ! ( cd "$TEST_APP_DIR" && npm install && npm run build ); then
51+
echo "test-app install/build failed." >&2
52+
if [ -n "$started_azurite" ]; then
53+
echo "Stopping Azurite..."
54+
kill "$started_azurite" 2>/dev/null || true
55+
fi
56+
exit 1
57+
fi
5058

5159
echo "Running Functions host E2E tests..."
5260
( cd "$ROOT_DIR" && npm run test:e2e:functions:internal )

0 commit comments

Comments
 (0)