Skip to content

Commit f043f49

Browse files
committed
Add option handling to run-local-integration-tests.sh
1 parent ba01a63 commit f043f49

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

run-local-integration-tests.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
# Exit on any errors
66
set -euo pipefail
77

8-
github_token="$1"
9-
fastly_token="$2"
8+
if [ "$#" -lt 1 ]; then
9+
cat <<EOF
10+
USAGE: $0 github-token [fastly-token]
1011
11-
if [ $# -gt 0 ]; then
12-
echo "Running act to test integration tests with:"
13-
echo "Github Personal Access Token: $github_token"
14-
echo "Fastly Token: $fastly_token"
15-
act -j sdktest --secret GITHUB_TOKEN="github_token" --secret fastly_token="$fastly_token"
16-
else
17-
echo "USAGE: ./_test_integration_tests.sh [Github Personal Access Token to clone https://github.com/fastly/compute-sdk-ci-github-action] [Optional, Only if you want to test C@E Environment: Fastly Token for deploying to C@E services]"
12+
github-token Github Personal Access Token to clone https://github.com/fastly/compute-sdk-ci-github-action
13+
fastly-token Optional, Only if you want to test C@E Environment: Fastly Token for deploying to C@E services"
14+
EOF
15+
exit 1
1816
fi
1917

18+
github_token="$1"
19+
fastly_token="${2:-}"
20+
21+
echo "Running act to test integration tests with:"
22+
echo "Github Personal Access Token: $github_token"
23+
echo "Fastly Token: $fastly_token"
24+
act -j sdktest --secret GITHUB_TOKEN="$github_token" --secret fastly_token="$fastly_token"

0 commit comments

Comments
 (0)