From 54bf2e787599fd21c6a9aed5104a617475e40b7b Mon Sep 17 00:00:00 2001 From: Simon Li Date: Tue, 11 Feb 2025 18:05:06 +0000 Subject: [PATCH] Test that set -e hasn't leaked into the main shell --- tests/venv/start/postBuild/README.rst | 2 ++ tests/venv/start/postBuild/verify | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/venv/start/postBuild/README.rst b/tests/venv/start/postBuild/README.rst index ecfd428eb..81b2e86cd 100644 --- a/tests/venv/start/postBuild/README.rst +++ b/tests/venv/start/postBuild/README.rst @@ -3,3 +3,5 @@ postBuild and start This test checks that we can use a postBuild and start script at the same time. + +It also checks that exit on error (set -e) has not leaked into the main shell. diff --git a/tests/venv/start/postBuild/verify b/tests/venv/start/postBuild/verify index 5fd16f8d0..a8dbc5e33 100755 --- a/tests/venv/start/postBuild/verify +++ b/tests/venv/start/postBuild/verify @@ -1,4 +1,9 @@ -#!/bin/bash +#!/bin/bash -il +# Run this as an interactive login shell so that the conda profile is sourced + +# Test that `set -e` isn't incorrectly set in a profile +false + set -euo pipefail grep 'Done!' $HOME/postbuild.txt # set value of TEST_START_VAR to empty string when it is not defined