Fix test coverage issue

pull/20/head
Vinícius Garcia 2022-03-27 10:16:47 -03:00
parent 1ce6aa9634
commit c2c8d02a1b
1 changed files with 6 additions and 2 deletions

View File

@ -1,16 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cmd=$@
# Update go.mod with replace so testing will # Update go.mod with replace so testing will
# run against the local version of ksql: # run against the local version of ksql:
echo "replace github.com/vingarcia/ksql => ../../" >> go.mod echo "replace github.com/vingarcia/ksql => ../../" >> go.mod
go mod tidy go mod tidy
go test
# Run the input command:
eval $cmd
# Save whether the tests succeeded or not: # Save whether the tests succeeded or not:
tests_succedeed=$? tests_succedeed=$?
# Undo the changes: # Undo the changes:
git checkout go.mod go.sum > /dev/null git checkout go.mod go.sum > /dev/null 2>&1
# Return error if the tests failed: # Return error if the tests failed:
test $tests_succedeed -eq 0 test $tests_succedeed -eq 0