Skip to content

Commit bc665c1

Browse files
AriPerkkiobenmonro
andauthored
test: adds scheduled smoke-tests (#108)
Co-authored-by: Ben Monro <ben.monro@gmail.com>
1 parent 878cb0e commit bc665c1

File tree

6 files changed

+757
-2
lines changed

6 files changed

+757
-2
lines changed

.github/workflows/smoke-test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Smoke test
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * SUN'
6+
workflow_dispatch:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.11
16+
- run: yarn install
17+
- run: yarn build
18+
- run: yarn link
19+
- run: yarn link eslint-plugin-jest-dom
20+
- run: yarn test:smoke
21+
env:
22+
CI: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ dist
77
# when working with contributors
88
package-lock.json
99
yarn.lock
10+
11+
# Smoke test
12+
.cache-eslint-remote-tester
13+
eslint-remote-tester-results

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
coverage
33
dist
4+
.cache-eslint-remote-tester
5+
eslint-remote-tester-results

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"lint": "kcd-scripts lint",
3535
"setup": "npm install && npm run validate -s",
3636
"test": "kcd-scripts test",
37+
"test:smoke": "eslint-remote-tester --config ./smoke-test/eslint-remote-tester.config.js",
3738
"test:update": "npm test -- --updateSnapshot --coverage",
3839
"validate": "kcd-scripts validate"
3940
},
@@ -43,9 +44,12 @@
4344
"requireindex": "^1.2.0"
4445
},
4546
"devDependencies": {
47+
"@typescript-eslint/parser": "^4.8.2",
4648
"eslint": "7.14",
49+
"eslint-remote-tester": "^0.3.3",
4750
"jest-extended": "^0.11.5",
48-
"kcd-scripts": "6.5.1"
51+
"kcd-scripts": "6.5.1",
52+
"typescript": "^4.1.2"
4953
},
5054
"peerDependencies": {
5155
"eslint": ">=6.8"
@@ -61,7 +65,9 @@
6165
"eslintIgnore": [
6266
"node_modules",
6367
"coverage",
64-
"dist"
68+
"dist",
69+
".cache-eslint-remote-tester",
70+
"eslint-remote-tester-results"
6571
],
6672
"engines": {
6773
"node": "^10.12.0 || >=12.0.0",
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
module.exports = {
2+
/** Repositories to scan */
3+
repositories: require('./repositories.json'),
4+
5+
/** Extensions of files under scanning */
6+
extensions: ['js', 'jsx', 'ts', 'tsx'],
7+
8+
/** Optional pattern used to exclude paths */
9+
pathIgnorePattern: `(${[
10+
'node_modules',
11+
'\\/\\.', // Any file or directory starting with dot, e.g. ".git"
12+
'/dist/',
13+
'/build/',
14+
15+
// Common patterns for minified JS
16+
'babel\\.js',
17+
'vendor\\.js',
18+
'vendors\\.js',
19+
'chunk\\.js',
20+
'bundle\\.js',
21+
'react-dom\\.development\\.js',
22+
'\\.min\\.js', // Any *.min.js
23+
24+
// Project specific ignores
25+
'codesandbox-client/packages/app/static/js',
26+
'codesandbox-client/standalone-packages',
27+
'dockunit/platform/assets',
28+
'hyper/bin',
29+
'react-solitaire/lib/index\\.js',
30+
'Khan/perseus/lib',
31+
'glortho/react-keydown/example/public',
32+
'reach/reach-ui/packages/combobox/examples/cities\\.ts',
33+
'reach/reach-ui/website/src/components/cities\\.js',
34+
'reach/reach-ui/website/static/router/static',
35+
'Automattic/wp-calypso/client/components/phone-input/data\\.js',
36+
'test262-main\\.ts',
37+
'sample_vis\\.test\\.mocks\\.ts',
38+
].join('|')})`,
39+
40+
/** Empty array since we are only interested in linter crashes */
41+
rulesUnderTesting: [],
42+
43+
/** Maximum amount of tasks ran concurrently */
44+
concurrentTasks: 2,
45+
46+
/** Optional boolean flag used to enable caching of cloned repositories. For CIs it's ideal to disable caching. Defauls to true. */
47+
cache: false,
48+
49+
/** ESLint configuration */
50+
eslintrc: {
51+
root: true,
52+
env: {
53+
es6: true,
54+
},
55+
parser: '@typescript-eslint/parser',
56+
parserOptions: {
57+
ecmaVersion: 2020,
58+
sourceType: 'module',
59+
ecmaFeatures: {
60+
jsx: true,
61+
},
62+
},
63+
plugins: [
64+
'jest-dom',
65+
],
66+
extends: [
67+
'plugin:jest-dom/recommended',
68+
],
69+
rules: {
70+
'prefer-in-document': 'error'
71+
},
72+
},
73+
};

0 commit comments

Comments
 (0)