mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1411667 - Remove Spoon plugin references entirely. r=maliu
Spoon and some Gradle work allowed to run certain JUnit 3 test suites locally. At the time, running the various test suites was diffficult. Fast forward, and it's easier to run these suites, and in general they are only run in Android Studio. This will only get better as we move the background services tests into a separate module (Bug 1229149). MozReview-Commit-ID: KZTWmkhwi96 --HG-- extra : rebase_source : 5244e81ffe81e8611034fea1edb07681266a7581
This commit is contained in:
parent
d52916250a
commit
d86b10b8e5
21
build.gradle
21
build.gradle
@ -1,5 +1,3 @@
|
||||
import java.util.regex.Pattern
|
||||
|
||||
def tryInt = { string ->
|
||||
if (string == null) {
|
||||
return string
|
||||
@ -55,10 +53,6 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.4') {
|
||||
// Without these, we get errors linting.
|
||||
exclude module: 'guava'
|
||||
}
|
||||
// Provided in tree.
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.3'
|
||||
}
|
||||
@ -94,21 +88,6 @@ if ('multi' == System.env.AB_CD) {
|
||||
}
|
||||
}
|
||||
|
||||
// Skip unit test for all build variants, unless if it was specifically requested by user.
|
||||
// The enabled property for the unit test tasks is reset based on the command line task names just before the task execution.
|
||||
// I bet there is a easier/cleaner way to do this, but this gets the job done for now.
|
||||
Pattern pattern = Pattern.compile('.*test(.+UnitTest)?.*')
|
||||
boolean startTasksIncludeTest = gradle.startParameter.taskNames.any {
|
||||
taskName ->
|
||||
taskName.matches(pattern)
|
||||
}
|
||||
gradle.taskGraph.beforeTask {
|
||||
Task task ->
|
||||
if (task.name.matches(pattern)) {
|
||||
task.enabled = startTasksIncludeTest
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
subprojects {
|
||||
if (!hasProperty('android')) {
|
||||
|
@ -355,45 +355,6 @@ android.applicationVariants.all { variant ->
|
||||
configureVariantWithJNIWrappers(variant, "Fennec")
|
||||
}
|
||||
|
||||
apply plugin: 'spoon'
|
||||
|
||||
spoon {
|
||||
// For now, let's be verbose.
|
||||
debug = true
|
||||
// It's not helpful to pass when we don't have a device connected.
|
||||
failIfNoDeviceConnected = true
|
||||
|
||||
def spoonPackageName
|
||||
if (gradle.startParameter.taskNames.contains('runBrowserTests')) {
|
||||
spoonPackageName = 'org.mozilla.tests.browser.junit3'
|
||||
}
|
||||
if (gradle.startParameter.taskNames.contains('runBackgroundTests')) {
|
||||
spoonPackageName = 'org.mozilla.gecko.background'
|
||||
}
|
||||
if (project.hasProperty('spoonPackageName')) {
|
||||
// Command line overrides everything.
|
||||
spoonPackageName = project.spoonPackageName
|
||||
}
|
||||
if (spoonPackageName) {
|
||||
instrumentationArgs = ['-e', "package=${spoonPackageName}".toString()]
|
||||
}
|
||||
}
|
||||
|
||||
// // See discussion at https://github.com/stanfy/spoon-gradle-plugin/issues/9.
|
||||
// afterEvaluate {
|
||||
// tasks["spoonLocal${android.testBuildType.capitalize()}AndroidTest"].outputs.upToDateWhen { false }
|
||||
|
||||
// // This is an awkward way to define different sets of instrumentation tests.
|
||||
// // The task name itself is fished at runtime and the package name configured
|
||||
// // in the spoon configuration.
|
||||
// task runBrowserTests {
|
||||
// dependsOn tasks["spoonLocalOldDebugAndroidTest"]
|
||||
// }
|
||||
// task runBackgroundTests {
|
||||
// dependsOn tasks["spoonLocalOldDebugAndroidTest"]
|
||||
// }
|
||||
// }
|
||||
|
||||
// Bug 1299015: Complain to treeherder if checkstyle, lint, or unittest fails. It's not obvious
|
||||
// how to listen to individual errors in most cases, so we just link to the reports for now.
|
||||
def makeTaskExecutionListener(artifactRootUrl) {
|
||||
|
Loading…
Reference in New Issue
Block a user