diff --git a/appveyor-woa.yml b/appveyor-woa.yml index efe6ce71f2a..567a0c171e8 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -45,10 +45,16 @@ environment: matrix: - job_name: Build Arm on X64 Windows - - job_name: Test On Windows On Arm Hardware + - job_name: Test On Windows On Arm Hardware 1 job_depends_on: Build Arm on X64 Windows APPVEYOR_BUILD_WORKER_IMAGE: base-woa APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa + shard: 1 + - job_name: Test On Windows On Arm Hardware 2 + job_depends_on: Build Arm on X64 Windows + APPVEYOR_BUILD_WORKER_IMAGE: base-woa + APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa + shard: 2 clone_script: - ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER @@ -254,7 +260,8 @@ for: } - matrix: only: - - job_name: Test On Windows On Arm Hardware + - job_name: Test On Windows On Arm Hardware 1 + - job_name: Test On Windows On Arm Hardware 2 environment: IGNORE_YARN_INSTALL_ERROR: 1 @@ -326,7 +333,9 @@ for: if ($env:TARGET_ARCH -eq 'ia32') { $env:npm_config_arch = "ia32" } - - echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion + - ps: $env:tests_files=node script\split-tests $env:shard 2 + - echo "Running shard %shard% specs %tests_files%" + - echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion --files %tests_files% - cd .. - echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg diff --git a/appveyor.yml b/appveyor.yml index 8231c28d05f..d6585708736 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,8 +45,12 @@ environment: matrix: - job_name: Build - - job_name: Test + - job_name: Test 1 job_depends_on: Build + shard: 1 + - job_name: Test 2 + job_depends_on: Build + shard: 2 clone_script: - ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER @@ -246,7 +250,8 @@ for: } - matrix: only: - - job_name: Test + - job_name: Test 1 + - job_name: Test 2 environment: DD_ENV: ci @@ -316,7 +321,9 @@ for: if ($env:TARGET_ARCH -eq 'ia32') { $env:npm_config_arch = "ia32" } - - echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging + - ps: $env:tests_files=node script\split-tests $env:shard 2 + - echo "Running shard %shard% specs %tests_files%" + - echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging --files %tests_files% - cd .. - echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg - echo "About to verify mksnapshot" diff --git a/script/split-tests.js b/script/split-tests.js index d91fa207092..b31c0934d9f 100644 --- a/script/split-tests.js +++ b/script/split-tests.js @@ -1,6 +1,9 @@ const glob = require('glob'); const fs = require('node:fs'); +const path = require('node:path'); + +const VISIBILITY_SPEC = 'spec\\visibility-state-spec.ts'; const currentShard = parseInt(process.argv[2], 10); const shardCount = parseInt(process.argv[3], 10); @@ -25,9 +28,16 @@ specFiles.sort((a, b) => { let shard = 0; for (const specFile of specFiles) { - buckets[shard].push(specFile); + buckets[shard].push(path.normalize(specFile)); shard++; if (shard === shardCount) shard = 0; } +const visiblitySpecIdx = buckets[currentShard - 1]; +if (visiblitySpecIdx > -1) { + // If visibility-state-spec is in the list, move it to the first position + // so that it gets executed first to avoid other specs interferring with it. + buckets[currentShard - 1].splice(visiblitySpecIdx, 1); + buckets[currentShard - 1].unshift(VISIBILITY_SPEC); +} console.log(buckets[currentShard - 1].join(' ')); diff --git a/spec/fixtures/chromium/visibilitystate.html b/spec/fixtures/chromium/visibilitystate.html index 7b1576b9d7e..5e0f97540e1 100644 --- a/spec/fixtures/chromium/visibilitystate.html +++ b/spec/fixtures/chromium/visibilitystate.html @@ -7,12 +7,6 @@