Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add flags to disable video recording and performance metrics #149

Merged
merged 4 commits into from
Mar 23, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ private void setProperty(String property, String value) throws IllegalArgumentEx
configurator.setDisableAutoGoogleLogin(Boolean.parseBoolean(value));
break;

case "record-video":
configurator.setRecordVideo(Boolean.parseBoolean(value));
break;

case "record-performance-metrics":
configurator.setRecordPerformanceMetrics(Boolean.parseBoolean(value));
break;

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;

public class Configurator {

private List<String> deviceIds = new ArrayList<>(Collections.singletonList("Nexus6P"));
private List<String> locales = new ArrayList<>(Collections.singletonList("en"));
private List<String> orientations = new ArrayList<>(Collections.singletonList("portrait"));
Expand All @@ -25,6 +26,8 @@ public class Configurator {
private boolean debug = false;
private boolean fetchBucket = false;
private boolean disableAutoGoogleLogin = false;
private boolean recordVideo = true;
private boolean recordPerformanceMetrics = true;
private int numShards = -1;
private int shardIndex = -1;
private int shardTimeout = 5;
Expand Down Expand Up @@ -201,6 +204,22 @@ public void setDisableAutoGoogleLogin(boolean disableAutoGoogleLogin) {
this.disableAutoGoogleLogin = disableAutoGoogleLogin;
}

public boolean recordVideo() {
return recordVideo;
}

public void setRecordVideo(boolean recordVideo) {
this.recordVideo = recordVideo;
}

public boolean recordPerformanceMetrics() {
return recordPerformanceMetrics;
}

public void setRecordPerformanceMetrics(boolean recordPerformanceMetrics) {
this.recordPerformanceMetrics = recordPerformanceMetrics;
}

private void setupDevices() {
devices = new ArrayList<>();
for (String locale : locales) {
Expand Down
17 changes: 17 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 @@ -14,6 +14,7 @@
import java.util.stream.Collectors;

public class GcloudTool extends Tool {

private boolean printTests = true;
private boolean testFailed = false;
private int latestExecutionTime;
Expand All @@ -37,6 +38,8 @@ public void runGcloud(String testCase, String bucket, int shardIndex)
"instrumentation",
orchestratorFlag(),
autoGoogleLoginFlag(),
recordVideoFlag(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

performanceMetricsFlag() isn't used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️ Will fix.

performanceMetricsFlag(),
"--app",
bucket + getSimpleName(getAppAPK()),
"--test",
Expand Down Expand Up @@ -88,6 +91,20 @@ private String autoGoogleLoginFlag() {
return "";
}

private String recordVideoFlag() {
if (!getConfigurator().recordVideo()) {
return "--no-record-video";
}
return "";
}

private String performanceMetricsFlag() {
if (!getConfigurator().recordPerformanceMetrics()) {
return "--no-performance-metrics";
}
return "";
}

private String betaConfiguration() {
if (getConfigurator().isUseGCloudBeta()) {
return "beta";
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ 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.
record-video: If the video of the instrumentation test should be recorded. True by default.
record-performance-metrics: If the performance metrics should be recorded. True by default.

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
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Release notes for flank

- [Add IntelliJ Idea Code Formatting settings for Java Flank - **sridoodla**](https://github.com/TestArmada/flank/pull/147)
- [Add ability to disable google login - **runningcode**](https://github.com/TestArmada/flank/pull/146)
- [Add the ability to disable video recording and performance metrics - **sridoodla**](https://github.com/TestArmada/flank/pull/149)