Merge pull request #251 from shikorism/schedule-ci

定期的に実際のリクエストを伴うMetadataResolverのテストを実行する
This commit is contained in:
shibafu 2019-08-10 12:36:31 +09:00 committed by GitHub
commit f7c9e83b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 97 additions and 8 deletions

View File

@ -1,6 +1,6 @@
version: 2 version: 2.1
jobs: executors:
build: build:
docker: docker:
- image: circleci/php:7.1-node-browsers - image: circleci/php:7.1-node-browsers
@ -17,38 +17,75 @@ jobs:
POSTGRES_DB: tissue POSTGRES_DB: tissue
POSTGRES_USER: tissue POSTGRES_USER: tissue
POSTGRES_PASSWORD: tissue POSTGRES_PASSWORD: tissue
commands:
initialize:
steps: steps:
- checkout - checkout
- run: sudo apt update - run: sudo apt update
- run: sudo apt install -y libpq-dev - run: sudo apt install -y libpq-dev
- run: sudo docker-php-ext-install zip - run: sudo docker-php-ext-install zip
- run: sudo docker-php-ext-install pdo_pgsql - run: sudo docker-php-ext-install pdo_pgsql
restore_composer:
steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-dependencies-{{ checksum "composer.json" }} - v1-dependencies-{{ checksum "composer.json" }}
- v1-dependencies- - v1-dependencies-
- run: composer install -n --prefer-dist save_composer:
steps:
- save_cache: - save_cache:
key: v1-dependencies-{{ checksum "composer.json" }} key: v1-dependencies-{{ checksum "composer.json" }}
paths: paths:
- ./vendor - ./vendor
restore_npm:
steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-dependencies-{{ checksum "package.json" }} - v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies- - v1-dependencies-
- run: yarn install save_npm:
steps:
- save_cache: - save_cache:
key: v1-dependencies-{{ checksum "package.json" }} key: v1-dependencies-{{ checksum "package.json" }}
paths: paths:
- ./node_modules - ./node_modules
- ~/.yarn - ~/.yarn
- run: php artisan migrate jobs:
build:
executor: build
steps:
- initialize
- restore_composer
- run: composer install -n --prefer-dist
- save_composer
- restore_npm
- run: yarn install
- save_npm
- run: yarn run prod - run: yarn run prod
- persist_to_workspace:
root: .
paths:
- public
test:
executor: build
steps:
- initialize
- restore_composer
- restore_npm
- attach_workspace:
at: .
- run: php artisan migrate
# Run linter # Run linter
- run: - run:
command: | command: |
@ -79,3 +116,51 @@ jobs:
- run: - run:
command: bash <(curl -s https://codecov.io/bash) -f /tmp/phpunit/coverage.xml command: bash <(curl -s https://codecov.io/bash) -f /tmp/phpunit/coverage.xml
when: always when: always
test_resolver:
executor: build
environment:
TEST_USE_HTTP_MOCK: false
steps:
- initialize
- restore_composer
- attach_workspace:
at: .
- run: php artisan migrate
# Run unit test
- run:
command: |
mkdir -p /tmp/phpunit
./vendor/bin/phpunit --testsuite MetadataResolver --log-junit /tmp/phpunit/phpunit.xml --coverage-clover=/tmp/phpunit/coverage.xml
when: always
- store_test_results:
path: /tmp/phpunit
- store_artifacts:
path: /tmp/phpunit/coverage.xml
workflows:
version: 2.1
test:
jobs:
- build
- test:
requires:
- build
scheduled_resolver_test:
triggers:
- schedule:
cron: "4 0 * * 1"
filters:
branches:
only:
- develop
jobs:
- build
- test_resolver:
requires:
- build

View File

@ -16,6 +16,10 @@
<testsuite name="Unit"> <testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory> <directory suffix="Test.php">./tests/Unit</directory>
</testsuite> </testsuite>
<testsuite name="MetadataResolver">
<directory suffix="Test.php">./tests/Unit/MetadataResolver</directory>
</testsuite>
</testsuites> </testsuites>
<filter> <filter>
<whitelist processUncoveredFilesFromWhitelist="true"> <whitelist processUncoveredFilesFromWhitelist="true">