Skip to content

Commit

Permalink
Merge 9b03b1c into 4dca25a
Browse files Browse the repository at this point in the history
  • Loading branch information
ravichdev committed Jun 2, 2020
2 parents 4dca25a + 9b03b1c commit 96a45dc
Show file tree
Hide file tree
Showing 8 changed files with 13,291 additions and 9,224 deletions.
6 changes: 6 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ module.exports = {
test: {
plugins: [ 'transform-require-context' ],
},
e2e: {
plugins: [ 'istanbul' ],
},
development: {
plugins: [ 'istanbul' ],
},
},
};
58 changes: 32 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,38 @@ jobs:
- npm run lint

- stage: unit-test
name: PHP unit tests (7.4, WordPress latest, with code coverage)
name: E2E tests with Docker (7.4, WordPress latest, with code coverage)
php: "7.4"
env: NODE_ENV=e2e WP_VERSION=latest
before_install:
- nvm install
- nvm use
- unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
before_script:
- sudo service mysql stop
- echo "Running E2E tests without code coverage ..."
script:
- npm run env:start
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password --admin_email=admin@example.com --skip-email --url=http://localhost:8088 --quiet
- npm run wp -- wp plugin activate unsplash
- npm run build:js
- npm run test:e2e:coveralls
after_script:
- echo "E2E tests complete"

- name: JS unit tests (7.4, WordPress latest, with code coverage)
php: "7.4"
env: WP_VERSION=latest
before_script:
- sudo service mysql stop
- echo "Running JS unit tests with code coverage ..."
script:
- npm run build:js
- npm run test:js:coveralls
after_script:
- echo "JS unit tests complete"

- name: PHP unit tests (7.4, WordPress latest, with code coverage)
php: "7.4"
env: WP_VERSION=latest DEV_LIB_ONLY=phpunit,coverage PHPUNIT_VERSION=6
before_script:
Expand Down Expand Up @@ -110,31 +141,6 @@ jobs:
php: "5.6"
env: WP_VERSION=trunk DEV_LIB_ONLY=phpunit

- name: JS unit tests (7.4, WordPress latest, without code coverage)
php: "7.4"
before_script:
- echo "Running JS unit tests without code coverage ..."
script:
- npm run build:js
- npm run test:js

- stage: e2e-test
name: E2E tests with Docker (7.4, WordPress latest)
php: "7.4"
before_install:
- nvm install
- nvm use
- unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
before_script:
- sudo service mysql stop
- echo "Running E2E tests without code coverage ..."
script:
- npm run env:start
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password --admin_email=admin@example.com --skip-email --url=http://localhost:8088 --quiet
- npm run wp -- wp plugin activate unsplash
- npm run build:js
- npm run test:e2e:ci

- stage: deploy to staging
if: (NOT type IN (pull_request))
script: skip
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"phpunit"
],
"test-coverage": [
"phpunit --coverage-html tests/coverage/html"
"phpunit --coverage-html tests/coverage/phpunit"
]
},
"extra": {
Expand Down
Loading

0 comments on commit 96a45dc

Please sign in to comment.