File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,26 @@ jobs:
7272 mkdir -p build
7373 go build -v -o build/tfswitch
7474 mkdir "$(pwd)/bin/"
75- find ./test-data/integration-tests/* -type d -print0 | while read -r -d $'\0' TEST_PATH; do
75+ find ./test-data/integration-tests/ -mindepth 1 -maxdepth 1 -type d -print0 | while read -r -d $'\0' TEST_PATH; do
76+ echo
77+ echo "==> Running integration test in \"${TEST_PATH}\" directory"
78+
7679 if test -f "${TEST_PATH}/.tfswitch.toml"
7780 then
7881 cp "${TEST_PATH}/.tfswitch.toml" ~/
7982 else
8083 rm -f ~/.tfswitch.toml
8184 fi
85+
86+ # If the integration test directory name ends with "_opentofu", set the TF_PRODUCT
87+ # environment variable to "opentofu" for that test, otherwise unset it
88+ if [[ $TEST_PATH == *_opentofu ]]; then
89+ echo "--> Setting TF_PRODUCT environment variable to \"opentofu\" for this test"
90+ export TF_PRODUCT="opentofu"
91+ else
92+ unset TF_PRODUCT
93+ fi
94+
8295 ./build/tfswitch -c "${TEST_PATH}" -b "$(pwd)/bin/terraform" || exit 1
8396 done
8497
You can’t perform that action at this time.
0 commit comments