Skip to content

test: adds scheduled smoke-tests #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
coverage
dist
.cache-eslint-remote-tester
eslint-remote-tester-results
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AriPerkkio is it possible to run non recommended rules as well? For example, we recently added a new rule prefer-in-document which we want to vet before putting in the recommended config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer-in-document is now added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benmonro FYI, just realized this after the merge. I'm not sure but this should probably have been prefixed with plugin name:

'jest-dom/prefer-in-document': 'error'

It's currently now showing any errors but the rule might not have been loaded by ESLint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch. Actually I might add another config with all the rules set to error anyway so we can just switch to that

],
rules: {
'prefer-in-document': 'error'
},
},
};
Loading