Skip to content

Commit

Permalink
Make test script dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
hammerhead committed May 9, 2024
1 parent 2f69af7 commit 0995a71
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/bin/bash

if [ "$1" != "aws" ] && [ "$1" != "azure" ]
then
echo "Usage: $0 <aws|azure>"
exit
fi

if [[ "$1" = "aws" ]]; then
test_class="TestTerraformAws"
else
test_class="TestTerraformAzure"
fi

source .env

AWS_TEST_REGION=$AWS_TEST_REGION \
Expand All @@ -8,4 +20,4 @@ AWS_TEST_SSH_KEYPAIR=$AWS_TEST_SSH_KEYPAIR \
AWS_TEST_SUBNET_IDS=$AWS_TEST_SUBNET_IDS \
AWS_TEST_AVAILABILITY_ZONES=$AWS_TEST_AVAILABILITY_ZONES \
AZURE_TEST_SUBSCRIPTION_ID=$AZURE_TEST_SUBSCRIPTION_ID \
go test -timeout 30m -run TestTerraformAzure
go test -timeout 30m -run "${test_class}"

0 comments on commit 0995a71

Please sign in to comment.