Skip to content
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

Small updates #554

Merged
merged 3 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions firebase_apis/test_api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<groupId>com.google.apis</groupId>
<artifactId>google-api-services-testing</artifactId>
<version>v1-rev20190305-1.25.0-SNAPSHOT</version>
<name>Cloud Testing API v1-rev20190305-1.25.0-SNAPSHOT</name>
<version>v1-rev20190430-1.25.0-SNAPSHOT</version>
<name>Cloud Testing API v1-rev20190430-1.25.0-SNAPSHOT</name>
<packaging>jar</packaging>

<inceptionYear>2011</inceptionYear>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ public final class ApkManifest extends com.google.api.client.json.GenericJson {
@com.google.api.client.util.Key
private java.lang.String packageName;

/**
* Specifies the API Level on which the application is designed to run.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer targetSdkVersion;

/**
* User-readable name for the application.
* @return value or {@code null} for none
Expand Down Expand Up @@ -147,6 +154,23 @@ public ApkManifest setPackageName(java.lang.String packageName) {
return this;
}

/**
* Specifies the API Level on which the application is designed to run.
* @return value or {@code null} for none
*/
public java.lang.Integer getTargetSdkVersion() {
return targetSdkVersion;
}

/**
* Specifies the API Level on which the application is designed to run.
* @param targetSdkVersion targetSdkVersion or {@code null} for none
*/
public ApkManifest setTargetSdkVersion(java.lang.Integer targetSdkVersion) {
this.targetSdkVersion = targetSdkVersion;
return this;
}

@Override
public ApkManifest set(String fieldName, Object value) {
return (ApkManifest) super.set(fieldName, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ public final class TestSpecification extends com.google.api.client.json.GenericJ
@com.google.api.client.util.Key
private AndroidTestLoop androidTestLoop;

/**
* Enables automatic Google account login. If set, the service will automatically generate a
* Google test account and add it to the device, before executing the test. Note that test
* accounts might be reused. Many applications show their full set of functionalities when an
* account is present on the device. Logging into the device with these generated accounts allows
* testing more functionalities. Default is false.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean autoGoogleLogin;

/**
* Disables performance metrics recording; may reduce test latency.
* The value may be {@code null}.
Expand Down Expand Up @@ -155,31 +144,6 @@ public TestSpecification setAndroidTestLoop(AndroidTestLoop androidTestLoop) {
return this;
}

/**
* Enables automatic Google account login. If set, the service will automatically generate a
* Google test account and add it to the device, before executing the test. Note that test
* accounts might be reused. Many applications show their full set of functionalities when an
* account is present on the device. Logging into the device with these generated accounts allows
* testing more functionalities. Default is false.
* @return value or {@code null} for none
*/
public java.lang.Boolean getAutoGoogleLogin() {
return autoGoogleLogin;
}

/**
* Enables automatic Google account login. If set, the service will automatically generate a
* Google test account and add it to the device, before executing the test. Note that test
* accounts might be reused. Many applications show their full set of functionalities when an
* account is present on the device. Logging into the device with these generated accounts allows
* testing more functionalities. Default is false.
* @param autoGoogleLogin autoGoogleLogin or {@code null} for none
*/
public TestSpecification setAutoGoogleLogin(java.lang.Boolean autoGoogleLogin) {
this.autoGoogleLogin = autoGoogleLogin;
return this;
}

/**
* Disables performance metrics recording; may reduce test latency.
* @return value or {@code null} for none
Expand Down
4 changes: 2 additions & 2 deletions test_app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.20'
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.5.0-beta01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion test_runner/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-5.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions test_runner/src/main/kotlin/ftl/json/SavedMatrix.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ftl.gc.GcToolResults
import ftl.util.Billing
import ftl.util.MatrixState.FINISHED
import ftl.util.StepOutcome.failure
import ftl.util.StepOutcome.flaky
import ftl.util.StepOutcome.inconclusive
import ftl.util.StepOutcome.skipped
import ftl.util.StepOutcome.success
Expand Down Expand Up @@ -99,6 +100,9 @@ class SavedMatrix(matrix: TestMatrix) {

outcome = stepOutcome.summary

// Treat flaky outcome as a success
if (outcome == flaky) outcome = success

outcomeDetails = when (outcome) {
failure -> stepOutcome.failureDetail.keysToString()
success -> stepOutcome.successDetail.keysToString()
Expand Down
6 changes: 3 additions & 3 deletions test_runner/src/main/kotlin/ftl/run/AndroidTestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object AndroidTestRunner {
testShardChunks.forEach { testTargets ->
// specify dispatcher to avoid inheriting main runBlocking context that runs in the main thread
// https://kotlinlang.org/docs/reference/coroutines/coroutine-context-and-dispatchers.html
jobs += async(Dispatchers.Default) {
jobs += async(Dispatchers.IO) {
GcAndroidTestMatrix.build(
appApkGcsPath = apk.app ?: androidArgs.appApk,
testApkGcsPath = apk.test,
Expand Down Expand Up @@ -73,8 +73,8 @@ object AndroidTestRunner {
val result = mutableListOf<AppTestPair>()

appTestApks.forEach { apks ->
val appApkGcsPath = async(Dispatchers.Default) { GcStorage.upload(apks.app ?: args.appApk, gcsBucket, runGcsPath) }
val testApkGcsPath = async(Dispatchers.Default) { GcStorage.upload(apks.test, gcsBucket, runGcsPath) }
val appApkGcsPath = async(Dispatchers.IO) { GcStorage.upload(apks.app ?: args.appApk, gcsBucket, runGcsPath) }
val testApkGcsPath = async(Dispatchers.IO) { GcStorage.upload(apks.test, gcsBucket, runGcsPath) }

result.add(
AppTestPair(
Expand Down
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/run/IosTestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object IosTestRunner {
println(beforeRunMessage(iosArgs, iosArgs.testShardChunks))
repeat(runCount) {
iosArgs.testShardChunks.forEach { testTargets ->
jobs += async(Dispatchers.Default) {
jobs += async(Dispatchers.IO) {
GcIosTestMatrix.build(
iosDeviceList = iosDeviceList,
testZipGcsPath = xcTestGcsPath,
Expand Down
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/run/TestRunner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ object TestRunner {
// Only refresh unfinished
if (MatrixState.inProgress(matrix.value.state)) {
matrixCount += 1
jobs += async(Dispatchers.Default) { GcTestMatrix.refresh(matrix.key, args) }
jobs += async(Dispatchers.IO) { GcTestMatrix.refresh(matrix.key, args) }
}
}

Expand Down
3 changes: 2 additions & 1 deletion test_runner/src/main/kotlin/ftl/util/StepOutcome.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package ftl.util
// ToolResults API step outcome values
object StepOutcome {
// https://github.com/bootstraponline/gcloud_cli/blob/master/google-cloud-sdk/lib/googlecloudsdk/third_party/apis/toolresults_v1beta3.json#L755
const val success = "success"
const val failure = "failure"
const val flaky = "flaky"
const val inconclusive = "inconclusive"
const val skipped = "skipped"
const val success = "success"
const val unset = "unset"
}