Как исправить ошибку CircleCI Permission Denied при выполнении теста - PullRequest
0 голосов
/ 20 июня 2019

Я добавляю параллелизм, добавляя 2 контейнера и разделяя тест по данным времени.До сих пор сборки были в порядке.Но теперь я получаю ошибку «Отказано в доступе» для конкретного теста системы Rails.Я запускаю приложение Rails 5.2 и использую мини-тест.Вот моя конфигурация circleci:

version: 2
jobs:
  build:
    working_directory: ~/my_app
    parallelism: 2

    docker:
      - image: circleci/ruby:2.5-node-browsers
        environment:
          RAILS_ENV: test
          BUNDLE_JOBS: 3
          BUNDLE_RETRY: 3
          BUNDLE_PATH: vendor/bundle
          PGHOST: 127.0.0.1
          PGUSER: test_user

      - image: circleci/postgres:10.4-alpine
        environment:
          POSTGRES_USER: test_user
          POSTGRES_DB: my_app_test
          POSTGRES_PASSWORD: ""

      - image: circleci/redis:4

      - image: circleci/node:jessie-browsers

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "Gemfile.lock" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run:
          name: Install mcrypt library
          command: sudo apt-get install libmcrypt-dev

      - run:
          name: Bundle Install
          command: bundle check || bundle install

      - save_cache:
          paths:
            - ./vendor/bundle
          key: v1-dependencies-{{ checksum "Gemfile.lock" }}

      - run:
          name: Copy secret files
          command: |
            cp config/database.yml.ci config/database.yml
      # Database setup
      # Waits until DB service is available, according to CircleCI docs:
      # https://circleci.com/docs/2.0/language-ruby/#config-walkthrough
      - run:
          name: Wait for DB
          command: dockerize -wait tcp://localhost:5432 -timeout 1m

      - run:
          name: Database Setup
          command: |
            bundle exec rake db:create
            bundle exec rake db:schema:load  

      - run:
          name: Create directy to store test results
          command: mkdir test/reports

      - run:
          name: Download Selenium
          command: curl -O http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar

      - run:
          name: Start Selenium
          command: java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
          background: true

      # https://circleci.com/docs/2.0/parallelism-faster-jobs/#splitting-by-timings-data
      - run:
          name: Run Tests
          command: |
            bundle exec rake test
            bundle exec rake test:system TESTOPTS='--verbose'
            $(circleci tests glob "test/**/*_test.rb" | circleci tests split --split-by=timings)

      # https://circleci.com/docs/2.0/collect-test-data/#minitest
      - store_test_results:
          path: test/reports

Ошибка, которую я получаю:

101 runs, 565 assertions, 0 failures, 0 errors, 2 skips
/bin/bash: line 2: test/system/dashboard_test.rb: Permission denied
Exited with code 126

Нет проблем с правами доступа, если не настроить параллелизм и настроить результаты теста,Я следовал указаниям из документов CircleCI:

Чтоя делаю не так?

...