diff --git a/build.gradle b/build.gradle index f3eb89117..80d56bc24 100644 --- a/build.gradle +++ b/build.gradle @@ -47,6 +47,7 @@ apply plugin: 'com.vanniktech.maven.publish' repositories { google() + mavenCentral() jcenter() maven { url 'https://jitpack.io' } } diff --git a/src/androidTest/java/cash/z/ecc/android/sdk/PullRequestSuite.kt b/src/androidTest/java/cash/z/ecc/android/sdk/PullRequestSuite.kt new file mode 100644 index 000000000..ccdf73703 --- /dev/null +++ b/src/androidTest/java/cash/z/ecc/android/sdk/PullRequestSuite.kt @@ -0,0 +1,33 @@ +package cash.z.ecc.android.sdk + +import cash.z.ecc.android.sdk.integration.SanityTest +import cash.z.ecc.android.sdk.integration.SmokeTest +import cash.z.ecc.android.sdk.integration.service.ChangeServiceTest +import cash.z.ecc.android.sdk.jni.BranchIdTest +import cash.z.ecc.android.sdk.jni.TransparentTest +import cash.z.ecc.android.sdk.transaction.PersistentTransactionManagerTest +import org.junit.runner.RunWith +import org.junit.runners.Suite + +/** + * Suite of tests to run before submitting a pull request. + * + * For now, these are just the tests that are known to be recently updated and that pass. In the + * near future this suite will contain only fast running tests that can be used to quickly validate + * that a PR hasn't broken anything major. + */ +@RunWith(Suite::class) +@Suite.SuiteClasses( + // Fast tests that only run locally and don't require darksidewalletd or lightwalletd + BranchIdTest::class, + TransparentTest::class, + PersistentTransactionManagerTest::class, + + // potentially exclude because these are long-running (and hit external srvcs) + SanityTest::class, + + // potentially exclude because these hit external services + ChangeServiceTest::class, + SmokeTest::class, +) +class PullRequestSuite diff --git a/src/androidTest/java/cash/z/ecc/android/sdk/integration/SanityTest.kt b/src/androidTest/java/cash/z/ecc/android/sdk/integration/SanityTest.kt index 017832638..98638160c 100644 --- a/src/androidTest/java/cash/z/ecc/android/sdk/integration/SanityTest.kt +++ b/src/androidTest/java/cash/z/ecc/android/sdk/integration/SanityTest.kt @@ -126,7 +126,7 @@ class SanityTest( TestWallet(TestWallet.Backups.SAMPLE_WALLET, ZcashNetwork.Mainnet), "zxviews1q0hxkupsqqqqpqzsffgrk2smjuccedua7zswf5e3rgtv3ga9nhvhjug670egshd6me53r5n083s2m9mf4va4z7t39ltd3wr7hawnjcw09eu85q0ammsg0tsgx24p4ma0uvr4p8ltx5laum2slh2whc23ctwlnxme9w4dw92kalwk5u4wyem8dynknvvqvs68ktvm8qh7nx9zg22xfc77acv8hk3qqll9k3x4v2fa26puu2939ea7hy4hh60ywma69xtqhcy4037ne8g2sg8sq", "031c6355641237643317e2d338f5e8734c57e8aa8ce960ee22283cf2d76bef73be", - 1195000 + 1000000 ) ) } diff --git a/src/androidTest/java/cash/z/ecc/android/sdk/integration/SmokeTest.kt b/src/androidTest/java/cash/z/ecc/android/sdk/integration/SmokeTest.kt index 4dc4fb8c0..160975e50 100644 --- a/src/androidTest/java/cash/z/ecc/android/sdk/integration/SmokeTest.kt +++ b/src/androidTest/java/cash/z/ecc/android/sdk/integration/SmokeTest.kt @@ -47,7 +47,7 @@ class SmokeTest { @Test fun testSync() = runBlocking { - wallet.sync(120_000L) + wallet.sync(300_000L) } companion object { diff --git a/src/androidTest/java/cash/z/ecc/android/sdk/integration/service/ChangeServiceTest.kt b/src/androidTest/java/cash/z/ecc/android/sdk/integration/service/ChangeServiceTest.kt index 330904918..d01f6b598 100644 --- a/src/androidTest/java/cash/z/ecc/android/sdk/integration/service/ChangeServiceTest.kt +++ b/src/androidTest/java/cash/z/ecc/android/sdk/integration/service/ChangeServiceTest.kt @@ -121,7 +121,7 @@ class ChangeServiceTest : ScopedTest() { } assertNotNull("Using an invalid host should generate an exception.", caughtException) assertTrue( - "Exception was of the wrong type.", + "Exception was of the wrong type. Expected ${ChainInfoNotMatching::class.simpleName} but was ${caughtException!!::class.simpleName}", caughtException is ChainInfoNotMatching ) (caughtException as ChainInfoNotMatching).propertyNames.let { props -> diff --git a/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt b/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt index da0e3b603..6a8a3401f 100644 --- a/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt +++ b/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt @@ -44,7 +44,7 @@ class TestWallet( ) : this( backup.seedPhrase, network = network, - startHeight = backup.testnetBirthday, + startHeight = if (network == ZcashNetwork.Mainnet) backup.mainnetBirthday else backup.testnetBirthday, alias = alias ) @@ -151,12 +151,13 @@ class TestWallet( } } - enum class Backups(val seedPhrase: String, val testnetBirthday: Int) { - DEFAULT("column rhythm acoustic gym cost fit keen maze fence seed mail medal shrimp tell relief clip cannon foster soldier shallow refuse lunar parrot banana", 1_355_928), - SAMPLE_WALLET("input frown warm senior anxiety abuse yard prefer churn reject people glimpse govern glory crumble swallow verb laptop switch trophy inform friend permit purpose", 1_330_190), - DEV_WALLET("still champion voice habit trend flight survey between bitter process artefact blind carbon truly provide dizzy crush flush breeze blouse charge solid fish spread", 991645), - ALICE("quantum whisper lion route fury lunar pelican image job client hundred sauce chimney barely life cliff spirit admit weekend message recipe trumpet impact kitten", 1_330_190), - BOB("canvas wine sugar acquire garment spy tongue odor hole cage year habit bullet make label human unit option top calm neutral try vocal arena", 1_330_190), + enum class Backups(val seedPhrase: String, val testnetBirthday: Int, val mainnetBirthday: Int) { + // TODO: get the proper birthday values for these wallets + DEFAULT("column rhythm acoustic gym cost fit keen maze fence seed mail medal shrimp tell relief clip cannon foster soldier shallow refuse lunar parrot banana", 1_355_928, 1_000_000), + SAMPLE_WALLET("input frown warm senior anxiety abuse yard prefer churn reject people glimpse govern glory crumble swallow verb laptop switch trophy inform friend permit purpose", 1_330_190, 1_000_000), + DEV_WALLET("still champion voice habit trend flight survey between bitter process artefact blind carbon truly provide dizzy crush flush breeze blouse charge solid fish spread", 1_000_000, 991645), + ALICE("quantum whisper lion route fury lunar pelican image job client hundred sauce chimney barely life cliff spirit admit weekend message recipe trumpet impact kitten", 1_330_190, 1_000_000), + BOB("canvas wine sugar acquire garment spy tongue odor hole cage year habit bullet make label human unit option top calm neutral try vocal arena", 1_330_190, 1_000_000), ; } } diff --git a/versions.properties b/versions.properties index 511303925..7449ec6e3 100644 --- a/versions.properties +++ b/versions.properties @@ -106,7 +106,7 @@ version.com.google.protobuf..protobuf-gradle-plugin=0.8.16 version.com.nhaarman.mockitokotlin2..mockito-kotlin=2.2.0 -version.com.vanniktech..gradle-maven-publish-plugin=0.14.2 +version.com.vanniktech..gradle-maven-publish-plugin=0.15.0 version.io.grpc..grpc-android=1.37.0 @@ -124,8 +124,12 @@ version.kotlin=1.4.32 ## # available=1.5.0-M1 ## # available=1.5.0-M2 ## # available=1.5.0-RC +## # available=1.5.0 version.kotlinx.coroutines=1.4.2 +## # available=1.4.3-native-mt +## # available=1.4.3 +## # available=1.5.0-RC version.org.jetbrains.dokka..dokka-gradle-plugin=1.4.32 @@ -138,10 +142,10 @@ version.org.junit.jupiter..junit-jupiter-engine=5.7.1 version.org.junit.jupiter..junit-jupiter-migrationsupport=5.7.1 ## # available=5.8.0-M1 -version.org.mockito..mockito-android=3.8.0 +version.org.mockito..mockito-android=3.9.0 -version.org.mockito..mockito-junit-jupiter=3.8.0 +version.org.mockito..mockito-junit-jupiter=3.9.0 -version.org.owasp..dependency-check-gradle=6.1.5 +version.org.owasp..dependency-check-gradle=6.1.6 version.ru.gildor.coroutines..kotlin-coroutines-okhttp=1.0