feat(workflows): add docker container testing workflow#89
feat(workflows): add docker container testing workflow#89srmanda-cs wants to merge 1 commit intouncch-rdmc:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow intended to build/start the Docker Compose dev stack on develop pushes/PRs and perform a basic readiness check against the Dataverse API.
Changes:
- Introduces
.github/workflows/container_testing_run.ymlto run Docker Compose on CI fordevelop. - Adds an HTTP readiness loop against
http://localhost:8080/api/info/version. - Adds Python/Chrome setup steps (though no tests are executed yet).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set -euo pipefail | ||
| sudo systemctl stop docker || true | ||
| sudo rm -rf /var/lib/docker | ||
| sudo rm -rf /var/lib/containerd |
There was a problem hiding this comment.
Scrub Docker state stops the Docker daemon and wipes Docker/containerd state, but the workflow never starts Docker again. On GitHub-hosted runners this will usually cause the later docker version / docker compose steps to fail; add a systemctl start docker (and wait for readiness) or avoid stopping Docker in the first place.
| sudo rm -rf /var/lib/containerd | |
| sudo rm -rf /var/lib/containerd | |
| sudo systemctl start docker | |
| # Wait for Docker daemon to become ready | |
| for i in {1..30}; do | |
| if docker info >/dev/null 2>&1; then | |
| break | |
| fi | |
| sleep 1 | |
| done |
| run: | | ||
| set -euo pipefail | ||
| python -m pip install --upgrade pip | ||
| pip install -r tests/requirements.txt |
There was a problem hiding this comment.
The workflow installs Python deps from tests/requirements.txt, but that file is not present in the repo, so this step will fail. Update this to an existing dependency source (or add the missing file) before enabling the workflow.
| pip install -r tests/requirements.txt | |
| pip install -r requirements.txt |
| run: | | ||
| google-chrome --version | ||
|
|
||
| # --------------------------- |
There was a problem hiding this comment.
After setting up Python and verifying Chrome, there is no step that actually runs any container/integration/UI tests (the workflow proceeds to shutdown). Add an explicit test execution step here (or remove the Python/Chrome setup if the workflow is only intended as a container smoke-start check).
| # --------------------------- | |
| # --------------------------- | |
| # RUN CONTAINER/UI TESTS | |
| # --------------------------- | |
| - name: Run container/UI tests | |
| run: | | |
| set -euo pipefail | |
| pytest -v | |
| # --------------------------- |
| - name: Start containers | ||
| run: | | ||
| set -euo pipefail | ||
| docker compose -f docker-compose-dev.yml up -d |
There was a problem hiding this comment.
docker-compose-dev.yml is a dev-focused compose file and bind-mounts ./target/dataverse into the container. This workflow never builds/populates ./target/dataverse, so on CI the mount will be empty and will override whatever is in the image at that path, likely preventing the app from deploying and making the readiness check fail. Use a CI-friendly compose file (e.g., without the dev bind mounts) or add the build step that produces the expected artifacts.
What this PR does / why we need it:
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: