I’d like to parallelize our Rails tests to speed up our build times, but am unsure how to go about doing it given that we run our tests in what I’ll call a double Docker setup - in their own container, inside a container created via the machine
executor.
I’m unsure if either of the parallelization options listed here - either via the CLI or environment variables - will work given that my Docker container will not have full access to the connections and resources of the outer CircleCI container, and if not, what I can do to get it going.
---
version: 2
jobs:
build_and_test:
machine:
image: circleci/classic:latest
working_directory: ~/company
steps:
- checkout
- run: docker-compose up -d && sleep 60
# Run the rails tests
- run:
name: Run Rspec tests
command: |
docker exec company_app_1 bash -c 'RUBYOPT="-W0" bin/rspec \
--exclude 'features/**/*' \
--deprecation-out /tmp/rspec/deprecations.txt \
--format documentation \
--format RspecJunitFormatter \
--out /tmp/rspec/rspec.xml'
workflows:
version: 2
build_and_test:
jobs:
- build_and_test