Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 2.1 KB

testing.md

File metadata and controls

70 lines (50 loc) · 2.1 KB

Testing Adaguc-server

Adaguc contains two types of tests:

  • Tests specifically for adaguc-server
  • Tests specifically for the Python wrapper/EDR functionality

During the tests, adaguc can use either the SQLite or PostgreSQL backend.

Running tests in Docker via SQLite

The main Dockerfile contains a test stage which executes runtests.sh. This means that all tests will be executed during a regular docker build. Running the tests in Docker is recommended especially for users that don't run Linux/amd64.

To run all tests, trigger a build:

docker build --progress plain -t adaguc-server .

The build will fail if any of the tests have failed.

Running tests outside Docker via SQLite

Running the tests outside of Docker is possible by executing the ./runtests.sh script.

⚠️ Note: some tests might fail due to platform architecture differences between amd64 and arm64.

Using postgres

To run the tests against Postgres, the following needs to happen:

  • The adaguc XML configuration files used by tests all require a <DataBase parameters="{ADAGUC_DB}"/> section. This gets handled by starttests_psql.sh
  • PostgreSQL must be reachable on port 5432.

Via Docker

To do this through Docker, follow these steps:

  1. Edit docker-compose.yml
  2. Comment out all servers that are not adaguc-db
  3. Add the ports section to the adaguc-db service to expose port 5432:
  adaguc-db:
    (...)
    ports:
      - 5432:5432
  1. Start postgres while inside the ./Docker directory:
docker compose up -d
  1. Edit ./Dockerfile, to enable the runtests_psql.sh:
# RUN bash runtests.sh
RUN bash runtests_psql.sh
  1. Trigger a new build:
docker build --progress plain -t adaguc-server .

All tests should now run against postgres via the docker build.

Without Docker

To run the tests outside of Docker, make sure Postgres is reachable on port 5432, and then execute the test script directly:

./runtests_psql.sh

⚠️ Note: some tests might fail due to platform architecture differences between amd64 and arm64.