graphql-engine/scripts/make/tests.mk
Samir Talwar 778b1bae2b Fun improvements to Makefiles, with the intent of re-using test-infrastructure.mk.
I intend to use the Make targets around starting and stopping backend databases in order to wrap the Python integration tests in targets.

To that end, I have:

1. Factored out test infrastructure targets into _test-infrastructure.mk_.
2. Actually run the functions from _util.sh_; previously we were just running a bash script with no explicit commands. _util.sh_ must be `source`d and then you invoke the relevant function.
3. Run `docker-compose` through Nix if possible.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5136
GitOrigin-RevId: d7a01958045a82199c969ec3f88387d7d76d254b
2022-07-22 10:57:23 +00:00

26 lines
1.0 KiB
Makefile

.PHONY: test-bigquery
## test-bigquery: run tests for BigQuery backend
# will require some setup detailed here: https://github.com/hasura/graphql-engine-mono/tree/main/server/tests-hspec#required-setup-for-bigquery-tests
test-bigquery: start-postgres remove-tix-file
$(call stop_after, \
cabal run tests-hspec -- -m 'BigQuery')
.PHONY: test-sqlserver
## test-sqlserver: run tests for SQL Server backend
test-sqlserver: start-postgres start-sqlserver remove-tix-file
$(call stop_after, \
cabal run tests-hspec -- -m 'SQLServer')
.PHONY: test-mysql
## test-mysql: run tests for MySQL backend
test-mysql: start-postgres start-mysql remove-tix-file
$(call stop_after, \
cabal run tests-hspec -- -m 'MySQL')
.PHONY: test-backends
## test-backends: run tests for all backends
# BigQuery tests will require some setup detailed here: https://github.com/hasura/graphql-engine-mono/tree/main/server/tests-hspec#required-setup-for-bigquery-tests
test-backends: start-backends remove-tix-file
$(call stop_after, \
cabal run tests-hspec)