From 4018a09f9cb3e743a12ac9f6456b62dec72efe39 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Thu, 10 Dec 2020 11:14:52 -0500 Subject: [PATCH 1/4] bump orb version --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe8958c5..fb7e1c66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,8 @@ # https://circleci.com/docs/2.0/configuration-reference/ version: 2.1 orbs: - cypress: cypress-io/cypress@1.19.2 # used to run e2e tests + # https://github.com/cypress-io/circleci-orb + cypress: cypress-io/cypress@1.26.0 # used to run e2e tests node: circleci/node@1.1.6 # used to publish new NPM version jobs: From 25abe23cb8713337bc2277bd6f39f79b0f018c22 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Thu, 10 Dec 2020 11:22:26 -0500 Subject: [PATCH 2/4] add windows test job --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb7e1c66..b29f1039 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,7 @@ orbs: # https://github.com/cypress-io/circleci-orb cypress: cypress-io/cypress@1.26.0 # used to run e2e tests node: circleci/node@1.1.6 # used to publish new NPM version + win: circleci/windows@2 # run a test job on Windows jobs: unit: @@ -485,6 +486,42 @@ workflows: ../../node_modules/.bin/only-covered main.js working_directory: examples/one-spec + - cypress/run: + name: Windows test + executor: + # executor comes from the "windows" orb + name: win/default + shell: bash.exe + no-workspace: true + start: npm start --prefix examples/all-files + wait-on: 'http://localhost:1234' + command: npx cypress run --project examples/all-files + # store screenshots and videos + store_artifacts: true + post-steps: + - run: cat examples/all-files/.nyc_output/out.json + - run: cat examples/all-files/coverage/coverage-final.json + # store the created coverage report folder + # you can click on it in the CircleCI UI + # to see live static HTML site + - store_artifacts: + path: examples/all-files/coverage + # make sure the examples captures 100% of code + - run: + command: npx nyc report --check-coverage true --lines 100 + working_directory: examples/all-files + - run: + name: Check code coverage 📈 + # we will check the final coverage report + # to make sure it only has files we are interested in + # because there are files covered at 0 in the report + command: | + ../../node_modules/.bin/check-coverage main.js + ../../node_modules/.bin/check-coverage second.js + ../../node_modules/.bin/check-coverage not-covered.js + ../../node_modules/.bin/only-covered --from coverage/coverage-final.json main.js second.js not-covered.js + working_directory: examples/all-files + - publish: filters: branches: @@ -507,3 +544,4 @@ workflows: - example-docker-paths - example-use-webpack - example-all-files + - Windows test From 313b5d798076ef357f1cd447809f3ed79d995f08 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Thu, 10 Dec 2020 11:31:16 -0500 Subject: [PATCH 3/4] add start:windows script --- .circleci/config.yml | 2 +- examples/all-files/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b29f1039..35134092 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -493,7 +493,7 @@ workflows: name: win/default shell: bash.exe no-workspace: true - start: npm start --prefix examples/all-files + start: npm run start:windows --prefix examples/all-files wait-on: 'http://localhost:1234' command: npx cypress run --project examples/all-files # store screenshots and videos diff --git a/examples/all-files/package.json b/examples/all-files/package.json index 59c6d0a8..ed73db59 100644 --- a/examples/all-files/package.json +++ b/examples/all-files/package.json @@ -3,6 +3,7 @@ "description": "Report all files", "scripts": { "start": "../../node_modules/.bin/parcel serve index.html", + "start:windows": "..\\..\\node_modules\\.bin\\parcel serve index.html", "cy:open": "../../node_modules/.bin/cypress open", "cy:run": "../../node_modules/.bin/cypress run", "dev": "../../node_modules/.bin/start-test 1234 cy:open", From 03751ec7364473ea24db22339270a1bbfc4023d2 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Thu, 10 Dec 2020 11:32:18 -0500 Subject: [PATCH 4/4] use bin-up on Windows --- examples/all-files/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/all-files/package.json b/examples/all-files/package.json index ed73db59..497422d3 100644 --- a/examples/all-files/package.json +++ b/examples/all-files/package.json @@ -3,7 +3,7 @@ "description": "Report all files", "scripts": { "start": "../../node_modules/.bin/parcel serve index.html", - "start:windows": "..\\..\\node_modules\\.bin\\parcel serve index.html", + "start:windows": "npx bin-up parcel serve index.html", "cy:open": "../../node_modules/.bin/cypress open", "cy:run": "../../node_modules/.bin/cypress run", "dev": "../../node_modules/.bin/start-test 1234 cy:open",