Files
directus/tests/blackbox
Jan Arends 5c8d3d22c6 Reset auto increment sequence (#19328)
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-09-08 11:19:14 +02:00
..
2023-06-08 18:54:50 +00:00
2023-04-14 17:40:50 -04:00
2023-06-08 18:54:50 +00:00
2023-04-11 18:28:37 +02:00

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.