Skip to content

Commit 46b797f

Browse files
authored
chore: Print which exact integration test is being run in GH workflow (#702)
* chore: Print which exact integration test is being run in GH workflow
1 parent 01e0703 commit 46b797f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)