Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
test: drop now-empty remote runner (electron#35343)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nornagon authored and khalwa committed Feb 22, 2023
1 parent 4181b59 commit 6fa8d10
Show file tree
Hide file tree
Showing 327 changed files with 951 additions and 1,708 deletions.
6 changes: 0 additions & 6 deletions .circleci/config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1060,18 +1060,15 @@ steps-tests: &steps-tests
export MOCHA_TIMEOUT=180000
echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
(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
(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
else
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
export ELECTRON_SKIP_NATIVE_MODULE_TESTS=true
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging)
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging)
else
if [ "$TARGET_ARCH" == "ia32" ]; then
npm_config_arch=x64 node electron/node_modules/dugite/script/download-git.js
fi
(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))
(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))
fi
fi
- run:
Expand All @@ -1080,9 +1077,6 @@ steps-tests: &steps-tests
cd src
# Check if test results exist and are not empty.
if [ ! -s "junit/test-results-remote.xml" ]; then
exit 1
fi
if [ ! -s "junit/test-results-main.xml" ]; then
exit 1
fi
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/electron_woa_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ jobs:
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
- name: Run Electron Remote based tests
if: ${{ success() || failure() }}
run: |
cd src
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
set npm_config_arch=arm64
cd electron
node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion
env:
ELECTRON_OUT_DIR: Default
IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
- name: Verify ffmpeg
run: |
cd src
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ electron-api.json
electron.d.ts

# Spec hash calculation
spec/.hash
spec-main/.hash

# Eslint Cache
.eslintcache*
Expand All @@ -53,4 +53,4 @@ ts-gen
# Used to accelerate builds after sync
patches/mtime-cache.json

spec/fixtures/logo.png
spec-main/fixtures/logo.png
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ test_script:
}
- cd electron
- 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 )
- 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 )
- 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 )
- cd ..
- 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 )
Expand Down
2 changes: 1 addition & 1 deletion build/args/native_tests.gn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root_extra_deps = [ "//electron/spec" ]
root_extra_deps = [ "//electron/spec-chromium:spec" ]

dcheck_always_on = true
is_debug = false
Expand Down
2 changes: 1 addition & 1 deletion docs/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ See [issues](issues.md) for more information.
Most pull requests opened against the `electron/electron` repository include
changes to either the C/C++ code in the `shell/` folder,
the TypeScript code in the `lib/` folder, the documentation in `docs/`,
or tests in the `spec/` and `spec-main/` folders.
or tests in the `spec/` folder.

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

