From 5f253f4dd12ec4084a74e095fef33becca0c8226 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Tue, 24 Sep 2019 17:23:50 -0400 Subject: [PATCH 1/6] Adding workflow to run end to end tests --- .circleci/config.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca6713bb587..f1467533cfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,3 +48,30 @@ jobs: - run: name: BrowserStack testing command: gulp test --browserstack --nolintfix + e2etest: + docker: + # specify the version you desire here + - image: circleci/node:8.9.0 + steps: + - run: echo "Running end to end test using workflows" +workflows: + version: 2 + commit: + jobs: + - build + nightly: + triggers: + - schedule: + cron: "5 * * * *" + filters: + branches: + only: + - master + - ${CIRCLE_BRANCH} + jobs: + - build + - e2etest: + requires: + - build + + From 6d589858bd42c1e9f060bfd575ca5c99f9e106b2 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Tue, 24 Sep 2019 20:41:23 -0400 Subject: [PATCH 2/6] trying self branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1467533cfd..0873fefe048 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,7 +67,7 @@ workflows: branches: only: - master - - ${CIRCLE_BRANCH} + - circleci-workflow jobs: - build - e2etest: From a62581b7c42991e11ee99975899188ae46c696d9 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Tue, 24 Sep 2019 22:12:04 -0400 Subject: [PATCH 3/6] Update to run at 12 every day --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0873fefe048..8139035297c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ workflows: nightly: triggers: - schedule: - cron: "5 * * * *" + cron: "0 0 * * *" filters: branches: only: From 267bc0fdb862ae564d5c8ac871db2985d4225299 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Mon, 30 Sep 2019 10:36:59 -0400 Subject: [PATCH 4/6] cleanup config using aliases --- .circleci/config.yml | 122 +++++++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 52 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8139035297c..bf753a78337 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,58 +2,81 @@ # # Check https://circleci.com/docs/2.0/language-javascript/ for more details # -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/node:8.9.0 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/mongo:3.4.4 - working_directory: ~/Prebid.js +aliases: + - &environment + docker: + # specify the version you desire here + - image: circleci/node:8.9.0 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mongo:3.4.4 + working_directory: ~/Prebid.js + + - &restore_dep_cache + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - &save_dep_cache + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + - &install + name: Install gulp cli + command: sudo npm install -g gulp-cli + + - &run_unit_test + name: BrowserStack testing + command: gulp test --browserstack --nolintfix - steps: - - checkout + - &run_endtoend_test + name: BrowserStack End to end testing + command: echo "Running end to end test using workflows" - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + # Download and run BrowserStack local + - &setup_browserstack + name : Download BrowserStack Local binary and start it. + command : | + # Download the browserstack binary file + wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip" + # Unzip it + unzip BrowserStackLocal-linux-x64.zip + # Run the file with user's access key + ./BrowserStackLocal ${BROWSERSTACK_ACCESS_KEY} & - - run: npm install + - &unit_test_steps + - checkout + - restore_cache: *restore_dep_cache + - run: npm install + - save_cache: *save_dep_cache + - run: *install + - run: *setup_browserstack + - run: *run_unit_test - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} + - &endtoend_test_steps + - checkout + - restore_cache: *restore_dep_cache + - run: npm install + - save_cache: *save_dep_cache + - run: *install + - run: *setup_browserstack + - run: *run_endtoend_test - - run: sudo npm install -g gulp-cli - # Download and run BrowserStack local - - run: - name : Download BrowserStack Local binary and start it. - command : | - # Download the browserstack binary file - wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip" - # Unzip it - unzip BrowserStackLocal-linux-x64.zip - # Run the file with user's access key - ./BrowserStackLocal ${BROWSERSTACK_ACCESS_KEY} & - # run tests! - - run: - name: BrowserStack testing - command: gulp test --browserstack --nolintfix +version: 2 +jobs: + build: + <<: *environment + steps: *unit_test_steps + e2etest: - docker: - # specify the version you desire here - - image: circleci/node:8.9.0 - steps: - - run: echo "Running end to end test using workflows" + <<: *environment + steps: *endtoend_test_steps + workflows: version: 2 commit: @@ -62,16 +85,11 @@ workflows: nightly: triggers: - schedule: - cron: "0 0 * * *" + cron: "0 * * * *" filters: branches: only: - master - circleci-workflow jobs: - - build - - e2etest: - requires: - - build - - + - e2etest From 910b3c03862a0e7829924da6883e89cd4f81006d Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Mon, 30 Sep 2019 11:57:37 -0400 Subject: [PATCH 5/6] update branch and cron time --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bf753a78337..4932f1c93ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,11 +85,10 @@ workflows: nightly: triggers: - schedule: - cron: "0 * * * *" + cron: "0 0 * * *" filters: branches: only: - master - - circleci-workflow jobs: - e2etest From 4305f5eabd63e22f58488d0fe1554732f8efa972 Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Mon, 7 Oct 2019 16:44:22 -0400 Subject: [PATCH 6/6] add command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4932f1c93ed..0d48ec13fa1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ aliases: - &run_endtoend_test name: BrowserStack End to end testing - command: echo "Running end to end test using workflows" + command: echo "127.0.0.1 test.localhost" | sudo tee -a /etc/hosts && gulp e2e-test --host=test.localhost # Download and run BrowserStack local - &setup_browserstack