-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,24 +6,74 @@ version: 2.1 | |
orbs: | ||
# use Cypress orb from CircleCI registry | ||
cypress: cypress-io/[email protected] | ||
|
||
executors: | ||
with-chrome: | ||
docker: | ||
- image: 'cypress/browsers:node12.8.1-chrome80-ff72' | ||
- image: 'cypress/browsers:node14.16.0-chrome89-ff86' | ||
workflows: | ||
build: | ||
jobs: | ||
# runs tests using Chrome browser in custom executor (Cypress docker image) | ||
- cypress/install | ||
# runs tests using Chrome browser in custom executor (Cypress docker image) | ||
- cypress/run: | ||
requires: | ||
- cypress/install | ||
start: apt-get install -y sed && circleci tests glob "tests/e2e/*/*.js" | circleci tests split > circleci.tests && sed -i 's/No timing found for "//g' circleci.tests && sed -i 's/"//g' circleci.tests && sed -i 's/tests\/e2e\/plugins\/index.js//g' circleci.tests && sed -i 's/tests\/e2e\/.eslintrc.js//g' circleci.tests && sed -i 's/tests\/unit\/.eslintrc.js//g' circleci.tests && grep "\S" circleci.tests > uno.txt && mv uno.txt circleci.tests && cat circleci.tests && npm rebuild node-sass && npx browserslist@latest --update-db && npm run serve | ||
wait-on: 'http://localhost:8080' | ||
executor: with-chrome | ||
browser: chrome | ||
command: 'npm install -g npm@latest && npm run lint && npm test' | ||
#command: 'npm install -g npm@latest && npm run lint && npm test' | ||
command: 'npm install -g npm@latest && npm run lint && TZ=UTC npx vue-cli-service test:e2e --mode test --headless --browser chrome --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml --spec $(cat circleci.tests | tr "\n" ",")' | ||
parallel: true | ||
parallelism: 10 | ||
post-steps: | ||
- run: mkdir coverage && mv .nyc_output/out.json coverage/coverage-$CIRCLE_NODE_INDEX-$(date +"%s%N").json | ||
- save_cache: | ||
paths: | ||
coverage/ | ||
key: pm-{{ .Environment.CIRCLE_NODE_INDEX }}-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- run: ls -la coverage | ||
- cypress/run: | ||
requires: | ||
- cypress/run | ||
command: npm run test-unit | ||
post-steps: | ||
- restore_cache: | ||
keys: | ||
- pm-0-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-1-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-2-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-3-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-4-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-5-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-6-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-7-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-8-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- restore_cache: | ||
keys: | ||
- pm-9-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json | ||
- run: ls -la coverage && cp jest-coverage/coverage-final.json coverage/from-jest.json | ||
- run: npx nyc merge coverage && mkdir .nyc_output | ||
- run: mv coverage.json .nyc_output/out.json | ||
- run: npx nyc report --reporter html --reporter text --reporter json-summary --report-dir combined-coverage | ||
- store_artifacts: | ||
path: coverage | ||
path: combined-coverage | ||
- store_test_results: | ||
path: test_summary_reports | ||
- store_artifacts: | ||
path: test_summary_reports/mocha/test-results.xml | ||
- store_artifacts: | ||
path: test_summary_reports/jest/junit.xml | ||
path: test_summary_reports |