У меня есть набор тестов RSpe c, который проходит на моей локальной машине. Однако, когда я запускаю спецификации на CircleCI, он терпит неудачу.
Вот выходные данные:
1) Articles GET /articles/:id when article exists when article feedbacked behaves like success response and template behaves like normal request returns 200
Failure/Error: = javascript_pack_tag 'personal_comment/index'
ActionView::Template::Error:
Webpacker can't find personal_comment/index in /home/circleci/project/public/packs-test/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}
Shared Example Group: "normal request" called from ./spec/support/requests/request_macros.rb:14
Shared Example Group: "success response and template" called from ./spec/requests/articles_spec.rb:19
# ./app/views/articles/feedbacked/show.html.haml:37:in `_app_views_articles_feedbacked_show_html_haml___803483453260433823_47067249050920'
Он говорит, что наш манифест пуст, но насколько я могу подтвердить на моей локальной машине он не пустой.
Вот наш конфигурационный файл для CircleCI:
version: 2.1
references:
default_docker_ruby_executor: &default_docker_ruby_executor
image: circleci/ruby:2.6.5-stretch-node
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: root
PGPASSWORD: ""
RAILS_ENV: test
postgres: &postgres
image: circleci/postgres:11.6-alpine
environment:
POSTGRES_USER: root
POSTGRES_DB: app_test
POSTGRES_PASSWORD: ""
jobs:
build:
docker:
- *default_docker_ruby_executor
steps:
- checkout
# bundle cache
- restore_cache:
keys:
- app-bundle-v2-{{ checksum "Gemfile.lock" }}
- app-bundle-v2-
- run:
name: Bundle Install
command: bundle check || bundle install
# Store bundle cache
- save_cache:
key: rewrites-bundle-v2-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# Only necessary if app uses webpacker or yarn in some other way
- restore_cache:
keys:
- app-yarn-{{ checksum "yarn.lock" }}
- app-yarn-
- run:
name: Yarn Install
command: yarn install --cache-folder ~/.cache/yarn
# Store yarn / webpacker cache
- save_cache:
key: app-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
test:
parallelism: 2
docker:
- *default_docker_ruby_executor
- *postgres
steps:
- checkout
- restore_cache:
keys:
- app-bundle-v2-{{ checksum "Gemfile.lock" }}
- app-bundle-v2-
- run:
name: Bundle Install
command: bundle check || bundle install
- restore_cache:
keys:
- rewrites-yarn-{{ checksum "yarn.lock" }}
- rewrites-yarn-
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Database setup
command: bundle exec rails db:schema:load --trace
# Run rspec in parallel
- run:
command: |
mkdir /tmp/test-results
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
bundle exec rspec $TESTFILES --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results
workflows:
version: 2
build_and_test:
jobs:
- build
- test:
requires:
- build
Я думаю, что это связано с Webpacker, но не знаю, что делать.