-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #713 from gdg-x/experiment/firebase-test-lab
Integrate firebase test lab
- Loading branch information
Showing
8 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# Use gcloud from Google to run Espresso tests on Firebase Test Lab | ||
|
||
SLUG="gdg-x/frisbee" | ||
BRANCH='develop'; | ||
|
||
if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then | ||
echo "Skipping tests on Firebase: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'." | ||
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then | ||
echo "Skipping tests on Firebase: was pull request." | ||
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then | ||
echo "Skipping tests on Firebase: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'." | ||
else | ||
echo "Starting tests on Firebase" | ||
|
||
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-138.0.0-linux-x86_64.tar.gz | ||
tar xf google-cloud-sdk-138.0.0-linux-x86_64.tar.gz | ||
echo "y" | ./google-cloud-sdk/bin/gcloud components update beta | ||
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file settings/firebase-test-lab.json >/dev/null | ||
./google-cloud-sdk/bin/gcloud beta test android run --async --type instrumentation --app ./app/build/outputs/apk/app-debug.apk --test ./app/build/outputs/apk/app-debug-androidTest.apk --device-ids Nexus5 --os-version-ids 22 --project api-project-429371117063 | ||
|
||
echo "Test APK upload to Firebase complete" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/src/androidTest/java/org/gdg/frisbee/android/FrisbeeTestRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.gdg.frisbee.android; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
import android.support.test.runner.AndroidJUnitRunner; | ||
|
||
import org.gdg.frisbee.android.app.TestApp; | ||
|
||
public class FrisbeeTestRunner extends AndroidJUnitRunner { | ||
|
||
@Override | ||
public Application newApplication(ClassLoader cl, String className, Context context) | ||
throws InstantiationException, IllegalAccessException, ClassNotFoundException { | ||
return super.newApplication(cl, TestApp.class.getName(), context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/src/androidTest/java/org/gdg/frisbee/android/app/TestApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.gdg.frisbee.android.app; | ||
|
||
|
||
import org.gdg.frisbee.android.utils.PrefUtils; | ||
|
||
public class TestApp extends App { | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
|
||
PrefUtils.setInitialSettings(this, false); | ||
PrefUtils.skipSeasonsGreetings(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters