From 4900481d96c8d46cd21b526b7f1b7403247449e7 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Thu, 28 Jan 2021 21:49:39 +0200 Subject: [PATCH 1/6] Move VRT config to env variables closes: https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/189 --- .github/workflows/workflow.yml | 5 ++++- cypress.json | 8 -------- cypress/plugins/index.js | 10 ---------- vrt.json | 5 +++++ 4 files changed, 9 insertions(+), 19 deletions(-) create mode 100644 vrt.json diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c213b53d..82403045 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,4 +16,7 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v2 with: - env: VRT_API_KEY=${{ secrets.VRT_API_KEY }},VRT_BRANCH_NAME=${{ github.head_ref }},VRT_CI_BUILD_ID=${{ github.run_id }} + env: + VRT_APIKEY: ${{ secrets.VRT_API_KEY }} + VRT_BRANCHNAME: ${{ github.head_ref }} + VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" diff --git a/cypress.json b/cypress.json index 0f9e291f..6af17eb6 100644 --- a/cypress.json +++ b/cypress.json @@ -8,13 +8,5 @@ "componentFolder": "src", "testFiles": "**/*.spec.*", "env": { - "visualRegressionTracker": { - "apiUrl": "http://162.243.161.172:4200", - "project": "VRT", - "apiKey": "SECRET", - "branchName": "master", - "enableSoftAssert": false, - "ciBuildId": "SOME_UNIQUE_ID" - } } } diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 4499ff35..e98427aa 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -4,16 +4,6 @@ const { module.exports = async (on, config) => { require("cypress-react-unit-test/plugins/react-scripts")(on, config); - - if (config.env.VRT_API_KEY) { - config.env.visualRegressionTracker.apiKey = config.env.VRT_API_KEY; - } - if (config.env.VRT_BRANCH_NAME) { - config.env.visualRegressionTracker.branchName = config.env.VRT_BRANCH_NAME; - } - if (config.env.VRT_CI_BUILD_ID) { - config.env.visualRegressionTracker.ciBuildId = `Github run_id: ${config.env.VRT_CI_BUILD_ID}`; - } addVisualRegressionTrackerPlugin(on, config); return config; }; diff --git a/vrt.json b/vrt.json new file mode 100644 index 00000000..460e267a --- /dev/null +++ b/vrt.json @@ -0,0 +1,5 @@ +{ + "apiUrl": "http://162.243.161.172:4200", + "project": "VRT", + "enableSoftAssert": false +} From 8ce29401cb2e4d349c2cf555372a98b07c240e96 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Thu, 28 Jan 2021 22:04:18 +0200 Subject: [PATCH 2/6] Update workflow.yml --- .github/workflows/workflow.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 82403045..4bab2e5c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -15,8 +15,7 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v2 - with: - env: - VRT_APIKEY: ${{ secrets.VRT_API_KEY }} - VRT_BRANCHNAME: ${{ github.head_ref }} - VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" + env: + VRT_APIKEY: ${{ secrets.VRT_API_KEY }} + VRT_BRANCHNAME: ${{ github.head_ref }} + VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" From 5a708efcdbc4788a0911d8e08c034283dbb636f2 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Thu, 28 Jan 2021 22:07:22 +0200 Subject: [PATCH 3/6] Update workflow.yml --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4bab2e5c..fb14d241 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,6 +16,6 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v2 env: - VRT_APIKEY: ${{ secrets.VRT_API_KEY }} - VRT_BRANCHNAME: ${{ github.head_ref }} - VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" + CYPRESS_VRT_APIKEY: ${{ secrets.VRT_API_KEY }} + CYPRESS_VRT_BRANCHNAME: ${{ github.head_ref }} + CYPRESS_VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" From aa3ace2a358d22d015612547afad6022875fbe31 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Thu, 28 Jan 2021 22:10:24 +0200 Subject: [PATCH 4/6] @visual-regression-tracker/agent-cypress updated --- package-lock.json | 50 ++++++++++++----------------------------------- package.json | 2 +- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8598152d..d1db5011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3109,21 +3109,21 @@ } }, "@visual-regression-tracker/agent-cypress": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@visual-regression-tracker/agent-cypress/-/agent-cypress-4.5.0.tgz", - "integrity": "sha512-LtsxiYHoHlAVKWYpJcILTUS2D2laCNUMC5Fzb5dIr6PLlkZohmpUABRBLZeNqLgUO/BCjD1KYjEGRNCMpV9WRQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@visual-regression-tracker/agent-cypress/-/agent-cypress-4.6.1.tgz", + "integrity": "sha512-JkXKEJdFIM4VMyiECEAGQdxJVmqjKfjuFKKJrVm26xWWdzSALwH0ZQ/Z24fOe20vx18qJf7UUF1GeQohr6rzZg==", "dev": true, "requires": { - "@visual-regression-tracker/sdk-js": "^4.5.0" + "@visual-regression-tracker/sdk-js": "^4.6.3" } }, "@visual-regression-tracker/sdk-js": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@visual-regression-tracker/sdk-js/-/sdk-js-4.5.0.tgz", - "integrity": "sha512-b4jPQMHiBFZhvsfPF3+GZpTLBYXE3LHlgtgPvvaWh83fnSehFq3cQcyouVviQgfDeRi+ovCFs4x9S0fu9ji8lg==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/@visual-regression-tracker/sdk-js/-/sdk-js-4.6.3.tgz", + "integrity": "sha512-hd3gFrJCffi9Tny07BaIWiIKF9+EOBKXZAyKWkCMlsGpT3fX3tOTPUqIwjy+ubiJSXzHN9fHHcPx48QfGfcqWw==", "dev": true, "requires": { - "axios": "^0.19.2" + "axios": "^0.21.0" } }, "@webassemblyjs/ast": { @@ -3753,38 +3753,12 @@ "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" }, "axios": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "dev": true, "requires": { - "follow-redirects": "1.5.10" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "dev": true, - "requires": { - "debug": "=3.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "follow-redirects": "^1.10.0" } }, "axobject-query": { diff --git a/package.json b/package.json index 92002540..c02ca802 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@types/react-material-ui-form-validator": "^2.1.0", "@types/react-router-dom": "^5.1.5", "@types/socket.io-client": "^1.4.33", - "@visual-regression-tracker/agent-cypress": "^4.5.0", + "@visual-regression-tracker/agent-cypress": "^4.6.1", "cypress": "^5.6.0", "cypress-react-unit-test": "^4.17.0" } From bf8ef9ef4e3e5bb302b4567e4b0c50cc82b559c1 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Thu, 28 Jan 2021 22:14:10 +0200 Subject: [PATCH 5/6] updated --- .github/workflows/workflow.yml | 6 +++--- cypress.json | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index fb14d241..4bab2e5c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,6 +16,6 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v2 env: - CYPRESS_VRT_APIKEY: ${{ secrets.VRT_API_KEY }} - CYPRESS_VRT_BRANCHNAME: ${{ github.head_ref }} - CYPRESS_VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" + VRT_APIKEY: ${{ secrets.VRT_API_KEY }} + VRT_BRANCHNAME: ${{ github.head_ref }} + VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" diff --git a/cypress.json b/cypress.json index 6af17eb6..945ce2a8 100644 --- a/cypress.json +++ b/cypress.json @@ -6,7 +6,5 @@ "retries": 0, "experimentalComponentTesting": true, "componentFolder": "src", - "testFiles": "**/*.spec.*", - "env": { - } + "testFiles": "**/*.spec.*" } From 4526fe77d0cebd7da403de22f1d76a789bf56f71 Mon Sep 17 00:00:00 2001 From: Pavlo Strunkin Date: Thu, 28 Jan 2021 22:20:09 +0200 Subject: [PATCH 6/6] updated --- .github/workflows/workflow.yml | 4 ++++ vrt.json | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 vrt.json diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4bab2e5c..b5012fd5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,6 +16,10 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v2 env: + VRT_APIURL: "http://162.243.161.172:4200" + VRT_PROJECT: "VRT" + VRT_ENABLESOFTASSERT: false VRT_APIKEY: ${{ secrets.VRT_API_KEY }} VRT_BRANCHNAME: ${{ github.head_ref }} VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}" + \ No newline at end of file diff --git a/vrt.json b/vrt.json deleted file mode 100644 index 460e267a..00000000 --- a/vrt.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "apiUrl": "http://162.243.161.172:4200", - "project": "VRT", - "enableSoftAssert": false -}