-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fail the test-example.sh if go test fail, but after post.sh got executed #92
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,8 @@ fi | |
echo "==> go test" | ||
echo $TEST_TIMEOUT | ||
terraform version | ||
go test -v -timeout=$TEST_TIMEOUT -run TestExample -- | ||
test_failed=false | ||
go test -v -timeout=$TEST_TIMEOUT -run TestExample || test_failed=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will go test return a none 0 exit code if it fails? Is that how this will work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, once |
||
|
||
# change dir back into the example and run post.sh if it exists | ||
cd "$AVM_MOD_PATH/examples/$AVM_EXAMPLE" | ||
|
@@ -37,3 +38,8 @@ if [ -f post.sh ]; then | |
chmod +x ./post.sh | ||
./post.sh | ||
fi | ||
|
||
if [ "$test_failed" = true ]; then | ||
echo "==> Test failed" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was
--
doing before?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is a mistake.