test: drop now-empty remote runner (#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
This commit is contained in:
Jeremy Rose 2022-08-16 12:23:13 -07:00 committed by GitHub
parent e87c4015fe
commit db7c92fd57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
327 changed files with 950 additions and 1707 deletions

65
spec/fixtures/apps/crash/main.js vendored Normal file
View file

@ -0,0 +1,65 @@
const { app, BrowserWindow, crashReporter } = require('electron');
const path = require('path');
const childProcess = require('child_process');
app.setVersion('0.1.0');
const url = app.commandLine.getSwitchValue('crash-reporter-url');
const uploadToServer = !app.commandLine.hasSwitch('no-upload');
const setExtraParameters = app.commandLine.hasSwitch('set-extra-parameters-in-renderer');
const addGlobalParam = app.commandLine.getSwitchValue('add-global-param')?.split(':');
crashReporter.start({
productName: 'Zombies',
companyName: 'Umbrella Corporation',
compress: false,
uploadToServer,
submitURL: url,
ignoreSystemCrashHandler: true,
extra: {
mainProcessSpecific: 'mps'
},
globalExtra: addGlobalParam[0] ? { [addGlobalParam[0]]: addGlobalParam[1] } : {}
});
app.whenReady().then(() => {
const crashType = app.commandLine.getSwitchValue('crash-type');
if (crashType === 'main') {
process.crash();
} else if (crashType === 'renderer') {
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
w.loadURL('about:blank');
if (setExtraParameters) {
w.webContents.executeJavaScript(`
require('electron').crashReporter.addExtraParameter('rendererSpecific', 'rs');
require('electron').crashReporter.addExtraParameter('addedThenRemoved', 'to-be-removed');
require('electron').crashReporter.removeExtraParameter('addedThenRemoved');
`);
}
w.webContents.executeJavaScript('process.crash()');
w.webContents.on('render-process-gone', () => process.exit(0));
} else if (crashType === 'sandboxed-renderer') {
const w = new BrowserWindow({
show: false,
webPreferences: {
sandbox: true,
preload: path.resolve(__dirname, 'sandbox-preload.js'),
contextIsolation: false
}
});
w.loadURL(`about:blank?set_extra=${setExtraParameters ? 1 : 0}`);
w.webContents.on('render-process-gone', () => process.exit(0));
} else if (crashType === 'node') {
const crashesDir = path.join(app.getPath('temp'), `${app.name} Crashes`);
const version = app.getVersion();
const crashPath = path.join(__dirname, 'node-crash.js');
const child = childProcess.fork(crashPath, [url, version, crashesDir], { silent: true });
child.on('exit', () => process.exit(0));
} else {
console.error(`Unrecognized crash type: '${crashType}'`);
process.exit(1);
}
});
setTimeout(() => app.exit(), 30000);

11
spec/fixtures/apps/crash/node-crash.js vendored Normal file
View file

@ -0,0 +1,11 @@
if (process.platform === 'linux') {
process.crashReporter.start({
submitURL: process.argv[2],
productName: 'Zombies',
compress: false,
globalExtra: {
_version: process.argv[3]
}
});
}
process.nextTick(() => process.crash());

4
spec/fixtures/apps/crash/package.json vendored Normal file
View file

@ -0,0 +1,4 @@
{
"name": "electron-test-crash",
"main": "main.js"
}

View file

@ -0,0 +1,10 @@
const { crashReporter } = require('electron');
const params = new URLSearchParams(location.search);
if (params.get('set_extra') === '1') {
crashReporter.addExtraParameter('rendererSpecific', 'rs');
crashReporter.addExtraParameter('addedThenRemoved', 'to-be-removed');
crashReporter.removeExtraParameter('addedThenRemoved');
}
process.crash();