Skip to content

Commit

Permalink
Add ability to disable google login. (#146)
Browse files Browse the repository at this point in the history
There are some issues with firebase test lab caused by play service and
auto-google-login. This adds a flag `disable-google-login` to
config.properties which allows you to disable auto google login.

When the flag is set, `--no-auto-google-login` is added to the command
line arguments to gcloud.
  • Loading branch information
runningcode authored and bootstraponline committed Mar 22, 2018
1 parent 35c480b commit 6e81599
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ private void setProperty(String property, String value) throws IllegalArgumentEx
configurator.setGenerateSplitVideo(Boolean.parseBoolean(value));
break;

case "disable-google-login":
configurator.setDisableAutoGoogleLogin(Boolean.parseBoolean(value));
break;

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Configurator {
private boolean fetchXMLFiles = true;
private boolean debug = false;
private boolean fetchBucket = false;
private boolean disableAutoGoogleLogin = false;
private int numShards = -1;
private int shardIndex = -1;
private int shardTimeout = 5;
Expand Down Expand Up @@ -192,6 +193,14 @@ public void setUseGCloudBeta(boolean useGCloudBeta) {
this.useGCloudBeta = useGCloudBeta;
}

public boolean disableAutoGoogleLogin() {
return disableAutoGoogleLogin;
}

public void setDisableAutoGoogleLogin(boolean disableAutoGoogleLogin) {
this.disableAutoGoogleLogin = disableAutoGoogleLogin;
}

private void setupDevices() {
devices = new ArrayList<>();
for (String locale : locales) {
Expand Down
8 changes: 8 additions & 0 deletions Flank/src/main/java/com/walmart/otto/tools/GcloudTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void runGcloud(String testCase, String bucket, int shardIndex)
"--type",
"instrumentation",
orchestratorFlag(),
autoGoogleLoginFlag(),
"--app",
bucket + getSimpleName(getAppAPK()),
"--test",
Expand Down Expand Up @@ -80,6 +81,13 @@ private String orchestratorFlag() {
return "--no-use-orchestrator";
}

private String autoGoogleLoginFlag() {
if (getConfigurator().disableAutoGoogleLogin()) {
return "--no-auto-google-login";
}
return "";
}

private String betaConfiguration() {
if (getConfigurator().isUseGCloudBeta()) {
return "beta";
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ gcloud-path: The path to the glcoud binary
gsutil-path: The path to the gsutil binary
gcloud-bucket: The Google Cloud Storage bucket to use. If not specified Flank will create one.
use-gcloud-beta: If gcloud beta should be used
disable-google-login: If the argument `--no-auto-google-login` should be passed to the gcloud command line.
aggregate-reports.enabled: Enable the experimental test aggregation feature. Requires fetch-bucket to be enabled. Disabled by default.
aggregate-reports.xml: Generates and pushes to Google Cloud Storage an aggregated XML report
Expand Down

0 comments on commit 6e81599

Please sign in to comment.