Skip to content

Commit db7c92f

Browse files
authored
test: drop now-empty remote runner (electron#35343)
* test: drop the now-empty remote runner from CI * move fixtures to spec-main * remove remote runner * fix stuff * remove global-paths hack * move ts-smoke to spec/ * fix test after merge * rename spec-main to spec * no need to ignore spec/node_modules twice * simplify spec-runner a little * no need to hash pj/yl twice * undo lint change to verify-mksnapshot.py * excessive .. * update electron_woa_testing.yml * don't search for test-results-remote.xml it is never produced now
1 parent e87c401 commit db7c92f

File tree

327 files changed

+951
-1708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+951
-1708
lines changed

.circleci/config/base.yml

-6
Original file line numberDiff line numberDiff line change
@@ -1060,18 +1060,15 @@ steps-tests: &steps-tests
10601060
export MOCHA_TIMEOUT=180000
10611061
echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
10621062
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split --split-by=timings)) 2>&1 | $ASAN_SYMBOLIZE
1063-
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split --split-by=timings)) 2>&1 | $ASAN_SYMBOLIZE
10641063
else
10651064
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
10661065
export ELECTRON_SKIP_NATIVE_MODULE_TESTS=true
10671066
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging)
1068-
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging)
10691067
else
10701068
if [ "$TARGET_ARCH" == "ia32" ]; then
10711069
npm_config_arch=x64 node electron/node_modules/dugite/script/download-git.js
10721070
fi
10731071
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split --split-by=timings))
1074-
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split --split-by=timings))
10751072
fi
10761073
fi
10771074
- run:
@@ -1080,9 +1077,6 @@ steps-tests: &steps-tests
10801077
cd src
10811078
10821079
# Check if test results exist and are not empty.
1083-
if [ ! -s "junit/test-results-remote.xml" ]; then
1084-
exit 1
1085-
fi
10861080
if [ ! -s "junit/test-results-main.xml" ]; then
10871081
exit 1
10881082
fi

.github/workflows/electron_woa_testing.yml

-15
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,6 @@ jobs:
117117
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
118118
MOCHA_REPORTER: mocha-multi-reporters
119119
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
120-
- name: Run Electron Remote based tests
121-
if: ${{ success() || failure() }}
122-
run: |
123-
cd src
124-
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
125-
set npm_config_arch=arm64
126-
cd electron
127-
node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion
128-
env:
129-
ELECTRON_OUT_DIR: Default
130-
IGNORE_YARN_INSTALL_ERROR: 1
131-
ELECTRON_TEST_RESULTS_DIR: junit
132-
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
133-
MOCHA_REPORTER: mocha-multi-reporters
134-
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
135120
- name: Verify ffmpeg
136121
run: |
137122
cd src

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ electron-api.json
3535
electron.d.ts
3636

3737
# Spec hash calculation
38-
spec/.hash
38+
spec-main/.hash
3939

4040
# Eslint Cache
4141
.eslintcache*
@@ -53,4 +53,4 @@ ts-gen
5353
# Used to accelerate builds after sync
5454
patches/mtime-cache.json
5555

56-
spec/fixtures/logo.png
56+
spec-main/fixtures/logo.png

appveyor.yml

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ test_script:
202202
}
203203
- cd electron
204204
- if "%RUN_TESTS%"=="true" ( echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log )
205-
- if "%RUN_TESTS%"=="true" ( echo Running remote test suite & node script/yarn test -- --trace-uncaught --runners=remote --runTestFilesSeparately --enable-logging=file --log-file=%cd%\electron.log )
206205
- if "%RUN_TESTS%"=="true" ( echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log )
207206
- cd ..
208207
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )

build/args/native_tests.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
root_extra_deps = [ "//electron/spec" ]
1+
root_extra_deps = [ "//electron/spec-chromium:spec" ]
22

33
dcheck_always_on = true
44
is_debug = false

docs/development/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ See [issues](issues.md) for more information.
5454
Most pull requests opened against the `electron/electron` repository include
5555
changes to either the C/C++ code in the `shell/` folder,
5656
the TypeScript code in the `lib/` folder, the documentation in `docs/`,
57-
or tests in the `spec/` and `spec-main/` folders.
57+
or tests in the `spec/` folder.
5858

5959
See [pull requests](pull-requests.md) for more information.
6060

