Skip to content
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

[Tests]: add weekly scheduled smoke tests #2963

Merged
merged 3 commits into from Aug 12, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node-4+.yml
Expand Up @@ -62,7 +62,7 @@ jobs:
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
after_install: npm install --no-save "eslint@${{ matrix.eslint }}"
after_install: npm install --no-save "eslint@${{ matrix.eslint }}" "@typescript-eslint/parser@${{ matrix.node-version >= 10 && '3' || '2' }}"
skip-ls-check: true
env:
NPM_CONFIG_LEGACY_PEER_DEPS: true
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/smoke-test.yml
@@ -0,0 +1,28 @@
name: Smoke test

on:
schedule:
- cron: '0 0 * * SUN'
workflow_dispatch:
AriPerkkio marked this conversation as resolved.
Show resolved Hide resolved

jobs:
lint:
if: ${{ github.repository == 'yannickcr/eslint-plugin-react' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
skip-ls-check: true
- run: |
npm link
npm link eslint-plugin-react
- uses: AriPerkkio/eslint-remote-tester-run-action@v1
with:
issue-title: 'Results of weekly scheduled smoke test'
eslint-remote-tester-config: test/eslint-remote-tester.config.js
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -19,6 +19,7 @@ node_modules
!tests/**/node_modules
npm-debug.log
sftp-config.json
eslint-remote-tester-results

# Only apps should have lockfiles
yarn.lock
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -23,6 +23,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
* [Refactor] `utils/Components`: correct spelling and delete unused code ([#3026][] @ohhoney1)
* [Docs] [`jsx-uses-react`], [`react-in-jsx-scope`]: document [`react/jsx-runtime`] config ([#3018][] @pkuczynski @ljharb)
* [Docs] [`require-default-props`]: fix small typo ([#2994][] @evsasse)
* [Tests] add weekly scheduled smoke tests ([#2963][] @AriPerkkio)

[#3038]: https://github.com/yannickcr/eslint-plugin-react/pull/3038
[#3036]: https://github.com/yannickcr/eslint-plugin-react/issues/3036
Expand All @@ -35,6 +36,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
[#2998]: https://github.com/yannickcr/eslint-plugin-react/pull/2998
[#2994]: https://github.com/yannickcr/eslint-plugin-react/pull/2994
[#2992]: https://github.com/yannickcr/eslint-plugin-react/pull/2992
[#2963]: https://github.com/yannickcr/eslint-plugin-react/pull/2963
[#1617]: https://github.com/yannickcr/eslint-plugin-react/pull/1617
[#1547]: https://github.com/yannickcr/eslint-plugin-react/pull/1547

Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -46,13 +46,15 @@
"@types/eslint": "=7.2.10",
"@types/estree": "^0.0.47",
"@types/node": "^14.14.37",
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0 || ^3.10.1",
"aud": "^1.1.5",
"babel-eslint": "^8.2.6",
"eslint": "^3 || ^4 || ^5 || ^6 || ^7",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-eslint-plugin": "^2.3.0 || ^3.3.1",
"eslint-plugin-import": "^2.23.4",
"eslint-remote-tester": "^1.3.0",
"eslint-remote-tester-repositories": "^0.0.2",
"espree": "^3.5.4",
"istanbul": "^0.4.5",
"markdown-magic": "^2.0.0",
Expand Down
39 changes: 39 additions & 0 deletions test/eslint-remote-tester.config.js
@@ -0,0 +1,39 @@
'use strict';

const eslintRemoteTesterRepositories = require('eslint-remote-tester-repositories');

module.exports = {
repositories: eslintRemoteTesterRepositories.getRepositories({randomize: true}),

pathIgnorePattern: eslintRemoteTesterRepositories.getPathIgnorePattern(),

extensions: ['js', 'jsx', 'ts', 'tsx'],

concurrentTasks: 3,

logLevel: 'info',

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

eslintrc: {
root: true,
env: {
es6: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: '16.13.1'
}
},
extends: ['plugin:react/all']
}
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
4 changes: 4 additions & 0 deletions tests/util/version.js
Expand Up @@ -56,6 +56,8 @@ describe('Version', () => {
});

it('assumes latest version if react is not installed', () => {
sinon.stub(context, 'getFilename').callsFake(() => path.resolve(base, 'detect-version-missing', 'test.js'));

assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);

expectedErrorArgs = [
Expand All @@ -64,6 +66,8 @@ describe('Version', () => {
});

it('warns only once for failure to detect react ', () => {
sinon.stub(context, 'getFilename').callsFake(() => path.resolve(base, 'detect-version-missing', 'test.js'));

assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);
assert.equal(versionUtil.testReactVersion(context, '999.999.999'), true);

Expand Down