* Bye-bye, Jest * Clean-up non-null assertions for PORT * Test all vendors * Consistent file names * Try with MSSQL 2022 * Revert "Try with MSSQL 2022" This reverts commitda807c6ec8. * Try to run on Windows for better MSSQL perf * Worth a try (hopefully runs MSSQL faster this way) * Start docker services via bash * Quick attempt with local installation of MSSQL * Test with MSSQL 2019 * Back to ubuntu-latest for other tests * Add typecheck cmd * Revert "Test all vendors" This reverts commitd6fbdd76c9. * Use TS for Vitest config file * Simplify vendors typecasting --------- Co-authored-by: ian <licitdev@gmail.com>
Blackbox tests
Setup
Make sure the containers for the databases are running by running docker compose up in this folder.
Directus needs to be deployed with pnpm --filter directus deploy --prod dist. When using the test:blackbox script in
the workspace root (pnpm -w run test:blackbox) this is already done.
Running tests locally
Run pnpm -w run test:blackbox to run the blackbox tests for every supported database vendor.
Prepend TEST_SAVE_LOGS=trace to get trace logs at server-logs-* in this folder.
Testing a specific database
Provide a csv of database drivers in the TEST_DB environment variable to test specific databases:
TEST_DB=cockroachdb pnpm -w run test:blackbox
Using an existing Directus instance
The test suite will spin up a fresh copy of the Directus API from the current build. To use an already running copy of
Directus, set the TEST_LOCAL flag:
TEST_DB=cockroachdb TEST_LOCAL=true pnpm -w run test:blackbox
This will use 127.0.0.1:8055 as the URL for every test. Note: make sure to connect your local Directus database
instance to the test database container found in docker-compose in this folder.