Skip to content

Commit

Permalink
Added logging for happo tests (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeal committed Jul 26, 2018
1 parent 6f2645a commit 12de9c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -54,6 +54,6 @@ jobs:
script: ./gradlew :LottieSample:testReleaseUnitTest
- name: "Firebase Happo Tests"
script:
- ./gradlew :LottieSample:assembleAndroidTest
- ./gradlew :LottieSample:assembleDebug :LottieSample:assembleAndroidTest
- ./gcloud_run.sh
sudo: false
Expand Up @@ -100,6 +100,7 @@ public void run() {
}

private void runAnimation(final String name) {
Log.d(L.TAG, "Running name");
LottieComposition composition = LottieComposition.Factory.fromFileSync(context, name);
if (composition.getBounds().width() > 4 * Resources.getSystem().getDisplayMetrics().widthPixels ||
composition.getBounds().height() > 4 * Resources.getSystem().getDisplayMetrics().heightPixels) {
Expand Down Expand Up @@ -131,6 +132,7 @@ public void stopSnapshotting() {

private void decrementAndCompleteIfDone() {
remainingTasks--;
Log.d(L.TAG, "There are " + remainingTasks + " tasks left.");
Log.d("Happo", "There are " + remainingTasks + " remaining tasks.");
if (remainingTasks < 0) {
throw new IllegalStateException("Remaining tasks cannot be negative.");
Expand Down
6 changes: 4 additions & 2 deletions gcloud_run.sh
Expand Up @@ -12,10 +12,12 @@ if [ ! -f ${HOME}/google-cloud-sdk/install.sh ]; then
tar xzf gcloud.tar.gz -C ${HOME}
${HOME}/google-cloud-sdk/install.sh --quiet --usage-reporting false
fi
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
gcloud auth activate-service-account --key-file ${HOME}/.cache/gcloud-service-key.json
gcloud config set project lottie-snapshots

gcloud firebase test android run --no-auto-google-login --type instrumentation --device model=Nexus5X,version=26 --app LottieSample/build/outputs/apk/debug/LottieSample-debug.apk --test LottieSample/build/outputs/apk/androidTest/debug/LottieSample-debug-androidTest.apk
result=$?
./post_pr_comment.js
if [ "$result" -eq "0" ]; then
./post_pr_comment.js
fi
exit $result

0 comments on commit 12de9c5

Please sign in to comment.