Skip to content

Commit

Permalink
Merge pull request #385 from zendesk/jury.razumau/docker_compose
Browse files Browse the repository at this point in the history
replace docker-compose with docker compose in tests
  • Loading branch information
razumau authored Nov 19, 2024
2 parents e62b329 + 512d1cc commit 1f687c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
ruby-version: "3.0"
bundler-cache: true
- name: Bring up docker-compose stack
run: docker-compose up -d
run: docker compose up -d
- name: Build and test with RSpec
env:
RACECAR_BROKERS: localhost:9092
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,16 +716,16 @@ apt-get update && apt-get install -y libzstd-dev
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
The integration tests run against a Kafka instance that is not automatically started from within `rspec`. You can set one up using the provided `docker-compose.yml` by running `docker-compose up`.
The integration tests run against a Kafka instance that is not automatically started from within `rspec`. You can set one up using the provided `docker-compose.yml` by running `docker compose up`.
### Running RSpec within Docker
There can be behavioural inconsistencies between running the specs on your machine, and in the CI pipeline. Due to this, there is now a Dockerfile included in the project, which is based on the CircleCI ruby 2.7.8 image. This could easily be extended with more Dockerfiles to cover different Ruby versions if desired. In order to run the specs via Docker:
- Uncomment the `tests` service from the docker-compose.yml
- Bring up the stack with `docker-compose up -d`
- Execute the entire suite with `docker-compose run --rm tests bundle exec rspec`
- Execute a single spec or directory with `docker-compose run --rm tests bundle exec rspec spec/integration/consumer_spec.rb`
- Bring up the stack with `docker compose up -d`
- Execute the entire suite with `docker compose run --rm tests bundle exec rspec`
- Execute a single spec or directory with `docker compose run --rm tests bundle exec rspec spec/integration/consumer_spec.rb`
Please note - your code directory is mounted as a volume, so you can make code changes without needing to rebuild
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ services:
# RACECAR_BROKERS: broker:29092
# DOCKER_SUDO: 'true'
# # When bringing up the stack, we just let the container exit. For running the
# # specs, we'll use commands like `docker-compose run tests rspec`
# # specs, we'll use commands like `docker compose run tests rspec`
# command: ["echo", "ready"]
# volumes:
# # The line below allows us to run docker commands from the container itself
Expand Down

0 comments on commit 1f687c4

Please sign in to comment.