홈>
Bitbucket을 사용하여 테스트 스위트를 자동으로 실행하도록 파이프 라인을 설정하려고합니다.
불행히도 저는 Docker와 파이프 라인에 완전히 익숙하지 않습니다. 이 기사 를 읽은 후시험 및 오류이bitbucket-pipelines.yml
를 생각해 냈습니다.
구성 :
image: php:7.2.17
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip zlib1g-dev sqlite3 libsqlite3-dev
- docker-php-ext-install zip && docker-php-ext-install pdo_sqlite && docker-php-ext-install pdo_mysql
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- vendor/bin/simple-phpunit
문제는이 구성에 여전히 오류가 표시된다는 것입니다.
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
In ConnectionFactory.php line 79:
An exception occured while establishing a connection to figure out your pla
tform version.
You can circumvent this by setting a 'server_version' configuration value
For further information have a look at:
https://github.com/doctrine/DoctrineBundle/issues/673
In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 31:
SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] Connection refused
MySQL을 사용하여 연결하려고하는 이유는 무엇입니까? 테스트 만 실행해서는 안됩니까? 프로젝트 실행 또는 배포 가능한 버전이 필요하지 않으며 SQLite 및 단위 테스트를 사용하여 테스트 스위트를 실행하면됩니다.
- 답변 # 1
- 답변 # 2
이 예를 참조하십시오 :
# This is a sample build configuration for PHP. # Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples. # Only use spaces to indent your .yml configuration. # ----- # You can specify a custom docker image from Docker Hub as your build environment. image: medtrainermx/php:5.6 pipelines: branches: '**': - step: name: "Build" caches: - composer script: - cp symfony/app/config/local.yml.dist symfony/app/config/local.yml - cp symfony/tests/config.local.php.dist symfony/tests/config.local.php - cd symfony/tests - composer install artifacts: - build/** - symfony/vendor/** - symfony/app/config/local.yml - symfony/app/cache/** - symfony/tests/vendor/** - symfony/tests/config.local.php - step: name: "Coding Standards" caches: - composer script: - cd symfony - mkdir app/cache - ./bin/phpcs --cache=app/cache/.phpcs-cache - step: name: "Unit Tests" services: - mysql caches: - composer script: - cd symfony - ./bin/phpunit --testsuite=unit --debug definitions: services: mysql: image: mysql:5.7 environment: MYSQL_DATABASE: 'test' MYSQL_ROOT_PASSWORD: 'password'
이 구성에서는 비트 버킷 파이프 라인에서 사용하기 위해 내 이미지를 사용합니다
관련 자료
- php - sqlite로 phpunit을 실행할 때 조명기의 심포니 문제
- pipe - Bitbucket 파이프 라인에서 Zip 제거 형식 생성
- docker - Bitbucket 파이프 라인, 다른 컨테이너에 어떻게 액세스 할 수 있습니까?
- node.js - Typescript/Webpack에 대한 Bitbucket 파이프 라인에서 NodeJS 힙 (--max-old-space-size)을 늘리는 방법은 무엇입니까?
- 비트 버킷 파이프 라인 이중 캐싱이 작동하지 않음
- bash : Bitbucket 파이프 라인 : 에코 환경 변수
- node.js - 공유 호스팅에서 비트 버킷 파이프 라인이있는 ssh에서 npm 명령을 찾을 수 없음
- php - sonarcloud 지점에는 코드 줄이 없습니다비트 버킷 파이프 라인 - sonarsource/sonarcloud-scan
- jgit - 비트 버킷 파이프 라인에서 git 태그를 푸시 하시겠습니까?
- 나이트 워치 + 웹팩 개발 서버 + 비트 버킷 파이프 라인
- ssh - BitBucket 파이프 라인 및 DigitalOcean 권한 거부
- git - Bitbucket 파이프 라인 웹팩 빌드 및 ftp는 서버에 NO JS OUTPUT을 배치하지 않습니다
- php - PHPUnit 651 Symfony 34 버튼 문제로 기능 테스트
- msbuild - Bitbucket Pipelines에서 하위 폴더를 만드는 방법
- phpunit - http 오류로 렌더링 된 symfony 예외를보고하지 않음
- Bitbucket에서 이전 파이프 라인의 아티팩트 재사용
- Bitbucket Pipelines에서 단계 실패를 방지하는 방법은 무엇입니까?
- php - PHPUnit이 테스트를 찾지 못했습니다심포니 518
- continuous integration - Bitbucket 파이프 라인에서 Cypress를 실행하면 크롬을 찾지 못함
관련 질문
- Symfony PHPUnit -모든 테스트 후에만 데이터베이스 새로 고침
- PHP에서 아래 결과에 맞는 배열을 작성하는 방법
- php : Symfony 5는 프로덕션에서 YAML을 구문 분석하는 데 많은 시간을 할애합니다.
- php : app()->make로 만든 모의 클래스
- php : Symfony 3.4를 사용하는 저장소 클래스에 대한 원시 쿼리
- php : Symfony 의미 오류 -필드 또는 연결이 없습니다.
- php : symfony/symfony는 symfony/process를 대체하므로 공존할 수 없습니다.
- 오류: "AppKernel" 클래스가 존재하지 않거나 PHP Symfony를 자동 로드할 수 없습니다.
- php : Symfony: 동적으로 수정된 양식의 문제
- Symfony 5.4에서 php-amqplib/rabbitmqbundle** 생산자를 서비스로 등록하면 오류 메시지가 계속 생성됨
교리는 MySQL/PostgreSQL 버전을 추측하려고합니다. 따라서 어댑터를 만들 때 데이터베이스에 연결하려고합니다.
이 구성은 구성에서 구체적 버전을 구성하여 회피 할 수 있습니다.
이 "문제"에 대한 자세한 정보는 Doctrine DBAL 구성 문서의 구성 개요 아래에있는 알림에서 확인할 수 있습니다.
server_version
만 추가config_test.yaml
로 문제를 해결하려면