Skip to content

Commit

Permalink
test: adds scheduled smoke-tests (#108)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Monro <ben.monro@gmail.com>
  • Loading branch information
AriPerkkio and benmonro committed Nov 29, 2020
1 parent 878cb0e commit bc665c1
Show file tree
Hide file tree
Showing 6 changed files with 757 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/smoke-test.yml
@@ -0,0 +1,22 @@
name: Smoke test

on:
schedule:
- cron: '0 0 * * SUN'
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.11
- run: yarn install
- run: yarn build
- run: yarn link
- run: yarn link eslint-plugin-jest-dom
- run: yarn test:smoke
env:
CI: true
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -7,3 +7,7 @@ dist
# when working with contributors
package-lock.json
yarn.lock

# Smoke test
.cache-eslint-remote-tester
eslint-remote-tester-results
2 changes: 2 additions & 0 deletions .prettierignore
@@ -1,3 +1,5 @@
node_modules
coverage
dist
.cache-eslint-remote-tester
eslint-remote-tester-results
10 changes: 8 additions & 2 deletions package.json
Expand Up @@ -34,6 +34,7 @@
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"test": "kcd-scripts test",
"test:smoke": "eslint-remote-tester --config ./smoke-test/eslint-remote-tester.config.js",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts validate"
},
Expand All @@ -43,9 +44,12 @@
"requireindex": "^1.2.0"
},
"devDependencies": {
"@typescript-eslint/parser": "^4.8.2",
"eslint": "7.14",
"eslint-remote-tester": "^0.3.3",
"jest-extended": "^0.11.5",
"kcd-scripts": "6.5.1"
"kcd-scripts": "6.5.1",
"typescript": "^4.1.2"
},
"peerDependencies": {
"eslint": ">=6.8"
Expand All @@ -61,7 +65,9 @@
"eslintIgnore": [
"node_modules",
"coverage",
"dist"
"dist",
".cache-eslint-remote-tester",
"eslint-remote-tester-results"
],
"engines": {
"node": "^10.12.0 || >=12.0.0",
Expand Down
73 changes: 73 additions & 0 deletions smoke-test/eslint-remote-tester.config.js
@@ -0,0 +1,73 @@
module.exports = {
/** Repositories to scan */
repositories: require('./repositories.json'),

/** Extensions of files under scanning */
extensions: ['js', 'jsx', 'ts', 'tsx'],

/** Optional pattern used to exclude paths */
pathIgnorePattern: `(${[
'node_modules',
'\\/\\.', // Any file or directory starting with dot, e.g. ".git"
'/dist/',
'/build/',
// Common patterns for minified JS
'babel\\.js',
'vendor\\.js',
'vendors\\.js',
'chunk\\.js',
'bundle\\.js',
'react-dom\\.development\\.js',
'\\.min\\.js', // Any *.min.js
// Project specific ignores
'codesandbox-client/packages/app/static/js',
'codesandbox-client/standalone-packages',
'dockunit/platform/assets',
'hyper/bin',
'react-solitaire/lib/index\\.js',
'Khan/perseus/lib',
'glortho/react-keydown/example/public',
'reach/reach-ui/packages/combobox/examples/cities\\.ts',
'reach/reach-ui/website/src/components/cities\\.js',
'reach/reach-ui/website/static/router/static',
'Automattic/wp-calypso/client/components/phone-input/data\\.js',
'test262-main\\.ts',
'sample_vis\\.test\\.mocks\\.ts',
].join('|')})`,

/** Empty array since we are only interested in linter crashes */
rulesUnderTesting: [],

/** Maximum amount of tasks ran concurrently */
concurrentTasks: 2,

/** Optional boolean flag used to enable caching of cloned repositories. For CIs it's ideal to disable caching. Defauls to true. */
cache: false,

/** ESLint configuration */
eslintrc: {
root: true,
env: {
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'jest-dom',
],
extends: [
'plugin:jest-dom/recommended',
],
rules: {
'prefer-in-document': 'error'
},
},
};

0 comments on commit bc665c1

Please sign in to comment.