docs/development/source-code-directory-structure.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ Electron
7272
| | message loop into Chromium's message loop.
7373
| └── api/ - The implementation of common APIs, and foundations of
7474
| Electron's built-in modules.
75-
├── spec/ - Components of Electron's test suite run in the renderer process.
76-
├── spec-main/ - Components of Electron's test suite run in the main process.
75+
├── spec/ - Components of Electron's test suite run in the main process.
7776
└── BUILD.gn - Building rules of Electron.
7877
```
7978

docs/development/testing.md

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ app (surprise!) that can be found in the `spec` folder. Note that it has
3232
its own `package.json` and that its dependencies are therefore not defined
3333
in the top-level `package.json`.
3434

35-
To run only tests in a specific process, run `npm run test --runners=PROCESS`
36-
where `PROCESS` is one of `main` or `remote`.
37-
3835
To run only specific tests matching a pattern, run `npm run test --
3936
-g=PATTERN`, replacing the `PATTERN` with a regex that matches the tests
4037
you would like to run. As an example: If you want to run only IPC tests, you

patches/chromium/disable_unload_metrics.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Error message:
1515
ptype: expected 'browser' to equal 'renderer'
1616
Error stack trace:
1717
AssertionError: ptype: expected 'browser' to equal 'renderer'
18-
at checkCrash (electron\spec-main\api-crash-reporter-spec.ts:39:35)
19-
at Context.<anonymous> (electron\spec-main\api-crash-reporter-spec.ts:154:7)
18+
at checkCrash (electron\spec\api-crash-reporter-spec.ts:39:35)
19+
at Context.<anonymous> (electron\spec\api-crash-reporter-spec.ts:154:7)
2020
at runMicrotasks (<anonymous>)
2121
at processTicksAndRejections (internal/process/task_queues.js:93:5)
2222

script/lint.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ process.env.PATH = `${process.env.PATH}${path.delimiter}${DEPOT_TOOLS}`;
2323
const IGNORELIST = new Set([
2424
['shell', 'browser', 'resources', 'win', 'resource.h'],
2525
['shell', 'common', 'node_includes.h'],
26-
['spec-main', 'fixtures', 'pages', 'jquery-3.6.0.min.js'],
26+
['spec', 'fixtures', 'pages', 'jquery-3.6.0.min.js'],
2727
['spec', 'ts-smoke', 'electron', 'main.ts'],
2828
['spec', 'ts-smoke', 'electron', 'renderer.ts'],
2929
['spec', 'ts-smoke', 'runner.js']
@@ -113,8 +113,8 @@ const LINTERS = [{
113113
}
114114
}, {
115115
key: 'javascript',
116-
roots: ['build', 'default_app', 'lib', 'npm', 'script', 'spec', 'spec-main'],
117-
ignoreRoots: ['spec/node_modules', 'spec-main/node_modules'],
116+
roots: ['build', 'default_app', 'lib', 'npm', 'script', 'spec'],
117+
ignoreRoots: ['spec/node_modules'],
118118
test: filename => filename.endsWith('.js') || filename.endsWith('.ts'),
119119
run: async (opts, filenames) => {
120120
const eslint = new ESLint({

script/spec-runner.js

+2-26
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const fail = '✗'.red;
1313

1414
const args = require('minimist')(process.argv, {
1515
string: ['runners', 'target'],
16-
boolean: ['buildNativeTests', 'runTestFilesSeparately'],
16+
boolean: ['buildNativeTests'],
1717
unknown: arg => unknownFlags.push(arg)
1818
});
1919

@@ -34,7 +34,6 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx';
3434

3535
const runners = new Map([
3636
['main', { description: 'Main process specs', run: runMainProcessElectronTests }],
37-
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }],
3837
['native', { description: 'Native specs', run: runNativeElectronTests }]
3938
]);
4039

@@ -60,7 +59,6 @@ async function main () {
6059

6160
if (somethingChanged) {
6261
await installSpecModules(path.resolve(__dirname, '..', 'spec'));
63-
await installSpecModules(path.resolve(__dirname, '..', 'spec-main'));
6462
await getSpecHash().then(saveSpecHash);
6563
}
6664

@@ -154,26 +152,6 @@ const specFilter = (file) => {
154152
}
155153
};
156154

157-
async function runTests (specDir, testName) {
158-
if (args.runTestFilesSeparately) {
159-
const getFiles = require('../spec/static/get-files');
160-
const testFiles = await getFiles(path.resolve(__dirname, `../${specDir}`), { filter: specFilter });
161-
const baseElectronDir = path.resolve(__dirname, '..');
162-
unknownArgs.splice(unknownArgs.length, 0, '--files', '');
163-
testFiles.sort().forEach(async (file) => {
164-
unknownArgs.splice((unknownArgs.length - 1), 1, path.relative(baseElectronDir, file));
165-
console.log(`Running tests for ${unknownArgs[unknownArgs.length - 1]}`);
166-
await runTestUsingElectron(specDir, testName);
167-
});
168-
} else {
169-
await runTestUsingElectron(specDir, testName);
170-
}
171-
}
172-
173-
async function runRemoteBasedElectronTests () {
174-
await runTests('spec', 'remote');
175-
}
176-
177155
async function runNativeElectronTests () {
178156
let testTargets = require('./native-test-targets.json');
179157
const outDir = `out/${utils.getOutDir()}`;
@@ -226,7 +204,7 @@ async function runNativeElectronTests () {
226204
}
227205

228206
async function runMainProcessElectronTests () {
229-
await runTests('spec-main', 'main');
207+
await runTestUsingElectron('spec', 'main');
230208
}
231209

232210
async function installSpecModules (dir) {
@@ -261,9 +239,7 @@ function getSpecHash () {
261239
(async () => {
262240
const hasher = crypto.createHash('SHA256');
263241
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec/package.json')));
264-
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec-main/package.json')));
265242
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec/yarn.lock')));
266-
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec-main/yarn.lock')));
267243
hasher.update(fs.readFileSync(path.resolve(__dirname, '../script/spec-runner.js')));
268244
return hasher.digest('hex');
269245
})(),

spec-main/.eslintrc

-19
This file was deleted.

spec-main/package.json

-22
This file was deleted.

0 commit comments

Comments
 (0)