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.
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 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.
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 bystarttests_psql.sh
- PostgreSQL must be reachable on port
5432
.
To do this through Docker, follow these steps:
- Edit
docker-compose.yml
- Comment out all servers that are not
adaguc-db
- Add the
ports
section to theadaguc-db
service to expose port 5432:
adaguc-db:
(...)
ports:
- 5432:5432
- Start postgres while inside the
./Docker
directory:
docker compose up -d
- Edit
./Dockerfile
, to enable theruntests_psql.sh
:
# RUN bash runtests.sh
RUN bash runtests_psql.sh
- Trigger a new build:
docker build --progress plain -t adaguc-server .
All tests should now run against postgres via the docker build.
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.