From 519a5b79e92f751a3f06baf38b41b65255388a36 Mon Sep 17 00:00:00 2001 From: Joshua Horton Date: Mon, 5 May 2025 12:36:01 +0700 Subject: [PATCH] maint(common): address builder.sh test script review comments Co-authored-by: Marc Durdin --- resources/build/test/test.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/build/test/test.sh b/resources/build/test/test.sh index 699b18d064..78a320a26c 100755 --- a/resources/build/test/test.sh +++ b/resources/build/test/test.sh @@ -90,7 +90,7 @@ builder_parse_test() { local expected="$1" local expected_options="$2" - # Minor override for local testing of builder-script mechanics: --debug will always be added. + # When testing in a local environment, --debug will be added by default (see #11106) if [[ $VERSION_ENVIRONMENT == "local" ]]; then expected_options="${expected_options} --debug" fi @@ -104,8 +104,6 @@ builder_parse_test() { builder_die " Test: builder_parse $parameters action:target != \"$expected\"" fi if [[ "${expected_options}" != "${_builder_chosen_options[@]}" ]]; then - echo "${_builder_chosen_options[@]}" - echo "${_builder_chosen_options[@]}" builder_die " Test: builder_parse $parameters, options != \"${expected_options}\"" fi } @@ -194,11 +192,8 @@ parse_output=$(builder_parse --feature xyzzy --bar abc --baz def test) expected="$(builder_echo setmark "test.sh parameters: <--feature xyzzy --bar abc --baz def test>")" if [[ $VERSION_ENVIRONMENT == "local" ]]; then - expected="$(builder_echo setmark "test.sh parameters: <--feature xyzzy --bar abc --baz def test --debug>")" - # Yay, the fun of getting the second line... that newline before the closing brace is intentional. :( - parse_output=${parse_output#* -} - + # When run in a local-dev environment, an extra line appears about the automatic --debug option. + expected="$(builder_echo grey "Local build environment detected: setting --debug")"$'\n'"$(builder_echo setmark "test.sh parameters: <--feature xyzzy --bar abc --baz def test --debug>")" fi if [[ "${parse_output[*]}" != "${expected}" ]]; then builder_die "FAIL: Wrong output for '--feature xyzzy --bar abc --baz def test':\n Actual : ${parse_output[*]}\n Expected: ${expected}"