When using the `remote` mode if Keycloak is not already running the test framework will output the required server
configuration to make it easy to start a correctly configured Keycloak server.
If the `KC_TEST_SERVER_KCW` option is specified the test framework will show a complete command to start Keycloak
using `kcw`. For example setting `KC_TEST_SERVER_KCW=dev-build` will show the command to use `kcw` to build Keycloak
from the local checkout of Keycloak sources and then start Keycloak.
## Database
The test framework supports using a range of different databases when running tests:
*`dev-mem`: In-memory H2 database (default)
*`dev-file`: H2 database with a file for persistence
*`mariadb`: MariaDB test container
*`mssql`: Microsoft SQL Server test container
*`mysql`: MySQL test container
*`oracle`: Oracle test container
*`postgres`: PostgreSQL test container
*`tidb`: TiDb test container
*`remote`: Connect to a remotely running database
The test framework core (`keycloak-test-framework-core`) contains support for `dev-mem`, `dev-file`, and `remote`. To
use other databases add a dependency on the corresponding Maven module (`keycloak-test-framework-db-<dbname>`).
To run tests using a different database use the `KC_TEST_DATABASE` option, for example:
```shell
KC_TEST_DATABASE=postgres mvn test
```
### Re-use
`dev-file` and container based databases supports re-using the database, leaving the database running to enable running
tests faster.
To enable re-use use the `KC_TEST_DATABASE_REUSE=true` option.
For containers, you also have to [enable reuse for Testcontainers](https://java.testcontainers.org/features/reuse/) (`TESTCONTAINERS_REUSE_ENABLE=true`).
### Remote Database
If connecting to a remotely running database is desired, the following options need to be specified: