Skip to content

Commit 3a1e1bc

Browse files
authored
New integration test (#1906)
1 parent 4b61c92 commit 3a1e1bc

File tree

10 files changed

+386
-307
lines changed

10 files changed

+386
-307
lines changed

.github/workflows/main.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,28 @@ jobs:
4949
- run: npm install
5050
- run: npm run run-rules-on-codebase
5151
integration:
52+
name: Integration test (${{ matrix.group }})
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
group:
57+
- "1"
58+
- "2"
59+
- "3"
60+
- "4"
61+
- "5"
62+
- "6"
63+
- "7"
64+
- "8"
65+
- "9"
66+
- "10"
67+
- "11"
68+
- "12"
69+
env:
70+
TIMING: 1
5271
runs-on: ubuntu-latest
5372
steps:
5473
- uses: actions/checkout@v3
5574
- uses: actions/setup-node@v3
5675
- run: npm install
57-
- run: npm run integration
76+
- run: npm run integration -- --group ${{ matrix.group }}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
"outdent": "^0.8.0",
8888
"typescript": "^4.8.3",
8989
"vue-eslint-parser": "^9.1.0",
90-
"xo": "^0.52.3"
90+
"xo": "^0.52.3",
91+
"yaml": "^1.10.2"
9192
},
9293
"peerDependencies": {
9394
"eslint": ">=8.23.1"

test/integration/config.js

-38
This file was deleted.

test/integration/package.json

-10
This file was deleted.

test/integration/projects.mjs

+130-116
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,125 @@ import {fileURLToPath} from 'node:url';
33

44
const dirname = path.dirname(fileURLToPath(import.meta.url));
55

6+
function normalizeProject(project) {
7+
if (typeof project === 'string') {
8+
project = {repository: project};
9+
}
10+
11+
const {
12+
repository,
13+
name = repository.split('/').pop(),
14+
ignore = [],
15+
} = project;
16+
17+
return {
18+
location: path.join(dirname, 'fixtures', name),
19+
...project,
20+
name,
21+
repository,
22+
ignore,
23+
};
24+
}
25+
626
export default [
7-
{
8-
name: 'fixtures-local',
9-
location: path.join(dirname, 'fixtures-local'),
10-
},
11-
{
12-
repository: 'https://github.com/avajs/ava',
13-
ignore: [
14-
'test/node_modules',
15-
],
16-
},
17-
'https://github.com/chalk/chalk',
18-
'https://github.com/chalk/wrap-ansi',
19-
'https://github.com/sindresorhus/np',
20-
'https://github.com/sindresorhus/ora',
21-
'https://github.com/sindresorhus/p-map',
22-
'https://github.com/sindresorhus/os-locale',
23-
'https://github.com/sindresorhus/execa',
24-
'https://github.com/sindresorhus/pify',
25-
'https://github.com/sindresorhus/boxen',
26-
'https://github.com/sindresorhus/make-dir',
27-
'https://github.com/SamVerschueren/listr',
28-
'https://github.com/SamVerschueren/listr-update-renderer',
29-
'https://github.com/SamVerschueren/clinton',
30-
'https://github.com/SamVerschueren/bragg',
31-
'https://github.com/SamVerschueren/bragg-router',
32-
'https://github.com/SamVerschueren/dev-time',
33-
'https://github.com/SamVerschueren/decode-uri-component',
34-
'https://github.com/kevva/to-ico',
35-
'https://github.com/kevva/download',
36-
'https://github.com/kevva/brightness',
37-
'https://github.com/kevva/decompress',
38-
'https://github.com/kevva/npm-conf',
39-
'https://github.com/imagemin/imagemin',
40-
'https://github.com/qix-/color-convert',
41-
'https://github.com/sindresorhus/ky',
42-
'https://github.com/sindresorhus/query-string',
43-
'https://github.com/sindresorhus/meow',
44-
'https://github.com/sindresorhus/globby',
45-
'https://github.com/sindresorhus/emittery',
46-
'https://github.com/sindresorhus/p-queue',
47-
'https://github.com/sindresorhus/pretty-bytes',
48-
'https://github.com/sindresorhus/normalize-url',
49-
'https://github.com/sindresorhus/pageres',
50-
{
51-
repository: 'https://github.com/sindresorhus/got',
52-
ignore: [
53-
// This file use `package` keyword as variable
54-
'documentation/examples/gh-got.js',
55-
],
56-
},
27+
[
28+
{
29+
name: 'fixtures-local',
30+
location: path.join(dirname, 'fixtures-local'),
31+
},
32+
{
33+
repository: 'https://github.com/avajs/ava',
34+
ignore: [
35+
'test/node_modules',
36+
'test-tap/fixture/report/edgecases/ast-syntax-error.cjs',
37+
],
38+
},
39+
'https://github.com/chalk/chalk',
40+
'https://github.com/chalk/wrap-ansi',
41+
'https://github.com/sindresorhus/np',
42+
'https://github.com/sindresorhus/ora',
43+
'https://github.com/sindresorhus/p-map',
44+
'https://github.com/sindresorhus/os-locale',
45+
'https://github.com/sindresorhus/execa',
46+
'https://github.com/sindresorhus/pify',
47+
'https://github.com/sindresorhus/boxen',
48+
'https://github.com/sindresorhus/make-dir',
49+
'https://github.com/sindresorhus/ky',
50+
'https://github.com/sindresorhus/query-string',
51+
'https://github.com/sindresorhus/meow',
52+
'https://github.com/sindresorhus/globby',
53+
'https://github.com/sindresorhus/emittery',
54+
'https://github.com/sindresorhus/p-queue',
55+
'https://github.com/sindresorhus/pretty-bytes',
56+
'https://github.com/sindresorhus/normalize-url',
57+
'https://github.com/sindresorhus/pageres',
58+
{
59+
repository: 'https://github.com/sindresorhus/got',
60+
ignore: [
61+
// This file use `package` keyword as variable
62+
'documentation/examples/gh-got.js',
63+
],
64+
},
65+
'https://github.com/sindresorhus/create-dmg',
66+
'https://github.com/sindresorhus/cp-file',
67+
'https://github.com/sindresorhus/capture-website',
68+
{
69+
repository: 'https://github.com/sindresorhus/file-type',
70+
ignore: [
71+
// Contains non-text `.mts` file
72+
'fixture/**',
73+
],
74+
},
75+
'https://github.com/sindresorhus/slugify',
76+
'https://github.com/SamVerschueren/listr',
77+
'https://github.com/SamVerschueren/listr-update-renderer',
78+
'https://github.com/SamVerschueren/clinton',
79+
'https://github.com/SamVerschueren/bragg',
80+
'https://github.com/SamVerschueren/bragg-router',
81+
'https://github.com/SamVerschueren/dev-time',
82+
'https://github.com/SamVerschueren/decode-uri-component',
83+
'https://github.com/kevva/to-ico',
84+
'https://github.com/kevva/download',
85+
'https://github.com/kevva/brightness',
86+
'https://github.com/kevva/decompress',
87+
'https://github.com/kevva/npm-conf',
88+
'https://github.com/imagemin/imagemin',
89+
'https://github.com/qix-/color-convert',
90+
{
91+
repository: 'https://github.com/prettier/prettier',
92+
ignore: [
93+
'tests/**',
94+
],
95+
},
96+
{
97+
repository: 'https://github.com/puppeteer/puppeteer',
98+
ignore: [
99+
// Parser error on `await page.evaluate(() => delete Node);`
100+
// https://github.com/puppeteer/puppeteer/blob/0b1a9ceee2f05f534f0d50079ece172d627a93c7/test/jshandle.spec.js#L151
101+
'test/jshandle.spec.js',
102+
103+
// `package` keyword
104+
// https://github.com/puppeteer/puppeteer/blob/0b1a9ceee2f05f534f0d50079ece172d627a93c7/utils/apply_next_version.js#L17
105+
'utils/apply_next_version.js',
106+
107+
// Global return
108+
'utils/fetch_devices.js',
109+
],
110+
},
111+
'https://github.com/ReactTraining/react-router',
112+
// #902
113+
{
114+
repository: 'https://github.com/reakit/reakit',
115+
ignore: [
116+
'packages/reakit/jest.config.js', // This file use `package` keyword as variable
117+
],
118+
},
119+
// #1030
120+
'https://github.com/astrofox-io/astrofox',
121+
// #1075
122+
'https://github.com/jaredLunde/masonic',
123+
],
57124
// 'https://github.com/eslint/eslint',
58-
{
59-
repository: 'https://github.com/prettier/prettier',
60-
ignore: [
61-
'tests/**',
62-
],
63-
},
64125
{
65126
repository: 'https://github.com/angular/angular',
66127
ignore: [
@@ -79,42 +140,20 @@ export default [
79140
'build/**',
80141
],
81142
},
82-
// This repo use `override` keyword which is not avaiable before TS4.3, temporary disable
83-
// https://github.com/microsoft/vscode/pull/120690/files
84-
// {
85-
// repository: 'https://github.com/microsoft/vscode',
86-
// ignore: [
87-
// // This file use `'\033'`
88-
// 'build/**'
89-
// ]
90-
// },
91-
// 'https://github.com/ElemeFE/element',
92-
// 'https://github.com/iview/iview',
93-
'https://github.com/sindresorhus/create-dmg',
94-
'https://github.com/sindresorhus/cp-file',
95-
'https://github.com/sindresorhus/capture-website',
96-
'https://github.com/sindresorhus/file-type',
97-
'https://github.com/sindresorhus/slugify',
98143
{
99-
repository: 'https://github.com/gatsbyjs/gatsby',
144+
repository: 'https://github.com/microsoft/vscode',
100145
ignore: [
101-
// These files use `flow`
102-
'**/*.js',
146+
// This file use `'\033'`
147+
'build/**',
103148
],
104149
},
150+
'https://github.com/element-plus/element-plus',
151+
'https://github.com/tusen-ai/naive-ui',
105152
{
106-
repository: 'https://github.com/puppeteer/puppeteer',
153+
repository: 'https://github.com/gatsbyjs/gatsby',
107154
ignore: [
108-
// Parser error on `await page.evaluate(() => delete Node);`
109-
// https://github.com/puppeteer/puppeteer/blob/0b1a9ceee2f05f534f0d50079ece172d627a93c7/test/jshandle.spec.js#L151
110-
'test/jshandle.spec.js',
111-
112-
// `package` keyword
113-
// https://github.com/puppeteer/puppeteer/blob/0b1a9ceee2f05f534f0d50079ece172d627a93c7/utils/apply_next_version.js#L17
114-
'utils/apply_next_version.js',
115-
116-
// Global return
117-
'utils/fetch_devices.js',
155+
// These files use `flow`
156+
'**/*.js',
118157
],
119158
},
120159
{
@@ -132,7 +171,6 @@ export default [
132171
'scripts/create-package.js', // This file use `package` keyword as variable
133172
],
134173
},
135-
'https://github.com/ReactTraining/react-router',
136174
'https://github.com/mozilla/pdf.js',
137175
// #912
138176
{
@@ -146,37 +184,13 @@ export default [
146184
'scripts/cypress.js',
147185
],
148186
},
149-
// #902
150-
{
151-
repository: 'https://github.com/reakit/reakit',
152-
ignore: [
153-
'packages/reakit/jest.config.js', // This file use `package` keyword as variable
154-
],
155-
},
156187
// #903
157188
'https://github.com/mattermost/mattermost-webapp',
158-
// #1030
159-
'https://github.com/astrofox-io/astrofox',
160-
// #1075
161-
'https://github.com/jaredLunde/masonic',
162189
// These two project use `decorator`, try to enable when we use `@babel/eslint-parser`
163190
// 'https://github.com/untitled-labs/metabase-custom',
164191
// 'https://github.com/TheThingsNetwork/lorawan-stack',
165-
].map(project => {
166-
if (typeof project === 'string') {
167-
project = {repository: project};
168-
}
169-
170-
const {
171-
repository,
172-
name = repository.split('/').pop(),
173-
ignore = [],
174-
} = project;
175-
176-
return {
177-
...project,
178-
name,
179-
repository,
180-
ignore,
181-
};
182-
});
192+
].flatMap((projectOrProjects, index) =>
193+
Array.isArray(projectOrProjects)
194+
? projectOrProjects.map(project => ({...normalizeProject(project), group: index}))
195+
: [{...normalizeProject(projectOrProjects), group: index}],
196+
);

test/integration/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
To run the integration tests, go to the project root, and run `$ npm run integration`.
44

5-
To run tests on specific projects, run `$ npm run integration projectName1 projectName2 … projectNameN`. The project names can be found in [`projects.js`](projects.js).
5+
To run tests on specific projects, run `$ npm run integration projectName1 projectName2 … projectNameN`. The project names can be found in [`projects.mjs`](projects.mjs).

0 commit comments

Comments
 (0)