Narrow down problem webcontents test

This commit is contained in:
John Kleinschmidt
2024-11-26 10:03:23 -05:00
parent 1c83b3e8cf
commit 0ed0b1716a
2 changed files with 10 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ jobs:
fail-fast: false
matrix:
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'windows' && fromJSON('["windows"]') || fromJSON('["linux"]')) }}
shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }}
shard: ${{ inputs.target-platform != 'macos' && fromJSON('[1, 2, 3, 4, 5, 6]') || fromJSON('[1, 2]') }}
env:
BUILD_TYPE: ${{ matrix.build-type }}
TARGET_ARCH: ${{ inputs.target-arch }}
@@ -191,7 +191,7 @@ jobs:
cd src/electron
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
# Get which tests are on this shard
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 2 || 3 }})
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 2 || 6 }})
# Run tests
if [ "`uname`" = "Darwin" ]; then
@@ -226,7 +226,7 @@ jobs:
echo ELECTRON_TEST_RESULTS_DIR=$PWD\junit >> $env:GITHUB_ENV
# Get which tests are on this shard
echo TEST_SHARD=${{ matrix.shard }} >> $env:GITHUB_ENV
$tests_files=node script\split-tests ${{ matrix.shard }} 4
$tests_files='spec\api-web-contents-spec.ts spec\webview-spec.ts spec\api-ipc-spec.ts spec\api-native-image-spec.ts spec\api-menu-item-spec.ts spec\api-system-preferences-spec.ts spec\api-web-contents-view-spec.ts spec\api-process-spec.ts spec\api-debugger-spec.ts spec\deprecate-spec.ts spec\api-screen-spec.ts spec\security-warnings-spec.ts spec\api-content-tracing-spec.ts spec\api-net-log-spec.ts spec\asar-integrity-spec.ts spec\crash-spec.ts spec\api-web-utils-spec.ts spec\api-power-save-blocker-spec.ts'
echo tests_files="$tests_files" >> $env:GITHUB_ENV
if ('${{ inputs.target-arch }}' -eq 'x86') {
echo npm_config_arch=ia32 >> $env:GITHUB_ENV

View File

@@ -19,7 +19,7 @@ const fixturesPath = path.resolve(__dirname, 'fixtures');
const features = process._linkedBinding('electron_common_features');
describe('webContents module', () => {
xdescribe('getAllWebContents() API', () => {
describe('getAllWebContents() API', () => {
afterEach(closeAllWindows);
it('returns an array of web contents', async () => {
const w = new BrowserWindow({
@@ -45,7 +45,7 @@ describe('webContents module', () => {
});
});
describe('webContents properties', () => {
ifdescribe(process.env.TEST_SHARD !== '1')('webContents properties', () => {
afterEach(closeAllWindows);
it('has expected additional enumerable properties', () => {
@@ -56,13 +56,13 @@ describe('webContents module', () => {
});
});
describe('fromId()', () => {
ifdescribe(process.env.TEST_SHARD !== '2')('fromId()', () => {
it('returns undefined for an unknown id', () => {
expect(webContents.fromId(12345)).to.be.undefined();
});
});
describe('fromFrame()', () => {
ifdescribe(process.env.TEST_SHARD !== '3')('fromFrame()', () => {
afterEach(cleanupWebContents);
it('returns WebContents for mainFrame', () => {
const contents = (webContents as typeof ElectronInternal.WebContents).create();
@@ -85,7 +85,7 @@ describe('webContents module', () => {
});
});
describe('fromDevToolsTargetId()', () => {
ifdescribe(process.env.TEST_SHARD !== '4')('fromDevToolsTargetId()', () => {
afterEach(closeAllWindows);
it('returns WebContents for attached DevTools target', async () => {
const w = new BrowserWindow({ show: false });
@@ -104,7 +104,7 @@ describe('webContents module', () => {
});
});
describe('will-prevent-unload event', function () {
ifdescribe(process.env.TEST_SHARD !== '5')('will-prevent-unload event', function () {
afterEach(async () => {
await closeAllWindows();
await cleanupWebContents();
@@ -164,7 +164,7 @@ describe('webContents module', () => {
});
});
describe('webContents.send(channel, args...)', () => {
ifdescribe(process.env.TEST_SHARD !== '6')('webContents.send(channel, args...)', () => {
afterEach(closeAllWindows);
it('throws an error when the channel is missing', () => {
const w = new BrowserWindow({ show: false });