mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
dev.sh: support running only integration tests or haskell/unit tests individually
This commit is contained in:
parent
256be84dba
commit
505ea4deef
@ -34,10 +34,12 @@ Available COMMANDs:
|
||||
Launch a postgres container suitable for use with graphql-engine, watch its logs,
|
||||
clean up nicely after
|
||||
|
||||
test [pytest_args...]
|
||||
Run the integration tests, handling spinning up all dependencies. This will force
|
||||
a recompile. A code coverage report will be generated. All arguments after 'test'
|
||||
will be passed to the 'pytest' invocation.
|
||||
test [--integration [pytest_args...] | --unit]
|
||||
Run the unit and integration tests, handling spinning up all dependencies.
|
||||
This will force a recompile. A code coverage report will be generated.
|
||||
Either integration or unit tests can be run individually with their
|
||||
respective flags. With '--integration' any arguments that follow will be
|
||||
passed to the pytest invocation
|
||||
|
||||
EOL
|
||||
exit 1
|
||||
@ -64,7 +66,24 @@ case "${1-}" in
|
||||
postgres)
|
||||
;;
|
||||
test)
|
||||
PYTEST_ARGS="${@:2}"
|
||||
case "${2-}" in
|
||||
--unit)
|
||||
RUN_INTEGRATION_TESTS=false
|
||||
RUN_UNIT_TESTS=true
|
||||
;;
|
||||
--integration)
|
||||
PYTEST_ARGS="${@:3}"
|
||||
RUN_INTEGRATION_TESTS=true
|
||||
RUN_UNIT_TESTS=false
|
||||
;;
|
||||
"")
|
||||
RUN_INTEGRATION_TESTS=true
|
||||
RUN_UNIT_TESTS=true
|
||||
;;
|
||||
*)
|
||||
die_usage
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
die_usage
|
||||
@ -312,9 +331,13 @@ elif [ "$MODE" = "test" ]; then
|
||||
launch_postgres_container
|
||||
wait_docker_postgres
|
||||
|
||||
# These also depend on a running DB:
|
||||
if [ "$RUN_UNIT_TESTS" = true ]; then
|
||||
echo_pretty "Running Haskell test suite"
|
||||
HASURA_GRAPHQL_DATABASE_URL="$DB_URL" $TEST_INVOCATION --coverage
|
||||
fi
|
||||
|
||||
if [ "$RUN_INTEGRATION_TESTS" = true ]; then
|
||||
echo_pretty "Starting graphql-engine"
|
||||
GRAPHQL_ENGINE_TEST_LOG=/tmp/hasura-dev-test-engine.log
|
||||
export HASURA_GRAPHQL_SERVER_PORT=8088
|
||||
@ -380,6 +403,7 @@ elif [ "$MODE" = "test" ]; then
|
||||
echo
|
||||
stack hpc report graphql-engine.tix
|
||||
rm graphql-engine.tix
|
||||
fi
|
||||
|
||||
else
|
||||
echo "impossible; fix script."
|
||||
|
Loading…
Reference in New Issue
Block a user