2022-08-03 14:05:59 +03:00
# ghcid gets its own cache
2023-01-30 19:04:56 +03:00
GRAPHQL_ENGINE_PATH = $( shell cabal list-bin exe:graphql-engine)
2023-02-01 15:33:31 +03:00
2023-06-07 15:18:37 +03:00
GHC_OPTIONS = -Wno-prepositive-qualified-module -Wno-missing-export-lists -O0
CABAL_REPL_FLAGS = --builddir ./dist-newstyle/repl --ghc-options= \" $( GHC_OPTIONS) \"
2023-06-13 20:20:25 +03:00
GHCID_FLAGS ?= --no-height-limit
2022-08-03 14:05:59 +03:00
2022-10-04 11:30:09 +03:00
d e f i n e r u n _ g h c i d _ a p i _ t e s t s
2022-08-03 14:05:59 +03:00
@if [ [ $$ ( uname -p) = = 'arm' ] ] ; then \
2023-06-07 15:18:37 +03:00
HASURA_TEST_BACKEND_TYPE = " $( 2) " GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) ghcid -c " DYLD_LIBRARY_PATH= $$ {DYLD_LIBRARY_PATH:-} cabal repl $( 1) $( CABAL_REPL_TESTS_FLAGS) " \
--test "main" $( GHCID_FLAGS) ; \
2022-08-03 14:05:59 +03:00
else \
2023-06-07 15:18:37 +03:00
HASURA_TEST_BACKEND_TYPE = " $( 2) " GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) ghcid -c " cabal repl $( 1) $( CABAL_REPL_FLAGS) " \
--test "main" $( GHCID_FLAGS) ; \
2022-08-03 14:05:59 +03:00
fi
e n d e f
2022-07-19 15:19:12 +03:00
2022-08-19 14:22:28 +03:00
d e f i n e r u n _ g h c i d _ m a i n _ t e s t s
@if [ [ $$ ( uname -p) = = 'arm' ] ] ; then \
2023-06-07 15:18:37 +03:00
ghcid -c " DYLD_LIBRARY_PATH= $$ {DYLD_LIBRARY_PATH:-} cabal repl $( 1) $( CABAL_REPL_FLAGS) " \
--test "main" $( GHCID_FLAGS) ; \
2022-08-19 14:22:28 +03:00
else \
2023-06-07 15:18:37 +03:00
ghcid -c " cabal repl $( 1) $( CABAL_REPL_FLAGS) " \
--test "main" $( GHCID_FLAGS) ; \
2022-08-19 14:22:28 +03:00
fi
e n d e f
2022-07-19 15:19:12 +03:00
d e f i n e r u n _ g h c i d
2023-06-07 15:18:37 +03:00
ghcid -c " cabal repl $( 1) $( CABAL_REPL_FLAGS) " $( GHCID_FLAGS) ;
2022-07-19 15:19:12 +03:00
e n d e f
2023-06-23 23:21:24 +03:00
d e f i n e r u n _ g h c i d _ r u n _ m a i n
ghcid -c " cabal repl $( 1) $( CABAL_REPL_FLAGS) " $( GHCID_FLAGS) -r;
e n d e f
2022-07-19 15:19:12 +03:00
.PHONY : ghcid -library
## ghcid-library: build and watch library in ghcid
ghcid-library :
$( call run_ghcid,graphql-engine:lib:graphql-engine)
2022-08-19 14:22:28 +03:00
.PHONY : ghcid -tests
## ghcid-tests: build and watch main tests in ghcid
ghcid-tests :
$( call run_ghcid,graphql-engine:test:graphql-engine-tests)
2022-10-04 11:30:09 +03:00
.PHONY : ghcid -api -tests
## ghcid-api-tests: build and watch api-tests in ghcid
ghcid-api-tests :
2022-12-05 11:29:38 +03:00
$( call run_ghcid,api-tests:lib:api-tests)
2022-07-19 15:19:12 +03:00
2023-06-23 23:21:24 +03:00
.PHONY : ghcid -api -tests -run
## ghcid-api-tests-run: build and watch api-tests in ghcid, and run them
ghcid-api-tests-run : start -api -tests -backends
HASURA_TEST_LOGTYPE = STDOUT \
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
$( call run_ghcid_run_main,api-tests:lib:api-tests)
2022-11-01 18:17:45 +03:00
.PHONY : ghcid -test -harness
## ghcid-test-harness: build and watch test-harness in ghcid
ghcid-test-harness :
$( call run_ghcid,test-harness)
2023-06-29 12:48:50 +03:00
.PHONY : ghcid -pg -client
## ghcid-pg-client: build and watch pg-client in ghcid
ghcid-pg-client :
$( call run_ghcid,pg-client)
2022-12-02 14:35:20 +03:00
.PHONY : ghcid -api -tests -pro
## ghcid-api-tests-pro: build and watch api-tests in pro
ghcid-api-tests-pro :
$( call run_ghcid,api-tests-pro:exe:api-tests-pro)
2022-08-03 14:05:59 +03:00
.PHONY : ghcid -test -backends
2022-10-04 11:30:09 +03:00
## ghcid-test-backends: run all api tests in ghcid
2023-05-23 13:13:50 +03:00
ghcid-test-backends : start -api -tests -backends remove -tix -file
2022-11-15 01:37:09 +03:00
$( call run_ghcid_api_tests,api-tests:exe:api-tests)
2022-08-03 14:05:59 +03:00
2023-01-30 19:04:56 +03:00
.PHONY : ghcid -test -postgres
## ghcid-test-backends: run tests for Postgres backend in ghcid
ghcid-test-postgres : remove -tix -file
docker compose up postgres -d --wait postgres
$( call run_ghcid_api_tests,api-tests:exe:api-tests,Postgres)
2022-08-03 14:05:59 +03:00
.PHONY : ghcid -test -bigquery
## ghcid-test-bigquery: run tests for BigQuery backend in ghcid
2022-10-04 11:30:09 +03:00
# will require some setup detailed here: https://github.com/hasura/graphql-engine-mono/tree/main/server/lib/api-tests#required-setup-for-bigquery-tests
2022-11-03 20:16:29 +03:00
ghcid-test-bigquery : remove -tix -file
docker compose up -d --wait postgres
2022-11-15 01:37:09 +03:00
$( call run_ghcid_api_tests,api-tests:exe:api-tests,BigQuery)
2022-08-03 14:05:59 +03:00
.PHONY : ghcid -test -sqlserver
## ghcid-test-sqlserver: run tests for SQL Server backend in ghcid
2022-11-17 15:55:05 +03:00
ghcid-test-sqlserver : remove -tix -file
docker compose up -d --wait postgres sqlserver{ ,-healthcheck,-init}
2022-11-15 01:37:09 +03:00
$( call run_ghcid_api_tests,api-tests:exe:api-tests,SQLServer)
2022-08-03 14:05:59 +03:00
.PHONY : ghcid -test -citus
## ghcid-test-citus: run tests for Citus backend in ghcid
2022-11-03 20:16:29 +03:00
ghcid-test-citus : remove -tix -file
docker compose -d --wait postgres citus
2022-11-15 01:37:09 +03:00
$( call run_ghcid_api_tests,api-tests:exe:api-tests,Citus)
2022-08-03 14:05:59 +03:00
2022-09-07 18:10:19 +03:00
.PHONY : ghcid -test -cockroach
## ghcid-test-cockroach: run tests for Cockroach backend in ghcid
2022-11-03 20:16:29 +03:00
ghcid-test-cockroach : remove -tix -file
docker compose up -d --wait postgres cockroach
2022-11-15 01:37:09 +03:00
$( call run_ghcid_api_tests,api-tests:exe:api-tests,Cockroach)
2022-09-07 18:10:19 +03:00
2022-08-25 15:08:07 +03:00
.PHONY : ghcid -test -data -connectors
## ghcid-test-data-connectors: run tests for DataConnectors in ghcid
2022-11-03 20:16:29 +03:00
ghcid-test-data-connectors : remove -tix -file
2022-11-17 15:55:05 +03:00
docker compose build
2022-11-03 20:16:29 +03:00
docker compose up -d --wait postgres dc-reference-agent dc-sqlite-agent
2022-11-15 01:37:09 +03:00
$( call run_ghcid_api_tests,api-tests:exe:api-tests,DataConnector)
2022-08-25 15:08:07 +03:00
2022-08-06 03:51:06 +03:00
.PHONY : ghcid -library -pro
## ghcid-library-pro: build and watch pro library in ghcid
ghcid-library-pro :
$( call run_ghcid,graphql-engine-pro:lib:graphql-engine-pro)
2022-08-19 14:22:28 +03:00
.PHONY : ghcid -test -unit
## ghcid-test-unit: build and run unit tests in ghcid
ghcid-test-unit : remove -tix -file
2023-03-15 20:09:24 +03:00
$( call run_ghcid_main_tests,graphql-engine:graphql-engine-tests)