Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used exec to run tests in existing container #11

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Used exec to run tests in existing container #11

merged 3 commits into from
Jul 30, 2024

Conversation

allouis
Copy link
Collaborator

@allouis allouis commented Jul 30, 2024

The idea here is to simplify and streamline the dev stack. So rather than a separate docker-compose file for testing, and spinning up new containers we can run the tests in the existing activitypub container we use, which also has the local src files mounted.

yarn dev will start the stack as usual, but now it does it as a daemon, which means it runs in the background. We also pass the --no-recreate flag which ensures that running it multiple times doesn't destroy the container and is essentially idempotent.

yarn logs will tail the activitypub logs for the container

yarn test uses the exec docker compose command to run the tests, and also calls yarn dev first - which makes sure the stack is running if it wasn't already.

The idea here is to simplify and streamline the dev stack. So rather than a
separate docker-compose file for testing, and spinning up new containers we can
run the tests in the existing activitypub container we use, which also has the
local src files mounted.

`yarn dev` will start the stack as usual, but now it does it as a daemon, which
means it runs in the background. We also pass the --no-recreate flag which
ensures that running it multiple times doesn't destroy the container and is
essentially idempotent.

`yarn logs` will tail the activitypub logs for the container

`yarn test` uses the `exec` docker compose command to run the tests, and also
calls `yarn dev` first - which makes sure the stack is running if it wasn't
already.
Copy link
Member

@mike182uk mike182uk left a comment

Choose a reason for hiding this comment

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

Tested locally, works as expected 👍

@allouis allouis merged commit 593a935 into main Jul 30, 2024
1 check passed
@allouis allouis deleted the docker-tests branch July 30, 2024 09:25
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