Skip to content

Commit

Permalink
Uplift of #25556 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-builds committed Nov 6, 2024
1 parent 4d800b6 commit 36d7194
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions build/commands/lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const getTestsToRun = (config, suite) => {
if (suite === 'brave_unit_tests') {
if (config.targetOS !== 'android') {
testsToRun.push('brave_installer_unittests')
} else {
testsToRun.push('bin/run_brave_public_test_apk')
}
} else if (suite === 'brave_java_unit_tests') {
testsToRun = ['bin/run_brave_java_unit_tests']
}
return testsToRun
}
Expand Down Expand Up @@ -71,14 +71,11 @@ const buildTests = async (suite, buildConfig = config.defaultBuildConfig, option
let testSuites = [
'brave_unit_tests',
'brave_browser_tests',
'brave_java_unit_tests',
'brave_network_audit_tests',
]
if (testSuites.includes(suite)) {
config.buildTargets = ['brave/test:' + suite]
if (suite === 'brave_unit_tests' && config.targetOS === 'android') {
// We need to build the APK for the java tests as well.
config.buildTargets.push('brave/test:brave_public_test_apk')
}
} else {
config.buildTargets = [suite]
}
Expand Down Expand Up @@ -168,8 +165,8 @@ const runTests = (passthroughArgs, suite, buildConfig, options) => {
}
if (config.targetOS === 'android') {
assert(
config.targetArch === 'x86' || options.manual_android_test_device,
'Only x86 build can be run automatically. For other builds please run test device manually and specify manual_android_test_device flag.')
config.targetArch === 'x86' || config.targetArch === 'x64' || options.manual_android_test_device,
'Only x86 and x64 builds can be run automatically. For other builds please run test device manually and specify manual_android_test_device flag.')
}
if (config.targetOS === 'android' && !options.manual_android_test_device) {
// Specify emulator to run tests on
Expand Down
2 changes: 1 addition & 1 deletion build/commands/scripts/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ program
.option('--target_environment <target_environment>', 'target environment (device, catalyst, simulator)')
.option('--run_disabled_tests', 'run disabled tests')
.option('--manual_android_test_device', 'indicates that Android test device is run manually')
.option('--android_test_emulator_name <emulator_name', 'set name of the Android emulator for tests', 'android_30_google_atd_x86')
.option('--android_test_emulator_name <emulator_name', 'set name of the Android emulator for tests', 'android_33_google_atd_x64')
.option('--use_remoteexec [arg]', 'whether to use RBE for building', JSON.parse)
.option('--offline', 'use offline mode for RBE')
.arguments('[build_config]')
Expand Down
2 changes: 1 addition & 1 deletion test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ if (is_android) {
]
}

chrome_public_test_apk_tmpl("brave_public_test_apk") {
chrome_public_test_apk_tmpl("brave_java_unit_tests") {
apk_name = "BravePublicTest"
android_manifest = brave_public_test_apk_manifest
android_manifest_dep = ":brave_public_test_apk_manifest"
Expand Down

0 comments on commit 36d7194

Please sign in to comment.