Skip to content

Instantly share code, notes, and snippets.

@zdravko-il
Created March 20, 2023 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdravko-il/d10099d652d5fede340771f6ae686338 to your computer and use it in GitHub Desktop.
Save zdravko-il/d10099d652d5fede340771f6ae686338 to your computer and use it in GitHub Desktop.
e2etest-job:
stage: e2etest
only:
- branches
image: zyanakiev/snowpark-devops:latest
script:
- |
jq -c -r '.assertions[]' tests/e2e_tests.json | while read test; do
name=$(jq -r '.name' <<< $test)
sql=$(jq -r '.value' <<< $test)
echo "Running test: $name"
rowCount=$(~/bin/snowsql -s $SF_SCHEMA -q "$sql" -o friendly=false -o exit_on_error=true -o output_format=json -o timing=false | jq '. | length')
if [[ $rowCount -ne 0 ]]; then
echo "Test failed! $rowCount rows returned" 1>&2
exit 1
else
echo "Test Passed! $rowCount rows returned"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment