Skip to content

Commit

Permalink
Bump up dependencies (#880)
Browse files Browse the repository at this point in the history
* Bump up dependencies

* Update UT
  • Loading branch information
pawelpasterz authored Jul 10, 2020
1 parent e1d94f8 commit 8ee1317
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 96 deletions.
24 changes: 12 additions & 12 deletions test_runner/buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object Versions {
const val BUGSNAG = "3.6.1"

// https://github.com/3breadt/dd-plist/releases
const val DD_PLIST = "1.22"
const val DD_PLIST = "1.23"

// https://github.com/arturbosch/detekt/releases
const val DETEKT = "1.1.0"
Expand All @@ -12,7 +12,7 @@ object Versions {
const val BINTRAY = "1.8.5"

// https://github.com/johnrengelman/shadow/releases
const val SHADOW = "5.2.0"
const val SHADOW = "6.0.0"

// https://github.com/linkedin/dex-test-parser/releases
const val DEX_TEST_PARSER = "2.2.1"
Expand All @@ -21,10 +21,10 @@ object Versions {
const val KOTLIN = "1.3.72"

// https://github.com/Kotlin/kotlinx.coroutines/releases
const val KOTLIN_COROUTINES = "1.3.2"
const val KOTLIN_COROUTINES = "1.3.7"

// https://github.com/remkop/picocli/releases
const val PICOCLI = "4.2.0"
const val PICOCLI = "4.4.0"

// https://search.maven.org/search?q=a:google-api-services-toolresults%20g:com.google.apis
const val GOOGLE_API_TOOLRESULTS = "v1beta3-rev20190923-1.30.3"
Expand All @@ -45,21 +45,21 @@ object Versions {

// https://github.com/FasterXML/jackson-core/releases
// https://github.com/FasterXML/jackson-dataformat-xml/releases
const val JACKSON = "2.10.0"
const val JACKSON = "2.11.0"

const val JUNIT = "4.12"
const val JUNIT = "4.13"

// https://github.com/jhy/jsoup/releases
const val JSOUP = "1.12.1"
const val JSOUP = "1.13.1"

// https://github.com/ktorio/ktor/releases
const val KTOR = "1.2.5"
const val KTOR = "1.3.2"

// https://github.com/qos-ch/logback/releases
const val LOGBACK = "1.2.3"

// https://github.com/square/okhttp/releases
const val OKHTTP = "4.2.2"
const val OKHTTP = "4.7.2"

// https://github.com/stefanbirkner/system-rules/releases
const val SYSTEM_RULES = "1.19.0"
Expand All @@ -68,12 +68,12 @@ object Versions {
const val TRUTH = "1.0"

// https://github.com/FasterXML/woodstox/releases
const val WOODSTOX = "6.0.1"
const val WOODSTOX = "6.2.1"

const val KOTLIN_LOGGING = "1.7.8"
const val KOTLIN_LOGGING = "1.8.0.1"

// https://github.com/mockk/mockk
const val MOCKK = "1.9.3"
const val MOCKK = "1.10.0"

// https://commons.apache.org/proper/commons-text/
const val COMMON_TEXT = "1.8"
Expand Down
3 changes: 1 addition & 2 deletions test_runner/src/main/kotlin/ftl/gc/UserAuth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import java.io.ObjectOutputStream
import java.net.URI
import java.nio.file.Path
import java.nio.file.Paths
import java.util.concurrent.TimeUnit
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking

Expand Down Expand Up @@ -92,7 +91,7 @@ class UserAuth {
// https://developers.google.com/gdata/docs/auth/oauth#NoLibrary
authorizer.getAndStoreCredentialsFromCode(userId, authCode, uri)

server.stop(0, 0, TimeUnit.SECONDS)
server.stop(0, 0)

val userCredential = authorizer.getCredentials(userId)

Expand Down
57 changes: 26 additions & 31 deletions test_runner/src/test/kotlin/ftl/args/AndroidArgsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import ftl.test.util.FlankTestRunner
import ftl.test.util.TestHelper.absolutePath
import ftl.test.util.TestHelper.assert
import ftl.test.util.TestHelper.getPath
import ftl.test.util.assertThrowsWithMessage
import ftl.util.FlankCommonException
import ftl.util.FlankFatalError
import ftl.util.asFileReference
Expand All @@ -26,13 +27,11 @@ import io.mockk.mockkStatic
import io.mockk.unmockkAll
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Assert
import org.junit.Assert.fail
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
import org.junit.runner.RunWith
import picocli.CommandLine
import java.io.StringReader
Expand Down Expand Up @@ -124,10 +123,6 @@ class AndroidArgsTest {
output-style: single
"""

@Rule
@JvmField
var expectedException = ExpectedException.none()!!

@After
fun tearDown() = unmockkAll()

Expand All @@ -148,50 +143,50 @@ class AndroidArgsTest {

@Test
fun `androidArgs invalidModel`() {
expectedException.expect(FlankFatalError::class.java)
expectedException.expectMessage("Unsupported model id")
AndroidArgs.load(
"""
gcloud:
app: $appApk
test: $testApk
device:
- model: no
version: nope
"""
)
assertThrowsWithMessage(FlankFatalError::class, "Unsupported model id") {
AndroidArgs.load(
"""
gcloud:
app: $appApk
test: $testApk
device:
- model: no
version: nope
"""
)
}
}

@Test
fun `androidArgs invalidVersion`() {
expectedException.expect(FlankFatalError::class.java)
expectedException.expectMessage("Unsupported version id")
AndroidArgs.load(
"""
assertThrowsWithMessage(FlankFatalError::class, "Unsupported version id") {
AndroidArgs.load(
"""
gcloud:
app: $appApk
test: $testApk
device:
- model: NexusLowRes
version: nope
"""
)
)
}
}

@Test
fun `androidArgs incompatibleModel`() {
expectedException.expect(FlankFatalError::class.java)
expectedException.expectMessage("Incompatible model")
AndroidArgs.load(
"""
assertThrowsWithMessage(FlankFatalError::class, "Incompatible model") {
AndroidArgs.load(
"""
gcloud:
app: $appApk
test: $testApk
device:
- model: shamu
version: 18
"""
)
)
}
}

@Test
Expand Down Expand Up @@ -1340,7 +1335,7 @@ AndroidArgs
val resultsDir = UUID.randomUUID().toString()
val directoryPath = Paths.get(resultsDir)
if (Files.exists(directoryPath)) {
Assert.fail("Test directory ($resultsDir) shouldn't exists! It's a remote directory.")
fail("Test directory ($resultsDir) shouldn't exists! It's a remote directory.")
}
val yaml = """
gcloud:
Expand All @@ -1350,7 +1345,7 @@ AndroidArgs
""".trimIndent()
AndroidArgs.load(yaml)
if (Files.exists(directoryPath)) {
Assert.fail("Test directory ($resultsDir) shouldn't be created! It's a remote directory on the cloud!")
fail("Test directory ($resultsDir) shouldn't be created! It's a remote directory on the cloud!")
}
}

Expand Down
43 changes: 22 additions & 21 deletions test_runner/src/test/kotlin/ftl/args/ArgsHelperTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ftl.shard.TestShard
import ftl.shard.stringShards
import ftl.test.util.FlankTestRunner
import ftl.test.util.TestHelper.absolutePath
import ftl.test.util.assertThrowsWithMessage
import ftl.util.FlankFatalError
import io.mockk.every
import io.mockk.spyk
Expand All @@ -26,16 +27,11 @@ import org.junit.Rule
import org.junit.Test
import org.junit.contrib.java.lang.system.EnvironmentVariables
import org.junit.contrib.java.lang.system.SystemErrRule
import org.junit.rules.ExpectedException
import org.junit.runner.RunWith

@RunWith(FlankTestRunner::class)
class ArgsHelperTest {

@Rule
@JvmField
val exceptionRule = ExpectedException.none()!!

@Rule
@JvmField
val systemErrRule = SystemErrRule().muteForSuccessfulTests()!!
Expand All @@ -60,8 +56,9 @@ class ArgsHelperTest {

@Test
fun `assertFileExists fails`() {
exceptionRule.expectMessage("'/tmp/1/2/3/fake' doesn't exist")
assertFileExists("/tmp/1/2/3/fake", "")
assertThrowsWithMessage(Throwable::class, "'/tmp/1/2/3/fake' doesn't exist") {
assertFileExists("/tmp/1/2/3/fake", "")
}
}

@Test
Expand All @@ -71,8 +68,9 @@ class ArgsHelperTest {

@Test
fun `assertGcsFileExists fails`() {
exceptionRule.expectMessage("The file at 'gs://does-not-exist' does not exist")
assertGcsFileExists("gs://does-not-exist")
assertThrowsWithMessage(Throwable::class, "The file at 'gs://does-not-exist' does not exist") {
assertGcsFileExists("gs://does-not-exist")
}
}

@Test(expected = IllegalArgumentException::class)
Expand All @@ -97,20 +95,22 @@ class ArgsHelperTest {

@Test
fun `validateTestMethods validationOn`() {
exceptionRule.expectMessage(" is missing methods: [d].")
val testTargets = listOf("d")
val validTestMethods = listOf("a", "b", "c")
val skipValidation = false
validateTestMethods(testTargets, validTestMethods, "", skipValidation)
assertThrowsWithMessage(Throwable::class, " is missing methods: [d].") {
validateTestMethods(testTargets, validTestMethods, "", skipValidation)
}
}

@Test
fun `validateTestMethods validationOn Empty`() {
exceptionRule.expectMessage("has no tests")
val testTargets = emptyList<String>()
val validTestMethods = emptyList<String>()
val skipValidation = false
validateTestMethods(testTargets, validTestMethods, "", skipValidation)
assertThrowsWithMessage(Throwable::class, "has no tests") {
validateTestMethods(testTargets, validTestMethods, "", skipValidation)
}
}

@Test
Expand Down Expand Up @@ -189,28 +189,29 @@ class ArgsHelperTest {
@Test
fun testInvalidTestShards() {
val maxTestShards = -2
exceptionRule.expectMessage("max-test-shards must be >= ${IArgs.AVAILABLE_SHARD_COUNT_RANGE.first} and <= ${IArgs.AVAILABLE_SHARD_COUNT_RANGE.last}. But current is $maxTestShards")

val args = spyk(AndroidArgs.default())
every { args.maxTestShards } returns maxTestShards
assertCommonProps(args)
assertThrowsWithMessage(Throwable::class, "max-test-shards must be >= ${IArgs.AVAILABLE_SHARD_COUNT_RANGE.first} and <= ${IArgs.AVAILABLE_SHARD_COUNT_RANGE.last}. But current is $maxTestShards") {
assertCommonProps(args)
}
}

@Test
fun testInvalidShardTime() {
exceptionRule.expectMessage("shard-time must be >= 1 or -1")

val args = spyk(AndroidArgs.default())
every { args.shardTime } returns -2
assertCommonProps(args)
assertThrowsWithMessage(Throwable::class, "shard-time must be >= 1 or -1") {
assertCommonProps(args)
}
}

@Test
fun testInvalidRepeatTests() {
exceptionRule.expectMessage("num-test-runs must be >= 1")

val args = spyk(AndroidArgs.default())
every { args.repeatTests } returns 0
assertCommonProps(args)
assertThrowsWithMessage(Throwable::class, "num-test-runs must be >= 1") {
assertCommonProps(args)
}
}
}
Loading

0 comments on commit 8ee1317

Please sign in to comment.