Skip to content

Commit cd23b33

Browse files
authored
Move VRT config to env variables (#135)
closes: Visual-Regression-Tracker/Visual-Regression-Tracker#189
1 parent 06e887c commit cd23b33

File tree

5 files changed

+22
-62
lines changed

5 files changed

+22
-62
lines changed

.github/workflows/workflow.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ jobs:
1515

1616
- name: Cypress run
1717
uses: cypress-io/github-action@v2
18-
with:
19-
env: VRT_API_KEY=${{ secrets.VRT_API_KEY }},VRT_BRANCH_NAME=${{ github.head_ref }},VRT_CI_BUILD_ID=${{ github.run_id }}
18+
env:
19+
VRT_APIURL: "http://162.243.161.172:4200"
20+
VRT_PROJECT: "VRT"
21+
VRT_ENABLESOFTASSERT: false
22+
VRT_APIKEY: ${{ secrets.VRT_API_KEY }}
23+
VRT_BRANCHNAME: ${{ github.head_ref }}
24+
VRT_CIBUILDID: "Github run_id: ${{ github.run_id }}"
25+

cypress.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,5 @@
66
"retries": 0,
77
"experimentalComponentTesting": true,
88
"componentFolder": "src",
9-
"testFiles": "**/*.spec.*",
10-
"env": {
11-
"visualRegressionTracker": {
12-
"apiUrl": "http://162.243.161.172:4200",
13-
"project": "VRT",
14-
"apiKey": "SECRET",
15-
"branchName": "master",
16-
"enableSoftAssert": false,
17-
"ciBuildId": "SOME_UNIQUE_ID"
18-
}
19-
}
9+
"testFiles": "**/*.spec.*"
2010
}

cypress/plugins/index.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ const {
44

55
module.exports = async (on, config) => {
66
require("cypress-react-unit-test/plugins/react-scripts")(on, config);
7-
8-
if (config.env.VRT_API_KEY) {
9-
config.env.visualRegressionTracker.apiKey = config.env.VRT_API_KEY;
10-
}
11-
if (config.env.VRT_BRANCH_NAME) {
12-
config.env.visualRegressionTracker.branchName = config.env.VRT_BRANCH_NAME;
13-
}
14-
if (config.env.VRT_CI_BUILD_ID) {
15-
config.env.visualRegressionTracker.ciBuildId = `Github run_id: ${config.env.VRT_CI_BUILD_ID}`;
16-
}
177
addVisualRegressionTrackerPlugin(on, config);
188
return config;
199
};

package-lock.json

Lines changed: 12 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@types/react-material-ui-form-validator": "^2.1.0",
6868
"@types/react-router-dom": "^5.1.5",
6969
"@types/socket.io-client": "^1.4.33",
70-
"@visual-regression-tracker/agent-cypress": "^4.5.0",
70+
"@visual-regression-tracker/agent-cypress": "^4.6.1",
7171
"cypress": "^5.6.0",
7272
"cypress-react-unit-test": "^4.17.0"
7373
}

0 commit comments

Comments
 (0)