We have a circleci config something like this (pasting only the core part of it):
commands:
setup_docker:
steps:
- setup_remote_docker:
docker_layer_caching: true
version: default
- run:
name: Authenticate with hub.docker.com
command: docker login -u $GLOBAL_DOCKERHUB_USERNAME -p $GLOBAL_DOCKERHUB_PASSWORD
setup:
steps:
- setup_docker
- checkout
- run:
name: Make sure we are on HEAD
command: ensure_head
- run:
name: Ensure clean slate
command: ci down --remove-orphans
build_image:
steps:
- run:
name: Build CI image
command: |
ci build --build-arg BUNDLE_DELIVEROO__JFROG__IO
ci tag
jobs:
test_image:
<<: *defaults
parallelism: 6
resource_class: large
steps:
- setup
- build_image
- run:
name: Wait for Redis to start
command: |
ci run --rm wait wfi redis:6379 --timeout=60
- run:
name: Wait for DB to start
command: |
ci run --rm wait wfi postgres:5432 --timeout=60
- run:
name: DB setup
command: |
ci run --rm app bundle exec rails db:create db:schema:load db:migrate
- run:
name: Run tests
command: |
ci run app bundle exec rspec \
--format RspecJunitFormatter \
--out rspec/results.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
- run:
name: Export test results from container
when: always
command: |
mkdir -p $(pwd)/rspec
docker cp app/rspec/results.xml $(pwd)/rspec/results.xml
- store_test_results:
path: rspec
When we run this on our pipeline occasionally, we see that loading of the test files fail. ie
An error occurred while loading ./spec/requests/policy_engine/v1/decisions_request_spec.rb. - Did you mean?
rspec ./spec/requests/policy_engine/decisions_request_spec.rb
rspec ./spec/requests/policy_engine/v1/policies_request_spec.rb
rspec ./spec/requests/policy_engine/v1/archives_request_spec.rb
Failure/Error: __send__(method, file)
LoadError:
cannot load such file -- /app/spec/requests/policy_engine/v1/decisions_request_spec.rb
But we never observe this behaviour when running the test without test splitting. May I know how I can investigate more? or if this is a an already known issue?