aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-01-03 23:50:46 -0500
committerAllan Wang <me@allanwang.ca>2019-01-03 23:50:46 -0500
commita8c734070c67d84e10f617602467339f113521b4 (patch)
treec13e344a33e45959e98609aa682231e102bfbadd
parent82f79a7d368caad4068d97051ad8deddd05b4f7e (diff)
downloadfrost-a8c734070c67d84e10f617602467339f113521b4.tar.gz
frost-a8c734070c67d84e10f617602467339f113521b4.tar.bz2
frost-a8c734070c67d84e10f617602467339f113521b4.zip
Add custom gradle function and ignore some tests
-rw-r--r--app/build.gradle9
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt2
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/debugger/OfflineWebsiteTest.kt4
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt6
4 files changed, 16 insertions, 5 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 76e96599..562de936 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -259,6 +259,15 @@ dependencies {
}
+// Validates code and generates apk
+task createGithubReleaseApk(type: GradleBuild) {
+ tasks = ['spotlessCheck',
+ 'lintRelease',
+ 'testReleaseUnitTest',
+ 'connectedAndroidTest',
+ 'assembleRelease']
+}
+
def kotlinResolutions = ['kotlin-reflect',
'kotlin-stdlib',
'kotlin-stdlib-jdk7',
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt
index 4afd8e8a..9e92c939 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Images.kt
@@ -47,8 +47,6 @@ fun RequestAuth.getFullSizedImage(fbid: Long) = frostRequest(::getJsonUrl) {
get()
}
-val test: () -> InputStream? = { null }
-
/**
* Attempts to get the fbcdn url of the supplied image redirect url
*/
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/debugger/OfflineWebsiteTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/debugger/OfflineWebsiteTest.kt
index 07c92fbf..a2bafba9 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/debugger/OfflineWebsiteTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/debugger/OfflineWebsiteTest.kt
@@ -24,11 +24,12 @@ import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import okhttp3.mockwebserver.RecordedRequest
import org.junit.Assume.assumeTrue
-import org.junit.Test
import java.io.File
import java.util.zip.ZipFile
import kotlin.test.AfterTest
+import kotlin.test.Test
import kotlin.test.BeforeTest
+import kotlin.test.Ignore
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
@@ -78,6 +79,7 @@ class OfflineWebsiteTest {
)
}
+ @Ignore
@Test
fun fbOffline() {
// Not really a test. Skip in CI
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt
index 3a7abec4..ec765448 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/requests/FbRequestTest.kt
@@ -23,6 +23,7 @@ import com.pitchedapps.frost.internal.USER_ID
import com.pitchedapps.frost.internal.authDependent
import okhttp3.Call
import org.junit.BeforeClass
+import org.junit.Ignore
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
@@ -69,12 +70,13 @@ class FbRequestTest {
AUTH.markNotificationRead(notifId).call.assertNoError()
}
+ @Ignore("Broken as of 2019/01/03; however, this was never used in production to begin with")
@Test
fun fullSizeImage() {
- val fbid = 10155966932992838L // google's current cover photo
+ val fbid = 10150706277522838L // google's current cover photo
val url = AUTH.getFullSizedImage(fbid).invoke()
println(url)
- assertEquals(url?.startsWith("https://scontent"), true)
+ assertEquals(true, url?.startsWith("https://scontent"), "Bad start for url $url")
}
@Test