From 016c465c659377de1de8375fe56b1c6498ecc1e4 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 4 Oct 2023 10:12:55 +0200 Subject: [PATCH] build: remove native specs --- .circleci/config/base.yml | 2 +- BUILD.gn | 19 ------------ appveyor-woa.yml | 6 ++-- appveyor.yml | 9 ++---- script/native-test-targets.json | 3 -- script/spec-runner.js | 55 +-------------------------------- 6 files changed, 7 insertions(+), 87 deletions(-) delete mode 100644 script/native-test-targets.json diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 7cc7a94bfb229..318b6e703436b 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -1210,7 +1210,7 @@ commands: build-type: << parameters.build-type >> - *step-maybe-electron-dist-strip - step-electron-dist-build: - additional-targets: shell_browser_ui_unittests electron:node_headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip + additional-targets: electron:node_headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip - *step-show-goma-stats diff --git a/BUILD.gn b/BUILD.gn index b73fb54f3a009..be2c03e16797d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1328,25 +1328,6 @@ if (is_mac) { } } -test("shell_browser_ui_unittests") { - sources = [ - "//electron/shell/browser/ui/accelerator_util_unittests.cc", - "//electron/shell/browser/ui/run_all_unittests.cc", - ] - - configs += [ ":electron_lib_config" ] - - deps = [ - ":electron_lib", - "//base", - "//base/test:test_support", - "//testing/gmock", - "//testing/gtest", - "//ui/base", - "//ui/strings", - ] -} - template("dist_zip") { _runtime_deps_target = "${target_name}__deps" _runtime_deps_file = diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 4964d92161f30..33a744174bcbd 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -156,7 +156,6 @@ for: - gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%" - ninja -C out/ffmpeg electron:electron_ffmpeg_zip - ninja -C out/Default electron:electron_dist_zip - - ninja -C out/Default shell_browser_ui_unittests - gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args # Remove unused args from mksnapshot_args - ps: >- @@ -195,7 +194,7 @@ for: if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME" } else { - $artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip' + $artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip' foreach($artifact_name in $artifacts_to_validate) { if ($artifact_name -eq 'ffmpeg.zip') { $artifact_file = "out\ffmpeg\ffmpeg.zip" @@ -233,7 +232,6 @@ for: - cd C:\projects\src - if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json ) - if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip) - - if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe) - if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip) - if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip) - if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip) @@ -277,7 +275,7 @@ for: if ($job.name -eq "Build Arm on X64 Windows") { $jobId = $job.jobId foreach($artifact_name in $artifacts_to_download) { - if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') { + if ($artifact_name -eq 'electron.lib') { $outfile = "src\out\Default\$artifact_name" } else { $outfile = $artifact_name diff --git a/appveyor.yml b/appveyor.yml index 3c2b07405f578..02484655b0f83 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -154,7 +154,6 @@ for: - gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%" - ninja -C out/ffmpeg electron:electron_ffmpeg_zip - ninja -C out/Default electron:electron_dist_zip - - ninja -C out/Default shell_browser_ui_unittests - gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args # Remove unused args from mksnapshot_args - ps: >- @@ -193,7 +192,7 @@ for: if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME" } else { - $artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip' + $artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip' foreach($artifact_name in $artifacts_to_validate) { if ($artifact_name -eq 'ffmpeg.zip') { $artifact_file = "out\ffmpeg\ffmpeg.zip" @@ -231,7 +230,6 @@ for: - cd C:\projects\src - if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json ) - if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip) - - if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe) - if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip) - if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip) - if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip) @@ -268,12 +266,12 @@ for: # Download build artifacts $apiUrl = 'https://ci.appveyor.com/api' $build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID" - $artifacts_to_download = @('dist.zip','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib') + $artifacts_to_download = @('dist.zip','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib') foreach ($job in $build_info.build.jobs) { if ($job.name -eq "Build") { $jobId = $job.jobId foreach($artifact_name in $artifacts_to_download) { - if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') { + if ($artifact_name -eq 'electron.lib') { $outfile = "src\out\Default\$artifact_name" } else { $outfile = $artifact_name @@ -307,7 +305,6 @@ for: $env:npm_config_arch = "ia32" } - echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log - - echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log - 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/native-test-targets.json b/script/native-test-targets.json deleted file mode 100644 index 7819797145775..0000000000000 --- a/script/native-test-targets.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "shell_browser_ui_unittests" -] \ No newline at end of file diff --git a/script/spec-runner.js b/script/spec-runner.js index cf7bfc0c41697..04be288e4e877 100755 --- a/script/spec-runner.js +++ b/script/spec-runner.js @@ -15,7 +15,6 @@ const fail = '✗'.red; const args = require('minimist')(process.argv, { string: ['runners', 'target', 'electronVersion'], - boolean: ['buildNativeTests'], unknown: arg => unknownFlags.push(arg) }); @@ -35,8 +34,7 @@ const BASE = path.resolve(__dirname, '../..'); const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'; const runners = new Map([ - ['main', { description: 'Main process specs', run: runMainProcessElectronTests }], - ['native', { description: 'Native specs', run: runNativeElectronTests }] + ['main', { description: 'Main process specs', run: runMainProcessElectronTests }] ]); const specHashPath = path.resolve(__dirname, '../spec/.hash'); @@ -183,57 +181,6 @@ async function runTestUsingElectron (specDir, testName) { console.log(`${pass} Electron ${testName} process tests passed.`); } -async function runNativeElectronTests () { - let testTargets = require('./native-test-targets.json'); - const outDir = `out/${utils.getOutDir()}`; - - // If native tests are being run, only one arg would be relevant - if (args.target && !testTargets.includes(args.target)) { - console.log(`${fail} ${args.target} must be a subset of [${[testTargets].join(', ')}]`); - process.exit(1); - } - - // Optionally build all native test targets - if (args.buildNativeTests) { - for (const target of testTargets) { - const build = childProcess.spawnSync('ninja', ['-C', outDir, target], { - cwd: path.resolve(__dirname, '../..'), - stdio: 'inherit' - }); - - // Exit if test target failed to build - if (build.status !== 0) { - console.log(`${fail} ${target} failed to build.`); - process.exit(1); - } - } - } - - // If a specific target was passed, only build and run that target - if (args.target) testTargets = [args.target]; - - // Run test targets - const failures = []; - for (const target of testTargets) { - console.info('\nRunning native test for target:', target); - const testRun = childProcess.spawnSync(`./${outDir}/${target}`, { - cwd: path.resolve(__dirname, '../..'), - stdio: 'inherit' - }); - - // Collect failures and log at end - if (testRun.status !== 0) failures.push({ target }); - } - - // Exit if any failures - if (failures.length > 0) { - console.log(`${fail} Electron native tests failed for the following targets: `, failures); - process.exit(1); - } - - console.log(`${pass} Electron native tests passed.`); -} - async function runMainProcessElectronTests () { await runTestUsingElectron('spec', 'main'); }