Skip to content

Commit

Permalink
Update AndroidArgsTest.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfilipow92 committed Jun 1, 2020
1 parent abad4a5 commit 50d74cf
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package ftl.args

import com.google.api.services.testing.model.TestSpecification
import com.google.common.truth.Truth.assertThat
import ftl.args.yml.AppTestPair
import ftl.args.yml.UploadedApks
import ftl.cli.firebase.test.android.AndroidRunCommand
import ftl.config.Device
import ftl.config.FlankRoboDirective
import ftl.config.FtlConstants.defaultAndroidModel
import ftl.config.FtlConstants.defaultAndroidVersion
import ftl.gc.android.setupAndroidTest
import ftl.run.platform.android.createAndroidTestConfig
import ftl.run.platform.runAndroidTests
import ftl.run.platform.android.getAndroidShardChunks
import ftl.run.status.OutputStyle
Expand All @@ -28,7 +24,6 @@ import org.junit.After
import org.junit.Assert
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException
Expand Down Expand Up @@ -1401,6 +1396,19 @@ AndroidArgs
val testSpecification = TestSpecification().setupAndroidTest(androidTestConfig)
assertTrue(testSpecification.androidInstrumentationTest.testTargets.isNotEmpty())
}

@Test
fun `if set max-test-shards to -1 should give maximum amount`() {
val yaml = """
gcloud:
app: $appApk
test: $testApk
flank:
max-test-shards: -1
""".trimIndent()
val args = AndroidArgs.load(yaml)
assertEquals(50, args.maxTestShards)
}
}

private fun AndroidArgs.Companion.load(yamlData: String, cli: AndroidRunCommand? = null): AndroidArgs = load(StringReader(yamlData), cli)

0 comments on commit 50d74cf

Please sign in to comment.