Unverified Commit 2fc449d7 authored by Bryce Taylor's avatar Bryce Taylor Committed by GitHub

Merge pull request #5019 from LLK/circleCI-configure-tests

Circle ci configure tests
parents cbdea2aa 177ee69c
......@@ -3,7 +3,7 @@ version: 2.1
aliases:
- &defaults
docker:
- image: circleci/node:12-browsers
- image: cimg/node:12.20.1-browsers
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
......@@ -27,7 +27,6 @@ aliases:
restore_cache:
keys:
- v1-npm-{{ checksum "package-lock.json" }}
- v1-npm-
- &save_build_cache
save_cache:
paths:
......@@ -45,15 +44,33 @@ aliases:
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: "Run npm test to build"
name: "setup"
command: |
npm --production=false ci
mkdir ./test/results
- run:
name: "run lint tests"
command: |
npm run test:lint:ci
- run:
name: "run npm build"
command: |
npm --production=false install
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run test
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
- run:
name: "Run unit tests"
command: |
JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run test:unit:jest:unit -- --reporters=jest-junit
JEST_JUNIT_OUTPUT_NAME=localization-jest-results.xml npm run test:unit:jest:localization -- --reporters=jest-junit
npm run test:unit:tap -- --output-file ./test/results/unit-raw.tap
npm run test:unit:convertReportToXunit
- *save_npm_cache
- *save_git_cache
- *save_build_cache
- store_test_results:
path: test/results
- store_artifacts:
path: build
- &deploy
<<: *defaults
steps:
......@@ -61,41 +78,63 @@ aliases:
- checkout
- *restore_npm_cache
- *restore_build_cache
- run:
name: "setup python"
command: |
curl https://bootstrap.pypa.io/3.5/get-pip.py -o get-pip.py
python3 get-pip.py pip==21.0.1
pip install s3cmd==2.1.0
- run:
name: "deploy to staging"
command: |
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip install -r requirements.txt
npm run deploy
- &integration
- &integration_jest
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: "integration tests"
name: "integration tests with Jest"
command: |
npm run test:integration:remote
JEST_JUNIT_OUTPUT_NAME=integration-jest-results.xml npm run test:integration:jest:remote -- --reporters=jest-junit
- store_test_results:
path: test/results
- &integration_tap
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: "integration tests with Tap"
command: |
mkdir ./test/results
npm run test:smoke:sauce -- --output-file ./test/results/integration-raw-tap.tap
npm run test:smoke:convertReportToXunit
- store_test_results:
path: test/results
jobs:
build-staging:
<<: *build
build-production:
# <<: *build
<<: *build
deploy-staging:
<<: *deploy
deploy-production:
# <<: *deploy
integration-staging:
<<: *integration
integration-production:
# <<: *integration
integration-staging-jest:
<<: *integration_jest
integration-staging-tap:
<<: *integration_tap
integration-production-jest:
# <<: *integration_jest
integration-production-tap:
# <<: *integration_tap
workflows:
build-test-deploy:
build-staging-production: # build-test-deploy
jobs:
- build-staging:
context:
......@@ -107,6 +146,14 @@ workflows:
- develop
- /^hotfix\/.*/
- /^release\/.*/
- build-production:
context:
- scratch-www-all
- scratch-www-production
filters:
branches:
only:
- master
# - deploy-staging:
# context:
# - scratch-www-all
......@@ -119,7 +166,21 @@ workflows:
# - develop
# - /^hotfix\/.*/
# - /^release\/.*/
# - integration-staging:
# - circleCI-configure-tests
# - integration-staging-jest:
# context:
# - scratch-www-all
# - scratch-www-staging
# requires:
# - deploy-staging
# filters:
# branches:
# only:
# - develop
# - /^hotfix\/.*/
# - /^release\/.*/
# - circleCI-configure-tests
# - integration-staging-tap:
# context:
# - scratch-www-all
# - scratch-www-staging
......@@ -131,3 +192,4 @@ workflows:
# - develop
# - /^hotfix\/.*/
# - /^release\/.*/
# - circleCI-configure-tests
......@@ -20,6 +20,7 @@ deploy.zip
ENV
# Test
/test/results/*
/.nyc_output
/coverage
/bin/lib/localized-urls.json
......
This diff is collapsed.
......@@ -6,16 +6,21 @@
"start": "node ./dev-server/index.js",
"test": "npm run test:lint && npm run build && npm run test:unit",
"test:lint": "eslint . --ext .js,.jsx,.json",
"test:lint:ci": "eslint . --ext .js,.jsx,.json --format junit -o ./test/results/lint-results.xml",
"test:integration": "npm run test:integration:jest && npm run test:smoke",
"test:integration:jest": "jest ./test/integration/*.test.js",
"test:integration:jest": "jest ./test/integration/*.test.js --reporters=default",
"test:integration:remote": "npm run test:integration:jest:remote && npm run test:smoke:sauce",
"test:integration:jest:remote": "SMOKE_REMOTE=true jest ./test/integration/*.test.js",
"test:integration:jest:remote": "SMOKE_REMOTE=true jest ./test/integration/*.test.js --reporters=default",
"test:smoke": "tap ./test/integration-legacy/smoke-testing/*.js --timeout=3600 --no-coverage -R classic",
"test:smoke:verbose": "tap ./test/integration-legacy/smoke-testing/*.js --timeout=3600 --no-coverage -R spec",
"test:smoke:sauce": "SMOKE_REMOTE=true tap ./test/integration-legacy/smoke-testing/*.js --timeout=60000 --no-coverage -R classic",
"test:smoke:convertReportToXunit": "tap ./test/results/integration-raw-tap.tap --no-coverage -R xunit > ./test/results/integration-tap-results.xml",
"test:unit": "npm run test:unit:jest && npm run test:unit:tap",
"test:unit:jest": "jest ./test/unit/ && jest ./test/localization/*.test.js",
"test:unit:jest": "npm run test:unit:jest:unit && npm run test:unit:jest:localization",
"test:unit:jest:unit": "jest ./test/unit/ --reporters=default",
"test:unit:jest:localization": "jest ./test/localization/*.test.js --reporters=default",
"test:unit:tap": "tap ./test/{unit-legacy,localization-legacy}/*.js --no-coverage -R classic",
"test:unit:convertReportToXunit": "tap ./test/results/unit-raw.tap --no-coverage -R xunit > ./test/results/unit-tap-results.xml",
"test:coverage": "tap ./test/{unit-legacy,localization-legacy}/*.js --coverage --coverage-report=lcov",
"build": "npm run clean && npm run translate && NODE_OPTIONS=--max_old_space_size=8000 webpack --bail",
"clean": "rm -rf ./build && rm -rf ./intl && mkdir -p build && mkdir -p intl",
......@@ -90,6 +95,7 @@
"html-webpack-plugin": "^3.2.0",
"iso-3166-2": "0.4.0",
"jest": "^23.6.0",
"jest-junit": "12.0.0",
"keymirror": "0.1.1",
"lodash.bindall": "4.4.0",
"lodash.defaultsdeep": "4.6.1",
......@@ -124,7 +130,7 @@
"selenium-webdriver": "3.6.0",
"slick-carousel": "1.6.0",
"style-loader": "0.12.3",
"tap": "14.10.8",
"tap": "14.11.0",
"url-loader": "2.3.0",
"webpack": "^4.46.0",
"webpack-bundle-analyzer": "^4.4.0",
......@@ -139,7 +145,14 @@
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/__mocks__/fileMock.js",
"\\.(css|less|scss)$": "<rootDir>/test/__mocks__/styleMock.js"
}
},
"reporters": [
"default",
"jest-junit"
]
},
"jest-junit": {
"outputDirectory": "./test/results"
},
"nyc": {
"include": [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment