Skip to content

Fix running tests in Docker container#283

Open
J164 wants to merge 1 commit intomainfrom
fix-tests
Open

Fix running tests in Docker container#283
J164 wants to merge 1 commit intomainfrom
fix-tests

Conversation

@J164
Copy link
Member

@J164 J164 commented Mar 17, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 20:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make the Docker-based test workflow more reliable by isolating test containers/resources from the dev stack and improving cleanup behavior.

Changes:

  • Updates yarn test:docker to run tests under a fixed Compose project name and ensure docker compose down -v --remove-orphans runs on exit.
  • Adjusts the test Compose stack to use distinct (and configurable) container names and to mount /app/node_modules.
  • Parameterizes container names in shared Compose files to allow per-environment overrides.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
package.json Updates test:docker script to run in a dedicated Compose project and auto-clean up on exit.
docker-compose.test.yml Uses test-specific (configurable) container names and adds a node_modules volume mount for the test container.
docker-compose.db.yml Makes container names configurable via environment variable substitution.
docker-compose.api.yml Makes the API container name configurable via environment variable substitution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

"test": "jest --config=testing/jest.config.ts",
"test:watch": "jest --config=testing/jest.config.ts --watch",
"test:docker": "docker compose -f docker-compose.test.yml run --rm test yarn test",
"test:docker": "sh -c 'trap \"docker compose -p rp-api-test -f docker-compose.test.yml down -v --remove-orphans\" EXIT; docker compose -p rp-api-test -f docker-compose.test.yml run --rm test yarn test'",
extends:
file: docker-compose.db.yml
service: kong
container_name: ${RP_KONG_CONTAINER_NAME:-rp-test-kong}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants