diff --git a/README.md b/README.md index 838e583..f1b94f4 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ Read article about [runnning javascript E2E tests faster with Cypress on paralle - [GitLab CI `>= 11.5`](#gitlab-ci--115) - [GitLab CI `< 11.5` (old GitLab CI)](#gitlab-ci--115-old-gitlab-ci) - [SemaphoreCI.com](#semaphorecicom) + - [Semaphore 2.0](#semaphore-20) + - [Semaphore 1.0](#semaphore-10) - [Cirrus-CI.org](#cirrus-ciorg) - [Jenkins](#jenkins) - [Other CI provider](#other-ci-provider) @@ -309,6 +311,42 @@ test_ci_node_1: #### SemaphoreCI.com +##### Semaphore 2.0 + +`@knapsack-pro/cypress` supports environment variables provided by Semaphore CI 2.0 to run your tests. You will have to define a few things in `.semaphore/semaphore.yml` config file. + +- You need to set `KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS`. If you don't want to commit secrets in yml file then you can [follow this guide](https://docs.semaphoreci.com/article/66-environment-variables-and-secrets). +- You need to create as many jobs with unique names (Node 0 - Knapsack Pro, Node 1 - Knapsack Pro etc) as many parallel jobs you want to run. If your test suite is long you should use more parallel jobs. +- If you have 2 parallel jobs you need to set `KNAPSACK_PRO_CI_NODE_TOTAL=2` for each job. +- You need to set job index starting from 0 like `KNAPSACK_PRO_CI_NODE_INDEX=0` for Node 0. + +Below you can find example part of Semaphore CI 2.0 config. + +```yaml +blocks: + - name: Cypress tests + task: + env_vars: + - name: KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS + value: your_api_token_here + prologue: + commands: + - checkout + - nvm install --lts carbon + - sem-version node --lts carbon + + jobs: + - name: Node 0 - Knapsack Pro + commands: + - KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 $(npm bin)/knapsack-pro-cypress + + - name: Node 1 - Knapsack Pro + commands: + - KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 $(npm bin)/knapsack-pro-cypress +``` + +##### Semaphore 1.0 + The only thing you need to do is set up `@knapsack-pro/cypress` for as many parallel threads as you need. Here is an example: ``` diff --git a/package-lock.json b/package-lock.json index f35229f..e20fd50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -855,9 +855,9 @@ } }, "@knapsack-pro/core": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@knapsack-pro/core/-/core-1.1.0.tgz", - "integrity": "sha512-2emYNXjROgi9mgeH7sBI5GW5oxPdOw5DXeZ7YZTblbo0A63J+8NEDeSrzMzKVhL+9i4nnCacsIB8HwjVcxmWKA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@knapsack-pro/core/-/core-1.2.0.tgz", + "integrity": "sha512-63kJpA4gEcSLLibQaKGr/nEKY2CZWkKYYKpIU8vtFCRu9ORIjX0k5rdp+0Gsckdm/QmJ/S4F7GxH0HZu+sFWrQ==", "requires": { "axios": "^0.18.0", "axios-retry": "^3.1.1", @@ -1705,7 +1705,7 @@ }, "axios": { "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "requires": { "follow-redirects": "^1.3.0", @@ -2943,7 +2943,7 @@ }, "enabled": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", "requires": { "env-variable": "0.0.x" @@ -3773,7 +3773,7 @@ }, "fecha": { "version": "2.3.3", - "resolved": "http://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" }, "figures": { @@ -10818,7 +10818,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -10832,7 +10832,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" diff --git a/package.json b/package.json index 81e4688..d53e202 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "knapsack-pro-cypress": "lib/knapsack-pro-cypress.js" }, "dependencies": { - "@knapsack-pro/core": "^1.1.0", + "@knapsack-pro/core": "^1.2.0", "cypress": "^3.1.5", "glob": "^7.1.3", "minimist": "^1.2.0"