Skip to content

Commit

Permalink
Remove gradle properties
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelpasterz committed Sep 25, 2020
1 parent 779ca80 commit 0671480
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class FladlePluginDelegate {
// Must be done afterEvaluate otherwise extension values will not be set.
project.dependencies.add(FLADLE_CONFIG, "${base.flankCoordinates.get()}:${base.flankVersion.get()}")

if (project.hasProperty("sanityRobo")) base.sanityRobo.set(true)

// Only use automatic apk path detection for 'com.android.application' projects.
project.pluginManager.withPlugin("com.android.application") {
if (!base.debugApk.isPresent || !base.instrumentationApk.isPresent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,58 @@ class SanityRoboCheck {
|}
|
|fladle {
| sanityRobo = project.hasProperty('sanityRobo')
| serviceAccountCredentials = layout.projectDirectory.file("flank-gradle-service.json")
| debugApk = "foo.apk"
|}
"""
)

val result = gradleRun(
arguments = listOf("printYml", "-PsanityRobo"),
projectDir = testProjectRoot.root
)

assertThat(result.output).contains("SUCCESS")
assertThat(result.output).contains(
"""
|gcloud:
| app: foo.apk
| device:
| - model: NexusLowRes
| version: 28
|
| use-orchestrator: false
| auto-google-login: false
| record-video: true
| performance-metrics: true
| timeout: 15m
| num-flaky-test-attempts: 0
|
|flank:
| keep-file-path: false
| ignore-failed-tests: false
| disable-sharding: false
| smart-flank-disable-upload: false
| legacy-junit-result: false
| full-junit-result: false
| output-style: single
""".trimMargin()
)
}

@Test
fun checkSanityRoboRunWithProjectPropertySetAsExtensionProperty() {
makeGradleFile(
where = testProjectRoot,
buildScript =
"""
|plugins {
| id "com.osacky.fladle"
|}
|
|fladle {
| sanityRobo = true
| serviceAccountCredentials = layout.projectDirectory.file("flank-gradle-service.json")
| debugApk = "foo.apk"
|}
Expand Down Expand Up @@ -74,6 +126,7 @@ class SanityRoboCheck {
|}
|
|fladle {
| sanityRobo = project.hasProperty('sanityRobo')
| serviceAccountCredentials = layout.projectDirectory.file("flank-gradle-service.json")
| debugApk = "foo.apk"
| instrumentationApk = "test.apk"
Expand Down Expand Up @@ -130,6 +183,7 @@ class SanityRoboCheck {
|}
|
|fladle {
| sanityRobo = project.hasProperty('sanityRobo')
| serviceAccountCredentials = layout.projectDirectory.file("flank-gradle-service.json")
| debugApk = "foo.apk"
| instrumentationApk = "test.apk"
Expand Down Expand Up @@ -227,6 +281,7 @@ class SanityRoboCheck {
|}
|
|fladle {
| sanityRobo = project.hasProperty('sanityRobo')
| serviceAccountCredentials = layout.projectDirectory.file("flank-gradle-service.json")
| debugApk = "foo.apk"
| roboScript = "some/path/script.json"
Expand Down Expand Up @@ -278,6 +333,7 @@ class SanityRoboCheck {
|}
|
|fladle {
| sanityRobo = project.hasProperty('sanityRobo')
| serviceAccountCredentials = layout.projectDirectory.file("flank-gradle-service.json")
| debugApk = "foo.apk"
| roboDirectives = [
Expand Down

0 comments on commit 0671480

Please sign in to comment.