From b9b6f035f89b5e765573eb47d5a88eec72e6592d Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 17:38:55 -0700 Subject: [PATCH 01/22] modified circle.yml to 2.0 format (initial) --- circle.yml | 176 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 103 insertions(+), 73 deletions(-) diff --git a/circle.yml b/circle.yml index bd5c2c520..44871c058 100644 --- a/circle.yml +++ b/circle.yml @@ -1,75 +1,105 @@ -machine: - node: - version: 8 - services: - - docker - - redis - environment: - PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" - NODE_ENV: "test" - MOCHA_FILE: "${CIRCLE_TEST_REPORTS}/junit/test-results.xml" - MOCHA_REPORTER: "mocha-junit-reporter" - pre: - # TODO: use the following to add in support for MongoDB 3.4. - # # Upgrade the database version to 3.4. - # - sudo apt-get purge mongodb-org* - # - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 - # - echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list - # - sudo apt-get update - # - sudo apt-get install -y mongodb-org - # - sudo service mongod restart +version: 2 - # Force sync the time. - - date - - sudo service ntp stop - - sudo ntpdate -s time.nist.gov - - sudo service ntp start - - date +jobs: + npm_dependencies: + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} + - run: + name: Install dependancies + command: | + yarn global add node-gyp && + yarn install --frozen-lockfile + - save_cache: + key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} + paths: + - ./node_modules + - persist_to_workspace: + root: . + paths: node_modules + lint: + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - run: + name: Perform linting + command: yarn lint + build_assets: + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - run: + name: Build static assets + command: yarn build + - persist_to_workspace: + root: . + paths: dist + test_unit: + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + - image: circleci/mongo:3 + - image: circleci/redis:4-alpine + environment: + NODE_ENV: test + MOCHA_FILE: /tmp/circleci-test-results/junit/test-results.xml + MOCHA_REPORTER: mocha-junit-reporter + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - run: + name: Setup the test results directory + command: mkdir -p /tmp/circleci-test-results + - run: + name: Run the unit tests + command: yarn test + - store_test_results: + path: /tmp/circleci-test-results + test_integration: + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8-browsers + - image: circleci/mongo:3 + - image: circleci/redis:4-alpine + environment: + NODE_ENV: test + steps: + - run: + name: Setup the database with defaults + command: ./bin/cli setup --defaults + - run: + name: Run the integration tests + command: yarn e2e:ci - # Install chromium for e2e and remove old google-chrome - - sudo rm -rf /opt/google/chrome - - sudo rm -f /usr/bin/google-chrome* - - sudo apt-get update - - sudo apt-get install chromium-browser - -dependencies: - override: - - # Install node dependencies. - - yarn --version - - yarn global add node-gyp --force - - yarn - - post: - # Build the static assets. - - yarn build - # Lint the project here, before tests are ran. - - yarn lint - -database: - post: - # Initialize the settings in the database, this will create indicies for the - # database. - - ./bin/cli setup --defaults - - sleep 2 - -test: - override: - # Run the tests using the junit reporter. - - yarn test - # Run the end to end tests - - yarn e2e:ci - -deployment: - release: - tag: /v[0-9]+(\.[0-9]+)*/ - commands: - - bash ./scripts/docker.sh deploy - - latest: - branch: - - master - - next - owner: coralproject - commands: - - bash ./scripts/docker.sh deploy +workflows: + version: 2 + build-and-deploy: + jobs: + - npm_dependencies + - lint: + requires: + - npm_dependencies + - test_unit: + requires: + - npm_dependencies + - build_assets: + requires: + - npm_dependencies + - test_integration: + requires: + - build_assets \ No newline at end of file From d0cfbf60bed0c1793533aa405e3c45107c87070d Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 17:47:47 -0700 Subject: [PATCH 02/22] fixed test --- circle.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 44871c058..511b07caa 100644 --- a/circle.yml +++ b/circle.yml @@ -79,12 +79,27 @@ jobs: environment: NODE_ENV: test steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk - run: name: Setup the database with defaults command: ./bin/cli setup --defaults - run: name: Run the integration tests command: yarn e2e:ci + deploy: + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + # TODO: implement + - run: + name: Deploy the code + command: echo "Deployed!" workflows: version: 2 @@ -102,4 +117,10 @@ workflows: - npm_dependencies - test_integration: requires: - - build_assets \ No newline at end of file + - build_assets + # TODO: move to own workflow + - deploy: + requires: + - lint + - test_unit + - test_integration \ No newline at end of file From 593468f0c1d63b1c24dfa1219db269a14d0e1130 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 18:03:52 -0700 Subject: [PATCH 03/22] added call to docker build --- circle.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/circle.yml b/circle.yml index 511b07caa..2b8909f04 100644 --- a/circle.yml +++ b/circle.yml @@ -94,12 +94,10 @@ jobs: - image: circleci/node:8 steps: - checkout - - attach_workspace: - at: ~/coralproject/talk - # TODO: implement + - setup_remote_docker - run: name: Deploy the code - command: echo "Deployed!" + command: bash ./scripts/docker.sh workflows: version: 2 From 3d31bec67187385fa0850864dcd5a8ba0dc98706 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 18:43:49 -0700 Subject: [PATCH 04/22] added to the deploy work --- circle.yml | 51 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/circle.yml b/circle.yml index 2b8909f04..9edfd486d 100644 --- a/circle.yml +++ b/circle.yml @@ -1,10 +1,15 @@ -version: 2 +# The following stanza defines a map named defaults with a variable that may be inserted using the YAML merge (<<: *) key +# later in the file to save some typing. See http://yaml.org/type/merge.html for details. +defaults: &defaults + working_directory: ~/coralproject/talk + docker: + - image: circleci/node:8 + +version: 2 jobs: npm_dependencies: - working_directory: ~/coralproject/talk - docker: - - image: circleci/node:8 + <<: *defaults steps: - checkout - attach_workspace: @@ -24,9 +29,7 @@ jobs: root: . paths: node_modules lint: - working_directory: ~/coralproject/talk - docker: - - image: circleci/node:8 + <<: *defaults steps: - checkout - attach_workspace: @@ -35,9 +38,7 @@ jobs: name: Perform linting command: yarn lint build_assets: - working_directory: ~/coralproject/talk - docker: - - image: circleci/node:8 + <<: *defaults steps: - checkout - attach_workspace: @@ -49,7 +50,7 @@ jobs: root: . paths: dist test_unit: - working_directory: ~/coralproject/talk + <<: *defaults docker: - image: circleci/node:8 - image: circleci/mongo:3 @@ -71,7 +72,7 @@ jobs: - store_test_results: path: /tmp/circleci-test-results test_integration: - working_directory: ~/coralproject/talk + <<: *defaults docker: - image: circleci/node:8-browsers - image: circleci/mongo:3 @@ -89,19 +90,17 @@ jobs: name: Run the integration tests command: yarn e2e:ci deploy: - working_directory: ~/coralproject/talk - docker: - - image: circleci/node:8 + <<: *defaults steps: - checkout - setup_remote_docker - run: name: Deploy the code - command: bash ./scripts/docker.sh + command: bash ./scripts/docker.sh deploy workflows: version: 2 - build-and-deploy: + build-test-and-deploy: jobs: - npm_dependencies - lint: @@ -116,9 +115,23 @@ workflows: - test_integration: requires: - build_assets - # TODO: move to own workflow - deploy: + context: coralproject requires: - lint - test_unit - - test_integration \ No newline at end of file + - test_integration + filters: + branches: + only: + - master + - next + deploy-tagged: + jobs: + - deploy: + context: coralproject + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*/ \ No newline at end of file From 11812714a3c09b6ad9d2a7cb931216269263f170 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 18:58:44 -0700 Subject: [PATCH 05/22] added con integration tests --- circle.yml | 101 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/circle.yml b/circle.yml index 9edfd486d..6609c7044 100644 --- a/circle.yml +++ b/circle.yml @@ -6,6 +6,23 @@ defaults: &defaults docker: - image: circleci/node:8 +integration: &integration + <<: *defaults + docker: + - image: circleci/node:8-browsers + - image: circleci/mongo:3 + - image: circleci/redis:4-alpine + steps: + - checkout + - attach_workspace: + at: ~/coralproject/talk + - run: + name: Setup the database with defaults + command: ./bin/cli setup --defaults + - run: + name: Run the integration tests + command: yarn e2e:ci + version: 2 jobs: npm_dependencies: @@ -71,24 +88,21 @@ jobs: command: yarn test - store_test_results: path: /tmp/circleci-test-results - test_integration: - <<: *defaults - docker: - - image: circleci/node:8-browsers - - image: circleci/mongo:3 - - image: circleci/redis:4-alpine + test_integration_chrome: + <<: *integration environment: NODE_ENV: test - steps: - - checkout - - attach_workspace: - at: ~/coralproject/talk - - run: - name: Setup the database with defaults - command: ./bin/cli setup --defaults - - run: - name: Run the integration tests - command: yarn e2e:ci + E2E_BROWSERS: chrome + test_integration_firefox: + <<: *integration + environment: + NODE_ENV: test + E2E_BROWSERS: firefox + test_integration_edge: + <<: *integration + environment: + NODE_ENV: test + E2E_BROWSERS: edge deploy: <<: *defaults steps: @@ -96,7 +110,7 @@ jobs: - setup_remote_docker - run: name: Deploy the code - command: bash ./scripts/docker.sh deploy + command: bash ./scripts/docker.sh workflows: version: 2 @@ -112,7 +126,13 @@ workflows: - build_assets: requires: - npm_dependencies - - test_integration: + - test_integration_chrome: + requires: + - build_assets + - test_integration_firefox: + requires: + - build_assets + - test_integration_edge: requires: - build_assets - deploy: @@ -120,18 +140,41 @@ workflows: requires: - lint - test_unit - - test_integration - filters: - branches: - only: - - master - - next + - test_integration_chrome + - test_integration_firefox + - test_integration_edge deploy-tagged: + triggers: + - filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*/ jobs: + - npm_dependencies + - lint: + requires: + - npm_dependencies + - test_unit: + requires: + - npm_dependencies + - build_assets: + requires: + - npm_dependencies + - test_integration_chrome: + requires: + - build_assets + - test_integration_firefox: + requires: + - build_assets + - test_integration_edge: + requires: + - build_assets - deploy: context: coralproject - filters: - branches: - ignore: /.*/ - tags: - only: /v[0-9]+(\.[0-9]+)*/ \ No newline at end of file + requires: + - lint + - test_unit + - test_integration_chrome + - test_integration_firefox + - test_integration_edge \ No newline at end of file From 71d12627c8ee700ab0519878f52be8a2d7224ee5 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 18:59:37 -0700 Subject: [PATCH 06/22] ammended format --- circle.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/circle.yml b/circle.yml index 6609c7044..ec48c3014 100644 --- a/circle.yml +++ b/circle.yml @@ -145,11 +145,11 @@ workflows: - test_integration_edge deploy-tagged: triggers: - - filters: - branches: - ignore: /.*/ - tags: - only: /v[0-9]+(\.[0-9]+)*/ + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*/ jobs: - npm_dependencies - lint: From 9f79b3f2c668a2cc3e9fafb879c2cdcd67fcda90 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 19:03:03 -0700 Subject: [PATCH 07/22] added tag filter --- circle.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/circle.yml b/circle.yml index ec48c3014..3548b12de 100644 --- a/circle.yml +++ b/circle.yml @@ -112,6 +112,13 @@ jobs: name: Deploy the code command: bash ./scripts/docker.sh +filter_tags: &filter_tags + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*/ + workflows: version: 2 build-test-and-deploy: @@ -144,33 +151,35 @@ workflows: - test_integration_firefox - test_integration_edge deploy-tagged: - triggers: - filters: - branches: - ignore: /.*/ - tags: - only: /v[0-9]+(\.[0-9]+)*/ jobs: - - npm_dependencies + - npm_dependencies: + <<: *filter_tags - lint: + <<: *filter_tags requires: - npm_dependencies - test_unit: + <<: *filter_tags requires: - npm_dependencies - build_assets: + <<: *filter_tags requires: - npm_dependencies - test_integration_chrome: + <<: *filter_tags requires: - build_assets - test_integration_firefox: + <<: *filter_tags requires: - build_assets - test_integration_edge: + <<: *filter_tags requires: - build_assets - deploy: + <<: *filter_tags context: coralproject requires: - lint From 3879ab1bff15882f9c87ec5759583dae80298f07 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 19:16:19 -0700 Subject: [PATCH 08/22] added more contexts --- circle.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/circle.yml b/circle.yml index 3548b12de..932cb109c 100644 --- a/circle.yml +++ b/circle.yml @@ -119,6 +119,11 @@ filter_tags: &filter_tags tags: only: /v[0-9]+(\.[0-9]+)*/ +integration_workflow: &integration_workflow + context: coralproject + requires: + - build_assets + workflows: version: 2 build-test-and-deploy: @@ -134,14 +139,11 @@ workflows: requires: - npm_dependencies - test_integration_chrome: - requires: - - build_assets + <<: *integration_workflow - test_integration_firefox: - requires: - - build_assets + <<: *integration_workflow - test_integration_edge: - requires: - - build_assets + <<: *integration_workflow - deploy: context: coralproject requires: @@ -168,16 +170,13 @@ workflows: - npm_dependencies - test_integration_chrome: <<: *filter_tags - requires: - - build_assets + <<: *integration_workflow - test_integration_firefox: <<: *filter_tags - requires: - - build_assets + <<: *integration_workflow - test_integration_edge: <<: *filter_tags - requires: - - build_assets + <<: *integration_workflow - deploy: <<: *filter_tags context: coralproject From 847310f2145080c96aec4159f0c970bda48483d0 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 19:22:22 -0700 Subject: [PATCH 09/22] ammended to test on bs --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 932cb109c..f0160318e 100644 --- a/circle.yml +++ b/circle.yml @@ -21,7 +21,7 @@ integration: &integration command: ./bin/cli setup --defaults - run: name: Run the integration tests - command: yarn e2e:ci + command: yarn e2e --reports-folder "./test/e2e/reports" --bs-key "$BROWSERSTACK_KEY" --retries "1" --timeout "10000" --browsers "$E2E_BROWSERS" version: 2 jobs: From 57ba7e63db9464d10dc9c7835856c91d5ab01106 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 20:29:57 -0700 Subject: [PATCH 10/22] cleaned up the deployment workflow --- circle.yml => .circleci/circle.yml | 131 +++++++++++++++----------- scripts/e2e-ci.sh => .circleci/e2e.sh | 2 +- 2 files changed, 77 insertions(+), 56 deletions(-) rename circle.yml => .circleci/circle.yml (58%) rename scripts/e2e-ci.sh => .circleci/e2e.sh (93%) diff --git a/circle.yml b/.circleci/circle.yml similarity index 58% rename from circle.yml rename to .circleci/circle.yml index f0160318e..292bec375 100644 --- a/circle.yml +++ b/.circleci/circle.yml @@ -1,13 +1,19 @@ -# The following stanza defines a map named defaults with a variable that may be inserted using the YAML merge (<<: *) key -# later in the file to save some typing. See http://yaml.org/type/merge.html for details. - -defaults: &defaults +# job_defaults applies all the defaults for each job. +job_defaults: &job_defaults working_directory: ~/coralproject/talk docker: - image: circleci/node:8 -integration: &integration - <<: *defaults +# integration_environment is the environment that configures the tests. +integration_environment: &integration_environment + NODE_ENV: test + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + +# integration_job runs the integration tests and saves the test results. +integration_job: &integration_job + <<: *job_defaults + environment: + <<: *integration_environment docker: - image: circleci/node:8-browsers - image: circleci/mongo:3 @@ -21,12 +27,15 @@ integration: &integration command: ./bin/cli setup --defaults - run: name: Run the integration tests - command: yarn e2e --reports-folder "./test/e2e/reports" --bs-key "$BROWSERSTACK_KEY" --retries "1" --timeout "10000" --browsers "$E2E_BROWSERS" + command: bash .circleci/e2e.sh + - store_test_results: + path: /tmp/circleci-test-results version: 2 jobs: + # npm_dependencies will install the dependancies used by all other steps. npm_dependencies: - <<: *defaults + <<: *job_defaults steps: - checkout - attach_workspace: @@ -45,8 +54,10 @@ jobs: - persist_to_workspace: root: . paths: node_modules + + # lint will perform file linting. lint: - <<: *defaults + <<: *job_defaults steps: - checkout - attach_workspace: @@ -54,8 +65,10 @@ jobs: - run: name: Perform linting command: yarn lint + + # build_assets will build the static assets. build_assets: - <<: *defaults + <<: *job_defaults steps: - checkout - attach_workspace: @@ -66,16 +79,14 @@ jobs: - persist_to_workspace: root: . paths: dist + + # test_unit will run the unit tests. test_unit: - <<: *defaults + <<: *job_defaults docker: - image: circleci/node:8 - image: circleci/mongo:3 - image: circleci/redis:4-alpine - environment: - NODE_ENV: test - MOCHA_FILE: /tmp/circleci-test-results/junit/test-results.xml - MOCHA_REPORTER: mocha-junit-reporter steps: - checkout - attach_workspace: @@ -86,25 +97,45 @@ jobs: - run: name: Run the unit tests command: yarn test + environment: + MOCHA_FILE: /tmp/circleci-test-results/junit/test-results.xml + MOCHA_REPORTER: mocha-junit-reporter + NODE_ENV: test - store_test_results: path: /tmp/circleci-test-results + + # test_integration_chrome_local will run the integration tests locally with + # chrome headless. + test_integration_chrome_local: + <<: *integration_job + + # test_integration_chrome will run the integration tests with chrome in + # browserstack. test_integration_chrome: - <<: *integration + <<: *integration_job environment: - NODE_ENV: test + <<: *integration_environment E2E_BROWSERS: chrome + + # test_integration_firefox will run the integration tests with firefox in + # browserstack. test_integration_firefox: - <<: *integration + <<: *integration_job environment: - NODE_ENV: test + <<: *integration_environment E2E_BROWSERS: firefox + + # test_integration_edge will run the integration tests with edge in + # browserstack. test_integration_edge: - <<: *integration + <<: *integration_job environment: - NODE_ENV: test + <<: *integration_environment E2E_BROWSERS: edge + + # deploy will deploy the application as a docker image. deploy: - <<: *defaults + <<: *job_defaults steps: - checkout - setup_remote_docker @@ -112,21 +143,20 @@ jobs: name: Deploy the code command: bash ./scripts/docker.sh -filter_tags: &filter_tags +# filter_deploy will add the filters for a deploy job in a workflow to make it +# only execute on a deploy related job. +filter_deploy: &filter_deploy filters: branches: - ignore: /.*/ + only: + - master + - next tags: only: /v[0-9]+(\.[0-9]+)*/ -integration_workflow: &integration_workflow - context: coralproject - requires: - - build_assets - workflows: version: 2 - build-test-and-deploy: + build-and-test: jobs: - npm_dependencies - lint: @@ -138,48 +168,39 @@ workflows: - build_assets: requires: - npm_dependencies - - test_integration_chrome: - <<: *integration_workflow - - test_integration_firefox: - <<: *integration_workflow - - test_integration_edge: - <<: *integration_workflow - - deploy: - context: coralproject + - test_integration_chrome_local: requires: - - lint - - test_unit - - test_integration_chrome - - test_integration_firefox - - test_integration_edge + - build_assets deploy-tagged: jobs: - npm_dependencies: - <<: *filter_tags + <<: *filter_deploy - lint: - <<: *filter_tags + <<: *filter_deploy requires: - npm_dependencies - test_unit: - <<: *filter_tags + <<: *filter_deploy requires: - npm_dependencies - build_assets: - <<: *filter_tags + <<: *filter_deploy requires: - npm_dependencies - test_integration_chrome: - <<: *filter_tags - <<: *integration_workflow + <<: *filter_deploy + requires: + - build_assets - test_integration_firefox: - <<: *filter_tags - <<: *integration_workflow + <<: *filter_deploy + requires: + - build_assets - test_integration_edge: - <<: *filter_tags - <<: *integration_workflow + <<: *filter_deploy + requires: + - build_assets - deploy: - <<: *filter_tags - context: coralproject + <<: *filter_deploy requires: - lint - test_unit diff --git a/scripts/e2e-ci.sh b/.circleci/e2e.sh similarity index 93% rename from scripts/e2e-ci.sh rename to .circleci/e2e.sh index a509ccee7..b0808e735 100755 --- a/scripts/e2e-ci.sh +++ b/.circleci/e2e.sh @@ -19,7 +19,7 @@ if [[ "${E2E_DISABLE}" == "true" ]]; then exit fi -if [[ "${CIRCLE_BRANCH}" == "master" && -n "$BROWSERSTACK_KEY" ]]; then +if [[ -n "$BROWSERSTACK_KEY" ]]; then echo Testing on browserstack yarn e2e --reports-folder "$REPORTS_FOLDER" --bs-key "$BROWSERSTACK_KEY" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" else From 830522363919eb2a4da7fdec1bcbb8d9faad59e4 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 20:32:10 -0700 Subject: [PATCH 11/22] rename --- .circleci/{circle.yml => config.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .circleci/{circle.yml => config.yml} (100%) diff --git a/.circleci/circle.yml b/.circleci/config.yml similarity index 100% rename from .circleci/circle.yml rename to .circleci/config.yml From 435afff2df9d28ee21c4fd724c2aa9a4cf3bdf89 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 20:59:40 -0700 Subject: [PATCH 12/22] cleanup of e2e script --- .circleci/e2e.sh | 4 +- scripts/e2e.js | 130 ++++++++++++++++++++++++++++------------------- 2 files changed, 80 insertions(+), 54 deletions(-) diff --git a/.circleci/e2e.sh b/.circleci/e2e.sh index b0808e735..c7606668f 100755 --- a/.circleci/e2e.sh +++ b/.circleci/e2e.sh @@ -21,9 +21,9 @@ fi if [[ -n "$BROWSERSTACK_KEY" ]]; then echo Testing on browserstack - yarn e2e --reports-folder "$REPORTS_FOLDER" --bs-key "$BROWSERSTACK_KEY" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" + node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --browserstack else # When browserstack is not available test locally using chrome headless. echo Testing locally - yarn e2e --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --headless + node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --headless fi diff --git a/scripts/e2e.js b/scripts/e2e.js index fb010f9e5..37ada228a 100755 --- a/scripts/e2e.js +++ b/scripts/e2e.js @@ -139,61 +139,81 @@ async function runBrowserTests( return Object.keys(succeeded).length === browsers.length; } -async function start(program) { - const localIdentifier = uuid(); - let browsers = program.browsers.split(','); - const retries = Number.parseInt(program.retries); - const browserstack = {}; - const date = new Date() - .toISOString() - .replace(/[T.]/g, '-') - .replace(/:/g, ''); - const timeout = program.timeout; - const reportsFolder = `${program.reportsFolder}/${date}`; - let exitCode = 0; - let config = 'nightwatch.conf.js'; - try { - if (program.tunnel && program.bsKey) { - await startTunnel(program.bsKey, localIdentifier); +class E2E { + constructor(opts) { + this.browserstackEnabled = Boolean(opts.bsKey && opts.browserstack); + if (this.browserstackEnabled && opts.headless) { + console.error('--browserstack and --headless cannot be combined'); + process.exit(1); } - console.log('Dropping test database'); - await mongoose.connection.dropDatabase(); - await serve(); - - if (program.bsKey) { - config = 'nightwatch-browserstack.conf.js'; - browserstack.localIdentifier = localIdentifier; - browserstack.key = program.bsKey; - browserstack.user = program.bsUser; - } else { - // Install selenium standalone. - await seleniumInstall(); - if (program.headless) { - browsers = browsers.map(b => `${b}-headless`); + this.localIdentifier = uuid(); + this.retries = Number.parseInt(opts.retries); + this.browserstack = {}; + this.date = new Date() + .toISOString() + .replace(/[T.]/g, '-') + .replace(/:/g, ''); + this.browsers = opts.browsers.split(',').map(browser => { + if (opts.headless) { + return `${browser}-headless`; } - } - const succeeded = await runBrowserTests( - browsers, - config, - retries, - reportsFolder, - browserstack, - timeout - ); - if (!succeeded) { - exitCode = 1; - } - } catch (ex) { - console.log('There was an error:\n\n'); - process.stderr.write(`${ex.stack}\n`); - process.exit(2); - } finally { - console.log('Shutting down'); - shutdown(); + return browser; + }); + this.timeout = opts.timeout; + this.reportsFolder = `${opts.reportsFolder}/${this.date}`; + this.config = this.browserstackEnabled + ? 'nightwatch-browserstack.conf.js' + : 'nightwatch.conf.js'; + this.tunnel = opts.tunnel; + this.bsKey = opts.bsKey; + this.bsUser = opts.bsUser; + } + + async start() { + let exitCode = 0; + try { + if (this.tunnel && this.bsKey) { + await startTunnel(this.bsKey, this.localIdentifier); + } + + console.log('Dropping test database'); + await mongoose.connection.dropDatabase(); + console.log('Starting the server'); + await serve(); + + if (this.browserstackEnabled) { + browserstack.localIdentifier = this.localIdentifier; + browserstack.key = this.bsKey; + browserstack.user = this.bsUser; + } else { + // Install selenium standalone. + await seleniumInstall(); + } + + // Run the tests. + const succeeded = await runBrowserTests( + this.browsers, + this.config, + this.retries, + this.reportsFolder, + browserstack, + this.timeout + ); + if (!succeeded) { + exitCode = 1; + } + } catch (err) { + console.log('There was an error:\n\n'); + process.stderr.write(`${err.stack}\n`); + process.exit(2); + } finally { + console.log('Shutting down'); + shutdown(); + process.exit(exitCode); + } } - process.exit(exitCode); } program @@ -202,7 +222,12 @@ program 'Perform e2e testing locally or if browserstack credentials are provided on browserstack.' ) .option('-u, --bs-user [user]', 'Browserstack user', 'coralproject2') - .option('-k, --bs-key [key]', 'Browserstack api key') + .option( + '-k, --bs-key [key]', + 'Browserstack api key', + process.env.BROWSERSTACK_KEY + ) + .option('--browserstack', 'Enables Browserstack testing') .option('--no-tunnel', 'Dont start browserstack-local') .option('-b, --browsers [list of browsers]', 'Browsers to test', 'chrome') .option('-r, --retries [number]', 'Number of retries before failing', '1') @@ -211,4 +236,5 @@ program .option('--timeout [number]', 'Timeout for WaitForConditions', '10000') .parse(process.argv); -start(program); +const e2e = new E2E(program); +e2e.start(); From 0bb61da8604928204bd73f0d18721e672fda1621 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:01:00 -0700 Subject: [PATCH 13/22] adjusted build pipelin --- .circleci/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 292bec375..7221160bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,7 +108,18 @@ jobs: # chrome headless. test_integration_chrome_local: <<: *integration_job + environment: + <<: *integration_environment + E2E_BROWSERS: chrome + # test_integration_firefox_local will run the integration tests locally with + # firefox headless. + test_integration_firefox_local: + <<: *integration_job + environment: + <<: *integration_environment + E2E_BROWSERS: firefox + # test_integration_chrome will run the integration tests with chrome in # browserstack. test_integration_chrome: @@ -171,6 +182,9 @@ workflows: - test_integration_chrome_local: requires: - build_assets + - test_integration_firefox_local: + requires: + - build_assets deploy-tagged: jobs: - npm_dependencies: From 7c55088d9fb28a93e76180239356586181454ee4 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:04:29 -0700 Subject: [PATCH 14/22] require cache only on the yarn.lock file --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7221160bf..e6d65a646 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,14 +41,14 @@ jobs: - attach_workspace: at: ~/coralproject/talk - restore_cache: - key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} + key: dependency-cache-{{ checksum "yarn.lock" }} - run: name: Install dependancies command: | yarn global add node-gyp && yarn install --frozen-lockfile - save_cache: - key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} + key: dependency-cache-{{ checksum "yarn.lock" }} paths: - ./node_modules - persist_to_workspace: From 6e946ca31d9ebc92bd3d3c9e329400875f858b24 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:10:35 -0700 Subject: [PATCH 15/22] ammended browserstack test --- .circleci/config.yml | 3 +++ .circleci/e2e.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6d65a646..f17eaacf4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,6 +126,7 @@ jobs: <<: *integration_job environment: <<: *integration_environment + BROWSERSTACK: true E2E_BROWSERS: chrome # test_integration_firefox will run the integration tests with firefox in @@ -134,6 +135,7 @@ jobs: <<: *integration_job environment: <<: *integration_environment + BROWSERSTACK: true E2E_BROWSERS: firefox # test_integration_edge will run the integration tests with edge in @@ -142,6 +144,7 @@ jobs: <<: *integration_job environment: <<: *integration_environment + BROWSERSTACK: true E2E_BROWSERS: edge # deploy will deploy the application as a docker image. diff --git a/.circleci/e2e.sh b/.circleci/e2e.sh index c7606668f..2d9fc25af 100755 --- a/.circleci/e2e.sh +++ b/.circleci/e2e.sh @@ -19,7 +19,7 @@ if [[ "${E2E_DISABLE}" == "true" ]]; then exit fi -if [[ -n "$BROWSERSTACK_KEY" ]]; then +if [[ "$BROWSERSTACK" == "true" && -n "$BROWSERSTACK_KEY" ]]; then echo Testing on browserstack node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --browserstack else From 4c5adc26cfe53cbe1053757b66fc85b608ad7789 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:17:41 -0700 Subject: [PATCH 16/22] removed headless --- .circleci/e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/e2e.sh b/.circleci/e2e.sh index 2d9fc25af..c74b18b5e 100755 --- a/.circleci/e2e.sh +++ b/.circleci/e2e.sh @@ -25,5 +25,5 @@ if [[ "$BROWSERSTACK" == "true" && -n "$BROWSERSTACK_KEY" ]]; then else # When browserstack is not available test locally using chrome headless. echo Testing locally - node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --headless + node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" fi From 35bfec6da6c6e768edf20e227ca81c16f1541e2e Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:34:45 -0700 Subject: [PATCH 17/22] fixed firefox support --- .circleci/e2e.sh | 2 +- nightwatch.conf.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/e2e.sh b/.circleci/e2e.sh index c74b18b5e..2d9fc25af 100755 --- a/.circleci/e2e.sh +++ b/.circleci/e2e.sh @@ -25,5 +25,5 @@ if [[ "$BROWSERSTACK" == "true" && -n "$BROWSERSTACK_KEY" ]]; then else # When browserstack is not available test locally using chrome headless. echo Testing locally - node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" + node scripts/e2e.js --reports-folder "$REPORTS_FOLDER" --retries "$E2E_MAX_RETRIES" --timeout "$E2E_WAIT_FOR_TIMEOUT" --browsers "$E2E_BROWSERS" --headless fi diff --git a/nightwatch.conf.js b/nightwatch.conf.js index ac5887e51..64e5bcb31 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -49,5 +49,12 @@ module.exports = { }, }, }, + 'firefox-headless': { + desiredCapabilities: { + chromeOptions: { + args: ['--headless', '--disable-gpu', 'window-size=1600,1200'], + }, + }, + }, }, }; From b8ddfe4ae4614684c636644a2b8901b110443fd7 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:45:29 -0700 Subject: [PATCH 18/22] added dist cache support --- .circleci/config.yml | 6 +++++ package.json | 1 + webpack.config.js | 2 ++ yarn.lock | 57 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f17eaacf4..3d654278f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,9 +73,15 @@ jobs: - checkout - attach_workspace: at: ~/coralproject/talk + - restore_cache: + key: build-cache - run: name: Build static assets command: yarn build + - save_cache: + key: build-cache + paths: + - ./node_modules/.cache/hard-source - persist_to_workspace: root: . paths: dist diff --git a/package.json b/package.json index 48e0b1001..9c5f58ff5 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "graphql-tag": "^1.2.3", "graphql-tools": "^0.10.1", "hammerjs": "^2.0.8", + "hard-source-webpack-plugin": "^0.6.0", "helmet": "3.8.2", "history": "^3.0.0", "hjson": "^3.1.1", diff --git a/webpack.config.js b/webpack.config.js index 00daeedee..2027061da 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,7 @@ const _ = require('lodash'); const Copy = require('copy-webpack-plugin'); const webpack = require('webpack'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const debug = require('debug')('talk:webpack'); // Possibly load the config from the .env file (if there is one). @@ -136,6 +137,7 @@ const config = { TALK_DEFAULT_LANG: 'en', }), new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + new HardSourceWebpackPlugin(), ], resolveLoader: { modules: [ diff --git a/yarn.lock b/yarn.lock index 7ba8aab3f..62eb054fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2683,6 +2683,10 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + detect-libc@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-0.2.0.tgz#47fdf567348a17ec25fcbf0b9e446348a76f9fb5" @@ -4237,6 +4241,19 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" +hard-source-webpack-plugin@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/hard-source-webpack-plugin/-/hard-source-webpack-plugin-0.6.0.tgz#ec2f60068a8d1f358439b7b1587f1c64fe642eda" + dependencies: + lodash "^4.15.0" + mkdirp "^0.5.1" + node-object-hash "^1.2.0" + rimraf "^2.6.2" + tapable "^1.0.0-beta.5" + webpack-core "~0.6.0" + webpack-sources "^1.0.1" + write-json-file "^2.3.0" + harmony-reflect@^1.4.6: version "1.5.1" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.5.1.tgz#b54ca617b00cc8aef559bbb17b3d85431dc7e329" @@ -7043,6 +7060,10 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" +node-object-hash@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-1.3.0.tgz#7f294f5afec6b08d713e40d40a95ec793e05baf3" + node-pre-gyp@^0.6.36, node-pre-gyp@^0.6.39: version "0.6.39" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" @@ -9222,7 +9243,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -9686,10 +9707,20 @@ sort-keys@^1.0.0: dependencies: is-plain-obj "^1.0.0" +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + dependencies: + is-plain-obj "^1.0.0" + source-list-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" +source-list-map@~0.1.7: + version "0.1.8" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" + source-map-resolve@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a" @@ -9722,7 +9753,7 @@ source-map@0.1.x: dependencies: amdefine ">=0.0.4" -source-map@0.4.x, source-map@^0.4.4: +source-map@0.4.x, source-map@^0.4.4, source-map@~0.4.1: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: @@ -10100,6 +10131,10 @@ tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" +tapable@^1.0.0-beta.5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" + tar-fs@^1.13.0: version "1.16.0" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.0.tgz#e877a25acbcc51d8c790da1c57c9cf439817b896" @@ -10717,6 +10752,13 @@ webidl-conversions@^4.0.0, webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" +webpack-core@~0.6.0: + version "0.6.9" + resolved "https://registry.yarnpkg.com/webpack-core/-/webpack-core-0.6.9.tgz#fc571588c8558da77be9efb6debdc5a3b172bdc2" + dependencies: + source-list-map "~0.1.7" + source-map "~0.4.1" + webpack-sources@^1.0.1, webpack-sources@^1.0.2, webpack-sources@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" @@ -10897,6 +10939,17 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.1.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-json-file@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" + dependencies: + detect-indent "^5.0.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + pify "^3.0.0" + sort-keys "^2.0.0" + write-file-atomic "^2.0.0" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" From e24deda936b702479e8b7004ed64c6c9eb9c90b4 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:46:56 -0700 Subject: [PATCH 19/22] added deeper cache support --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d654278f..ad0a365da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,12 +74,15 @@ jobs: - attach_workspace: at: ~/coralproject/talk - restore_cache: - key: build-cache + keys: + - build-cache-{{ .Branch }}-{{ .Revision }} + - build-cache-{{ .Branch }}- + - build-cache- - run: name: Build static assets command: yarn build - save_cache: - key: build-cache + key: build-cache-{{ .Branch }}-{{ .Revision }} paths: - ./node_modules/.cache/hard-source - persist_to_workspace: From 6555e0fcaa97e5e5d19b182f4dd2090691fa01ab Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 27 Feb 2018 21:55:31 -0700 Subject: [PATCH 20/22] added develop filter --- .circleci/config.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad0a365da..5f3cedf3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -177,24 +177,40 @@ filter_deploy: &filter_deploy tags: only: /v[0-9]+(\.[0-9]+)*/ +# filter_develop will add the filters for a development related commit. +filter_develop: &filter_develop + filters: + branches: + ignore: + - master + - next + workflows: version: 2 + + # All PR's will hit this workflow. build-and-test: jobs: - - npm_dependencies + - npm_dependencies: + <<: *filter_develop - lint: + <<: *filter_develop requires: - npm_dependencies - test_unit: + <<: *filter_develop requires: - npm_dependencies - build_assets: + <<: *filter_develop requires: - npm_dependencies - test_integration_chrome_local: + <<: *filter_develop requires: - build_assets - test_integration_firefox_local: + <<: *filter_develop requires: - build_assets deploy-tagged: From 910425caeacf7ea22474e687788610b32d758259 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 28 Feb 2018 09:21:26 -0700 Subject: [PATCH 21/22] added safari to integration jobs --- .circleci/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f3cedf3b..597d13293 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -156,6 +156,15 @@ jobs: BROWSERSTACK: true E2E_BROWSERS: edge + # test_integration_safari will run the integration tests with safari in + # browserstack. + test_integration_safari: + <<: *integration_job + environment: + <<: *integration_environment + BROWSERSTACK: true + E2E_BROWSERS: safari + # deploy will deploy the application as a docker image. deploy: <<: *job_defaults @@ -241,11 +250,16 @@ workflows: <<: *filter_deploy requires: - build_assets + - test_integration_safari: + <<: *filter_deploy + requires: + - build_assets - deploy: <<: *filter_deploy requires: - lint - test_unit + - test_integration_safari - test_integration_chrome - test_integration_firefox - test_integration_edge \ No newline at end of file From 30271ac945187bcdd9975bdb36a0c4f421ba3d81 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 28 Feb 2018 12:10:27 -0700 Subject: [PATCH 22/22] review --- .circleci/config.yml | 18 +++++++++++++++--- nightwatch.conf.js | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 597d13293..d280fda2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ integration_job: &integration_job version: 2 jobs: - # npm_dependencies will install the dependancies used by all other steps. + # npm_dependencies will install the dependencies used by all other steps. npm_dependencies: <<: *job_defaults steps: @@ -43,7 +43,7 @@ jobs: - restore_cache: key: dependency-cache-{{ checksum "yarn.lock" }} - run: - name: Install dependancies + name: Install dependencies command: | yarn global add node-gyp && yarn install --frozen-lockfile @@ -156,6 +156,15 @@ jobs: BROWSERSTACK: true E2E_BROWSERS: edge + # test_integration_ie will run the integration tests with ie in + # browserstack. + test_integration_ie: + <<: *integration_job + environment: + <<: *integration_environment + BROWSERSTACK: true + E2E_BROWSERS: ie + # test_integration_safari will run the integration tests with safari in # browserstack. test_integration_safari: @@ -250,6 +259,10 @@ workflows: <<: *filter_deploy requires: - build_assets + - test_integration_ie: + <<: *filter_deploy + requires: + - build_assets - test_integration_safari: <<: *filter_deploy requires: @@ -259,7 +272,6 @@ workflows: requires: - lint - test_unit - - test_integration_safari - test_integration_chrome - test_integration_firefox - test_integration_edge \ No newline at end of file diff --git a/nightwatch.conf.js b/nightwatch.conf.js index 64e5bcb31..76a5c291b 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -51,8 +51,8 @@ module.exports = { }, 'firefox-headless': { desiredCapabilities: { - chromeOptions: { - args: ['--headless', '--disable-gpu', 'window-size=1600,1200'], + 'moz:firefoxOptions': { + args: ['-headless'], }, }, },