Skip to content

Commit

Permalink
multiple-pipeline-capture/playback wrappers preserve SCRIPT_NAME
Browse files Browse the repository at this point in the history
This fixes 1398cf4 which broke logging by moving the logs of both
tests into the same logs/multiple-pipeline/ directory

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Dec 4, 2020
1 parent f39d706 commit 89cf4cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
SCRIPT_HOME="$(dirname "$0")"
# get test-case parent folder name
SCRIPT_HOME=$(cd "$SCRIPT_HOME/.." && pwd)

# Let some wrappers override this if they want
# shellcheck disable=SC2034 # external script can use it
SCRIPT_NAME="$0" # get test-case script load name
: "${SCRIPT_NAME:="$0"}" # get test-case script load name

# shellcheck disable=SC2034 # external script can use it
SCRIPT_PRAM="$*" # get test-case parameter

Expand Down
1 change: 1 addition & 0 deletions test-case/multiple-pipeline-capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ set -e
TESTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)

# Need "exec" otherwise it believes to be a Sub-Test
export SCRIPT_NAME="$0"
exec "$TESTDIR"/test-case/multiple-pipeline.sh -f c "$@"
1 change: 1 addition & 0 deletions test-case/multiple-pipeline-playback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ set -e
TESTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)

# Need "exec" otherwise it believes to be a Sub-Test
export SCRIPT_NAME="$0"
exec "$TESTDIR"/test-case/multiple-pipeline.sh -f p "$@"

0 comments on commit 89cf4cb

Please sign in to comment.