8000 Run UI tests on Firebase Test Lab by jraska · Pull Request #233 · jraska/github-client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Run UI tests on Firebase Test Lab #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 69 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
24362c2
Setup GCloud SDK
jraska May 9, 2020
0a6fedb
Setup GCloud SDK 2
jraska May 9, 2020
d2357e7
Setup GCloud SDK 3
jraska May 9, 2020
d2c95c8
Check GCloud config
jraska May 9, 2020
ba634cc
Setup GCloud on ~gcloud/google-cloud-sdk/bin/gcloud
jraska May 9, 2020
aff562e
Run Firebase test lab as part of check
jraska May 9, 2020
a5ffc8d
Setup proper names
jraska May 9, 2020
9b48229
Make dir for gcloud
jraska May 9, 2020
00035ee
See the stacktrace fo gcloud
jraska May 9, 2020
5de107e
Trying to add gcloud to path
jraska May 9, 2020
c6983e6
Update Kotlin and AGP
jraska May 9, 2020
957e967
Adding Gradle options to fix kotlin breaking
jraska May 9, 2020
0a62577
Run only tests and instrumented tests on CI
jraska May 9, 2020
25ee6b1
Try Gradle ops to make the hell thing pass
jraska May 9, 2020 8000
fdbce05
limit gradle memory
jraska May 9, 2020
3b82973
Run only instrumented tests
jraska May 9, 2020
0a58059
Run only instrumented tests
jraska May 9, 2020
3ba56e9
Different resource
jraska May 9, 2020
1d04219
Remove arguments
jraska May 9, 2020
4be358c
Fix destination dir for app file
jraska May 9, 2020
c18ea8a
Add back options to Gradel Daemon
jraska May 9, 2020
49892b8
Add back options to Gradel Daemon
jraska May 9, 2020
bc2d4e0
Other options wth Gradle stuff
jraska May 9, 2020
03237cd
Fix stacktrace param
jraska May 9, 2020
efe5bf1
Try with check again
jraska May 9, 2020
1c27b68
Try with check again
jraska May 9, 2020
ecdd89f
No Daemon
jraska May 9, 2020
ab5e480
Try check again
jraska May 9, 2020
1474c68
Try check again
jraska May 9, 2020
2278277
Another attempt
jraska May 9, 2020
2afdb66
Another attempt
jraska May 9, 2020
e6a51fc
Run Gcloud after all the things
jraska May 9, 2020
99e8144
Try with daemon
jraska May 9, 2020
2b196d4
Try completely without firebase test lab
jraska May 9, 2020
0259efc
Try to add empty kts
jraska May 9, 2020
749c97d
Make it a groovy file instead of Kotlin
jraska May 9, 2020
59f7c17
Hook Firebase test lab there
jraska May 9, 2020
38ad6d9
Adding gcloud to path and writign file properly
jraska May 9, 2020
29c6419
Do not add stuff to path
jraska May 9, 2020
6c04f2a
Remove Firebase test lab task
jraska May 9, 2020
93f0b43
Add gcloud to path
jraska May 9, 2020
19bcdf2
RUn instrumented tests properly
jraska May 9, 2020
a5a4b61
Try withuot daemon
jraska May 9, 2020
cea9c88
Run test as separate command
jraska May 9, 2020
d8c460d
Now with daemon
jraska May 9, 2020
76b4915
Finally without Daemon
jraska May 9, 2020
ba31f09
Try on real Pixel 4
jraska May 9, 2020
8c52736
Update Readme
jraska May 9, 2020
66a7e46
Set the environment variable later
jraska May 9, 2020
daa5b8b
Try without cache
jraska May 9, 2020
4d2d1ee
Annd with cache again
jraska May 9, 2020
a4fa608
Setup all the things at the same time
jraska May 9, 2020
f1eb02c
Remove empty lines just to start once more
jraska May 9, 2020
148e590
This wasn't here - removing
jraska May 9, 2020
def539c
Increase JVM size for gradle
jraska May 9, 2020
e7f423a
Try different JVM memory value
jraska May 10, 2020
0480798
RUn Kotlin in process
jraska May 10, 2020 8000
b61b77e
Try 3.5GB memory
jraska May 10, 2020
03d55f6
Tryiing smaller MaxPermSize
jraska May 10, 2020
8bde79b
Withotu in process compilation
jraska May 10, 2020
08d96d9
Less memory for Gradle
jraska May 10, 2020
766e250
Disable lint tasks
jraska May 10, 2020
1d8c31d
Put back original MaxPermSize
jraska May 10, 2020
74bf283
No parallel
jraska May 10, 2020
aae453c
Try with daemon one more time
jraska May 10, 2020
e803793
Now disable lint
jraska May 10, 2020
7a901ed
No Daemon finally
jraska May 10, 2020
d113f35
One build to verify stuff
jraska May 10, 2020
71d960c
Update Gradle
jraska May 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ jobs:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "core-android/build.gradle" }}
- run:
name: Get Dependencies
command: ./gradlew androidDependencies
command: ./gradlew androidDependencies --no-daemon
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "core-android/build.gradle" }}
- run:
name: Run Tests
command: ./gradlew check
command: ./gradlew check --stacktrace --no-parallel --no-daemon
- run:
name: Run Tests Firebase
command: mkdir ~/gcloud
&& curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-291.0.0-linux-x86_64.tar.gz | tar xz -C ~/gcloud
&& echo "export PATH=~/gcloud/google-cloud-sdk/bin:$PATH" >> $BASH_ENV
&& ./gradlew runInstrumentedTestsOnFirebase --stacktrace --no-daemon
- store_artifacts:
path: app/build/reports
destination: app/reports
Expand All @@ -34,11 +40,12 @@ jobs:
destination: feature/push/reports
- store_test_results:
path: app/build/test-results
- store_test_results:
path: core-android/build/test-results
- store_test_results:
path: core/build/test-results
- store_test_results:
path: feature/users/build/test-results
- store_test_results:
path: feature/push/build/test-results


5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ Experimental architecture app with example usage intended to be a showcase, test
- `Navigator` pattern to be able to easily navigate without `Context`
- `TopActivityProvider` to avoid having `Context` dependencie everywhere and to be able to have cleaner pure Kotlin interfaces
- Uses [LiveData-Testing](https://github.com/jraska/livedata-testing) to test ViewModel. [Article](https://android.jlelse.eu/effective-livedata-and-viewmodel-testing-17f25069fcd4)
- Module Graph generation into Graphviz is implemented together with highlighting longest path in the graph. See [PR #205](https://github.com/jraska/github-client/pull/205}
- Module Graph measurement is used to assert height of dependency graph. See `/buildSrc` and [PR #205](https://github.com/jraska/github-client/pull/204).
Adding features by decoration to all screens implemented. See [PR #189](https://github.com/jraska/github-client/pull/189)
- Example usage of [module graph assertion](https://proandroiddev.com/module-rules-protect-your-build-time-and-architecture-d1194c7cc6bc) - see [here](https://github.com/jraska/github-client/blob/be3b06558118721968547de9237e9b48d1a8833d/app/build.gradle#L141).
- Tests are run on Firebase Test Lab. [See PR](https://github.com/jraska/github-client/pull/233)
8000
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ moduleGraphAssert {
}

apply plugin: 'com.google.gms.google-services'

apply from: 'firebase-test-lab.gradle'
repositories {
mavenCentral()
}
42 changes: 42 additions & 0 deletions app/firebase-test-lab.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
project.afterEvaluate {
def setupGCloudProject = tasks.register("setupGCloudProject", Exec.class) {
commandLine = "gcloud config set project github-client-25b47".split(' ')
dependsOn(project.tasks.named("assembleDebugAndroidTest"))
}

def setupGCloudAccount = tasks.register("setupGCloudAccount", Exec.class) {
def credentialsPath = createCredentialsFile()
commandLine = "gcloud auth activate-service-account --key-file $credentialsPath".split(' ')

dependsOn(setupGCloudProject)
}

tasks.register("runInstrumentedTestsOnFirebase", Exec.class) {
def appApk = "${project.buildDir}/outputs/apk/debug/app-debug.apk"
def testApk = "${project.buildDir}/outputs/apk/androidTest/debug/app-debug-androidTest.apk"
def device = "model=flame,version=29,locale=en,orientation=portrait"

commandLine =
("gcloud " +
"firebase test android run " +
"--app $appApk " +
"--test $testApk " +
"--device $device " +
"--no-performance-metrics")
.split(' ')

dependsOn(project.tasks.named("assembleDebugAndroidTest"))
dependsOn(project.tasks.named("assembleDebug"))
dependsOn(setupGCloudAccount)
}
}

String createCredentialsFile() {
def credentialsPath = "$projectDir/credentials.json"
def credentials = System.getenv("GCLOUD_CREDENTIALS")
if (credentials != null) {
new File(credentialsPath).write(credentials)
}
return credentialsPath
}

10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-plugins:2.0.0'
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.fabric.tools:gradle:1.31.2'
}
Expand Down Expand Up @@ -41,3 +41,11 @@ subprojects {
}
}
}

subprojects {
tasks.configureEach {
if (name.startsWith("lint")) {
enabled = false
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# suppress inspection "UnusedProperty" for whole file
# Default value: -Xmx1024m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx2560m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.daemon=true
android.useAndroidX=true
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
0