Skip to content

Commit

Permalink
remove visual regression
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Nov 28, 2022
1 parent 2204ce8 commit 320919c
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 209 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,63 +66,3 @@ jobs:

- name: Lint FireFox
run: yarn run lint:firefox

visual-regression:
name: Visual Regression
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Use Yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Use node_modules cache
id: node-modules-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
if: |
steps.yarn-cache.outputs.cache-hit != 'true' ||
steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile --non-interactive --silent

- name: Run Cosmos
run: yarn run cosmos &

- name: Wait for Cosmos to boot
run: yarn wait-on http://localhost:5001

- name: Run Puppeteer
run: yarn run visual-regression:exec
env:
COSMOS_HOST: locahost
COSMOS_PORT: 5001

- name: Store image diffs
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: image-snapshots
path: src/panel/__image_snapshots__/__diff_output__/
10 changes: 0 additions & 10 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ With a fixture environment, you can:
- quickly make visual changes to the panel (with hot reloading)
- increase test coverage

##### Updating fixture snapshots

Make sure to run the following command after making any visual changes/additions to fixtures

> Note: Check the diff output in `src/panel/__image_snapshots__/__diff_output__` before updating snapshots
```
yarn visual-regression
```

#### Shallow environment (panel/extension/electron)

When working on functional changes (such as messaging, event handling, etc), the easiest way is going to be in a shallow/test environment.
Expand Down
34 changes: 0 additions & 34 deletions docker-compose.yml

This file was deleted.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
"lint:firefox": "cd dist/extension && web-ext lint",
"lint:prettier": "prettier -c .",
"start": "electron dist/electron/main.js",
"test": "jest --testPathIgnorePatterns visual-regression",
"visual-regression": "./scripts/regression.sh --watch",
"visual-regression:exec": "jest --no-cache visual-regression --runInBand",
"test": "jest",
"webpack:electron": "webpack --config webpack/webpack.electron.config.js",
"webpack:extension": "webpack --config webpack/webpack.extension.config.js",
"type-check": "yarn tsc"
Expand Down Expand Up @@ -129,7 +127,6 @@
"husky": "^4.2.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.4.2",
"jest-image-snapshot": "^4.2.0",
"jest-styled-components": "^7.0.3",
"lint-staged": "^10.3.0",
"nanoid": "^3.1.12",
Expand Down
2 changes: 0 additions & 2 deletions scripts/regression.sh

This file was deleted.

91 changes: 0 additions & 91 deletions src/panel/visual-regression.test.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ declare const global: {
ResizeObserver: ResizeObserver;
};

declare const jasmine: jest.MatcherContext;

(() => {
// Setup enzyme
configure({ adapter: new Adapter() });
Expand Down Expand Up @@ -52,11 +50,6 @@ declare const jasmine: jest.MatcherContext;
},
};

// Exit if not visual regression
if (!jasmine.testPath.includes("visual-regression")) {
return;
}

// Start browser
beforeAll(async () => {
// Aim to render fonts consistently between invocations
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "src/**/visual-regression.test.ts"]
"exclude": ["node_modules"]
}

0 comments on commit 320919c

Please sign in to comment.