datahub/smoke-test/smoke.sh

37 lines
1.1 KiB
Bash
Raw Normal View History

2021-04-29 23:27:03 -07:00
#!/bin/bash
set -euxo pipefail
2021-04-29 23:27:03 -07:00
# Runs a basic e2e test. It is not meant to be fully comprehensive,
# but rather should catch obvious bugs before they make it into prod.
#
# Script assumptions:
# - The gradle build has already been run.
# - Python 3.6+ is installed and in the PATH.
2021-04-29 23:27:03 -07:00
# Log the locally loaded images
# docker images | grep "datahub-"
2021-04-29 23:27:03 -07:00
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
if [ "${RUN_QUICKSTART:-true}" == "true" ]; then
source ./run-quickstart.sh
fi
source venv/bin/activate
2021-04-29 23:27:03 -07:00
(cd ..; ./gradlew :smoke-test:yarnInstall)
source ./set-cypress-creds.sh
2023-03-21 09:12:50 -05:00
# no_cypress, cypress_suite1, cypress_rest
if [[ -z "${TEST_STRATEGY}" ]]; then
pytest -rP --durations=20 -vv --continue-on-collection-errors --junit-xml=junit.smoke.xml
else
if [ "$TEST_STRATEGY" == "no_cypress" ]; then
pytest -rP --durations=20 -vv --continue-on-collection-errors --junit-xml=junit.smoke_non_cypress.xml -k 'not test_run_cypress'
else
pytest -rP --durations=20 -vv --continue-on-collection-errors --junit-xml=junit.smoke_cypress_${TEST_STRATEGY}.xml tests/cypress/integration_test.py
fi
fi