Skip to main content

Running Server Tests Locally

Server integration tests run against PostgreSQL by default using Docker containers managed by Testcontainers. No additional flags are needed — ./gradlew test -x webapp uses PostgreSQL automatically. The Gradle test task pulls the necessary Docker images and starts the containers.

Prerequisites​

Before running server tests, make sure you have a working Docker setup:

  1. Install Docker Desktop or Docker Engine and Docker CLI.
  2. Enable remote access for the Docker daemon.

Executing Tests from IntelliJ​

You can execute the database tests by running the run configurations provided in the repository:

  • For PostgreSQL tests (recommended): Artemis Server Tests Postgres
  • For MySQL tests: Artemis Server Tests MySQL (deprecated, removed together with MySQL support in Artemis 11)

Creating a Custom Configuration​

Alternatively, you can create a custom configuration.

An example of IntelliJ run configuration for starting Postgres server tests
IntelliJ run configuration for Postgres server tests

Executing Tests from the Console​

PostgreSQL Tests (default)​

./gradlew test -x webapp

MySQL Tests​

MySQL support is deprecated and removed in Artemis 11 (see Planned removals in Artemis 11), together with this task.

./gradlew testMysql -x webapp

H2 Tests (in-memory, no Docker needed)​

For quick local iteration without Docker, you can run tests against H2. Note that H2 may not catch all Postgres-specific issues.

./gradlew test -x webapp -Dzonky.test.database.type=H2
Search documentation