Expand Down
3 changes: 1 addition & 2 deletions docs/development/source-code-directory-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ Electron
| | message loop into Chromium's message loop.
| └── api/ - The implementation of common APIs, and foundations of
| Electron's built-in modules.
├── spec/ - Components of Electron's test suite run in the renderer process.
├── spec-main/ - Components of Electron's test suite run in the main process.
├── spec/ - Components of Electron's test suite run in the main process.
└── BUILD.gn - Building rules of Electron.
```

Expand Down
3 changes: 0 additions & 3 deletions docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ app (surprise!) that can be found in the `spec` folder. Note that it has
its own `package.json` and that its dependencies are therefore not defined
in the top-level `package.json`.

To run only tests in a specific process, run `npm run test --runners=PROCESS`
where `PROCESS` is one of `main` or `remote`.

To run only specific tests matching a pattern, run `npm run test --
-g=PATTERN`, replacing the `PATTERN` with a regex that matches the tests
you would like to run. As an example: If you want to run only IPC tests, you
Expand Down
4 changes: 2 additions & 2 deletions patches/chromium/disable_unload_metrics.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Error message:
ptype: expected 'browser' to equal 'renderer'
Error stack trace:
AssertionError: ptype: expected 'browser' to equal 'renderer'
at checkCrash (electron\spec-main\api-crash-reporter-spec.ts:39:35)
at Context.<anonymous> (electron\spec-main\api-crash-reporter-spec.ts:154:7)
at checkCrash (electron\spec\api-crash-reporter-spec.ts:39:35)
at Context.<anonymous> (electron\spec\api-crash-reporter-spec.ts:154:7)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

Expand Down
6 changes: 3 additions & 3 deletions script/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ process.env.PATH = `${process.env.PATH}${path.delimiter}${DEPOT_TOOLS}`;
const IGNORELIST = new Set([
['shell', 'browser', 'resources', 'win', 'resource.h'],
['shell', 'common', 'node_includes.h'],
['spec-main', 'fixtures', 'pages', 'jquery-3.6.0.min.js'],
['spec', 'fixtures', 'pages', 'jquery-3.6.0.min.js'],
['spec', 'ts-smoke', 'electron', 'main.ts'],
['spec', 'ts-smoke', 'electron', 'renderer.ts'],
['spec', 'ts-smoke', 'runner.js']
Expand Down Expand Up @@ -113,8 +113,8 @@ const LINTERS = [{
}
}, {
key: 'javascript',
roots: ['build', 'default_app', 'lib', 'npm', 'script', 'spec', 'spec-main'],
ignoreRoots: ['spec/node_modules', 'spec-main/node_modules'],
roots: ['build', 'default_app', 'lib', 'npm', 'script', 'spec'],
ignoreRoots: ['spec/node_modules'],
test: filename => filename.endsWith('.js') || filename.endsWith('.ts'),
run: async (opts, filenames) => {
const eslint = new ESLint({
Expand Down
28 changes: 2 additions & 26 deletions script/spec-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fail = '✗'.red;

const args = require('minimist')(process.argv, {
string: ['runners', 'target'],
boolean: ['buildNativeTests', 'runTestFilesSeparately'],
boolean: ['buildNativeTests'],
unknown: arg => unknownFlags.push(arg)
});

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

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

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

if (somethingChanged) {
await installSpecModules(path.resolve(__dirname, '..', 'spec'));
await installSpecModules(path.resolve(__dirname, '..', 'spec-main'));
await getSpecHash().then(saveSpecHash);
}

Expand Down Expand Up @@ -154,26 +152,6 @@ const specFilter = (file) => {
}
};

async function runTests (specDir, testName) {
if (args.runTestFilesSeparately) {
const getFiles = require('../spec/static/get-files');
const testFiles = await getFiles(path.resolve(__dirname, `../${specDir}`), { filter: specFilter });
const baseElectronDir = path.resolve(__dirname, '..');
unknownArgs.splice(unknownArgs.length, 0, '--files', '');
testFiles.sort().forEach(async (file) => {
unknownArgs.splice((unknownArgs.length - 1), 1, path.relative(baseElectronDir, file));
console.log(`Running tests for ${unknownArgs[unknownArgs.length - 1]}`);
await runTestUsingElectron(specDir, testName);
});
} else {
await runTestUsingElectron(specDir, testName);
}
}

async function runRemoteBasedElectronTests () {
await runTests('spec', 'remote');
}

async function runNativeElectronTests () {
let testTargets = require('./native-test-targets.json');
const outDir = `out/${utils.getOutDir()}`;
Expand Down Expand Up @@ -226,7 +204,7 @@ async function runNativeElectronTests () {
}

async function runMainProcessElectronTests () {
await runTests('spec-main', 'main');
await runTestUsingElectron('spec', 'main');
}

async function installSpecModules (dir) {
Expand Down Expand Up @@ -261,9 +239,7 @@ function getSpecHash () {
(async () => {
const hasher = crypto.createHash('SHA256');
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec/package.json')));
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec-main/package.json')));
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec/yarn.lock')));
hasher.update(fs.readFileSync(path.resolve(__dirname, '../spec-main/yarn.lock')));
hasher.update(fs.readFileSync(path.resolve(__dirname, '../script/spec-runner.js')));
return hasher.digest('hex');
})(),
Expand Down
19 changes: 0 additions & 19 deletions spec-main/.eslintrc

This file was deleted.

22 changes: 0 additions & 22 deletions spec-main/package.json

This file was deleted.

0 comments on commit 6fa8d10

Please sign in to comment.