Задать вопрос
@CenterJoin

Ошибка при тестировании: Preparation failed: exit status 1?

Установил раннер на AWS EC2, настроил конфигурацию (показано ниже), но тесты в CI/CD завершаются ошибкой:
Preparing the "docker+machine" executor
 ERROR: Preparation failed: exit status 1
 Will be retried in 3s ...
 ERROR: Preparation failed: exit status 1
 Will be retried in 3s ...
 ERROR: Preparation failed: exit status 1
 Will be retried in 3s ...
 ERROR: Job failed (system failure): exit status 1


.gitlab-ci.yml на сервере gitlab
image: php:7.4

# Cache libraries in between jobs
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - vendor/

before_script:
  - apt-get update -yqq
  - apt-get install -yqq git libzip-dev libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
  # Install PHP extensions
  - docker-php-ext-install exif pdo_pgsql pgsql curl json intl gd xml zip bz2 opcache
  # Install & enable Xdebug for code coverage reports
  - pecl install xdebug
  - docker-php-ext-enable xdebug
  # Install and run Composer
  - curl --show-error --silent "https://getcomposer.org/installer" | php
  - php composer.phar install

UnitTest:
  script:
    - phpdbg -d memory_limit=-1 -qrr vendor/bin/phpunit --config=phpunit.xml.dist
    - XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text --colors=never --configuration phpunit.xml.dist


Мой /etc/gitlab-runner/config.toml на сервере aws
[[runners]]
  name = "unit-test"
  url = "https://gitlab.com/"
  token = "xxx"
  executor = "docker+machine"
  limit = 8
  [runners.docker]
    tls_verify = false
    image = "php:7.4"
    privileged = true
    disable_cache = true
    shm_size = 0
  [runners.cache]
    Type = "s3"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "s3.amazonaws.com"
      AccessKey = "xxx"
      SecretKey = "xxx"
      BucketName = "s3-cache-xxx"
      BucketLocation = "us-east-2"
  [runners.machine]
    MachineDriver = "amazonec2"
    MachineName = "gitlab-ci-machine-%s"
    OffPeakTimezone = ""
    OffPeakIdleCount = 0
    OffPeakIdleTime = 0
    IdleCount = 0
    MachineOptions = [
      "amazonec2-access-xxx",
      "amazonec2-secret-key=xxx",
      "amazonec2-region=us-east-2",
      "amazonec2-vpc-id=vpc-904561f8",
      "amazonec2-subnet-id=subnet-38e71c15",
      "amazonec2-zone=a",
      "amazonec2-use-private-address=true",
      "amazonec2-tags=unit-test",
      "amazonec2-security-group=launch-wizard-2",
      "amazonec2-instance-type=t2.micro",
      "amazonec2-request-spot-instance=true",
      "amazonec2-spot-price=0.05",
      "amazonec2-block-duration-minutes=60"
    ]


И когда я запускаю тесты на aws сервере (gitlab-runner exec docker UnitTest) выдает ошибку
Not a git repository
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>
WARNING: You most probably have uncommitted changes. 
WARNING: These changes will not be tested.         
fatal: not a git repository (or any of the parent directories): .git
FATAL: exit status 128
  • Вопрос задан
  • 776 просмотров
Подписаться 2 Средний Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы