Integration tests for DECODE OpenCloud.
Requirements
- Docker and docker-compose installed.
- Repositories locally cloned (and checked out to the branch to run)
- AWS Cognito
- User pool with public client;
- Worker user in the user pool (i.e., member of a "workers" group);
- To run the integration tests: user in the user pool (i.e., member of a "users" group). Note that this could be the same as the worker user.
How to start
- Copy
.env.exampleto.envand fill it out accordingly. - Run
docker compose up(ordocker compose up -dto have it run in the background anddocker compose downto stop it).
Notes
- It can happen that environment variables are not updated between successive runs.
To avoid this, open a new terminal if you change the environment variables in
docker-compose.yaml. - The frontend will be available only on
http://localhost:8080, not onhttp://127.0.0.1:8080, because of CORS settings.
Execution modes:
- Locally
poetry installcp .env.example .envand fill out.envappropriatelypoetry run pytest tests/ <options>
- Github
- Trigger the
Run testsaction
- Trigger the
Execution environments:
- Local (
--local): locally deployed services usingdocker-compose.yaml - Dev (
--dev): services deployed on AWS dev stack - Prod (
--prod): services deployed on AWS prod stack The Dev and Prod environment require the AWS Infrastructure to be deployed.
Worker configuration:
Use --cloud to run the test jobs on cloud (AWS) workers.
This is not possible with locally deployed services.
Use --gpu to run the test jobs with a GPU.
This is not possible with locally deployed services.
Test flow:
- [Gets ID token to authenticate.]
- Checks that the files to upload do not exist.
- Uploads configuration and data (2-step: get pre-signed url, post to pre-signed url).
- Gets the list of files, checks that the uploaded files are there.
- Starts a job, tests that it is
queued. - Waits at most 10 minutes for the status to be changed to
pulled. - Waits at most 10 minutes for the status to be changed to
preprocessing. - Waits at most 10 minutes for the status to be changed to
running. - Waits at most 30 minutes for the status to be changed to
postprocessing. - Waits at most 10 minutes for the status to be changed to
finished. - Downloads the output
param_run_in.yaml(2-step pre-signed url, get from pre-signed url), checks that a.ptfile is present in the output. - Deletes the ran job.
- Deletes the input/output files of the job.
Run poetry run docker-cleanup to clean-up the space taken up by docker for these tests.