From 03dab29e3a4c763fcd4dc494c09da3a8ab294760 Mon Sep 17 00:00:00 2001 From: Eric Gribkoff Date: Tue, 28 Aug 2018 14:56:06 -0700 Subject: [PATCH] buildscripts: run Android interop tests on Firebase (#4314) --- .../InteropInstrumentationTest.java | 2 +- buildscripts/kokoro/android-interop.cfg | 5 +++ buildscripts/kokoro/android-interop.sh | 41 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 buildscripts/kokoro/android-interop.cfg create mode 100755 buildscripts/kokoro/android-interop.sh diff --git a/android-interop-testing/app/src/androidTest/java/io/grpc/android/integrationtest/InteropInstrumentationTest.java b/android-interop-testing/app/src/androidTest/java/io/grpc/android/integrationtest/InteropInstrumentationTest.java index 28a637c5b4..3fe6379ff6 100644 --- a/android-interop-testing/app/src/androidTest/java/io/grpc/android/integrationtest/InteropInstrumentationTest.java +++ b/android-interop-testing/app/src/androidTest/java/io/grpc/android/integrationtest/InteropInstrumentationTest.java @@ -38,7 +38,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class InteropInstrumentationTest { - private static final int TIMEOUT_SECONDS = 10; + private static final int TIMEOUT_SECONDS = 60; private static final String LOG_TAG = "GrpcInteropInstrumentationTest"; private String host; diff --git a/buildscripts/kokoro/android-interop.cfg b/buildscripts/kokoro/android-interop.cfg new file mode 100644 index 0000000000..e399207261 --- /dev/null +++ b/buildscripts/kokoro/android-interop.cfg @@ -0,0 +1,5 @@ +# Config file for internal CI + +# Location of the continuous shell script in repository. +build_file: "grpc-java/buildscripts/kokoro/android-interop.sh" +timeout_mins: 45 diff --git a/buildscripts/kokoro/android-interop.sh b/buildscripts/kokoro/android-interop.sh new file mode 100755 index 0000000000..a1439266d1 --- /dev/null +++ b/buildscripts/kokoro/android-interop.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -exu -o pipefail +if [[ -f /VERSION ]]; then + cat /VERSION +fi + +# Install gRPC and codegen for the Android interop app +# (a composite gradle build can't find protoc-gen-grpc-java) + +cd github/grpc-java + +export GRADLE_OPTS=-Xmx512m +export LDFLAGS=-L/tmp/protobuf/lib +export CXXFLAGS=-I/tmp/protobuf/include +export LD_LIBRARY_PATH=/tmp/protobuf/lib +export OS_NAME=$(uname) + +# Proto deps +buildscripts/make_dependencies.sh + +./gradlew install + + +# Build and run interop instrumentation tests on Firebase Test Lab +cd android-interop-testing +../gradlew assembleDebug +../gradlew assembleDebugAndroidTest +gcloud firebase test android run \ + --type instrumentation \ + --app app/build/outputs/apk/debug/app-debug.apk \ + --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \ + --environment-variables \ + server_host=grpc-test.sandbox.googleapis.com,server_port=443,test_case=all \ + --device model=Nexus6P,version=27,locale=en,orientation=portrait \ + --device model=Nexus6P,version=26,locale=en,orientation=portrait \ + --device model=Nexus6P,version=25,locale=en,orientation=portrait \ + --device model=Nexus6P,version=24,locale=en,orientation=portrait \ + --device model=Nexus6P,version=23,locale=en,orientation=portrait \ + --device model=Nexus6,version=22,locale=en,orientation=portrait \ + --device model=Nexus6,version=21,locale=en,orientation=portrait