-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Gradle plugin to add neededPermissions and deviceActions (#226)
* Update Gradle plugin to add neededPermissions and deviceActions; Upgrade plugin to 1.0.43;
- Loading branch information
1 parent
7b9ebdb
commit 4d2061a
Showing
15 changed files
with
993 additions
and
651 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
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
9 changes: 9 additions & 0 deletions
9
gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/AttachmentInfo.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,9 @@ | ||
package com.microsoft.hydralab.entity; | ||
|
||
public class AttachmentInfo { | ||
public String fileName; | ||
public String filePath; | ||
public String fileType; | ||
public String loadType; | ||
public String loadDir; | ||
} |
33 changes: 33 additions & 0 deletions
33
gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/BlobFileInfo.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,33 @@ | ||
package com.microsoft.hydralab.entity; | ||
|
||
import com.google.gson.JsonObject; | ||
import java.util.Date; | ||
|
||
public class BlobFileInfo { | ||
public String fileId; | ||
public String fileType; | ||
public String fileName; | ||
public String blobUrl; | ||
public String blobPath; | ||
public long fileLen; | ||
public String md5; | ||
public String loadDir; | ||
public String loadType; | ||
public JsonObject fileParser; | ||
public Date createTime; | ||
public Date updateTime; | ||
|
||
|
||
public interface fileType { | ||
String WINDOWS_APP = "WINAPP"; | ||
String COMMOM_FILE = "COMMON"; | ||
String AGENT_PACKAGE = "PACKAGE"; | ||
String APP_FILE = "APP"; | ||
String TEST_APP_FILE = "TEST_APP"; | ||
} | ||
|
||
public interface loadType { | ||
String CPOY = "COPY"; | ||
String UNZIP = "UNZIP"; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/DeviceTestResult.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,38 @@ | ||
package com.microsoft.hydralab.entity; | ||
|
||
import java.util.List; | ||
|
||
public class DeviceTestResult { | ||
public String id; | ||
public String deviceSerialNumber; | ||
public String deviceName; | ||
public String instrumentReportPath; | ||
public String controlLogPath; | ||
public String instrumentReportBlobUrl; | ||
public String testXmlReportBlobUrl; | ||
public String logcatBlobUrl; | ||
public String testGifBlobUrl; | ||
|
||
public List<BlobFileInfo> attachments; | ||
|
||
public String crashStackId; | ||
public String errorInProcess; | ||
|
||
public String crashStack; | ||
|
||
public int totalCount; | ||
public int failCount; | ||
public boolean success; | ||
public long testStartTimeMillis; | ||
public long testEndTimeMillis; | ||
|
||
@Override | ||
public String toString() { | ||
return "{" + | ||
"SN='" + deviceSerialNumber + '\'' + | ||
", totalCase:" + totalCount + | ||
", failCase:" + failCount + | ||
", success:" + success + | ||
'}'; | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/HydraLabAPIConfig.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,98 @@ | ||
package com.microsoft.hydralab.entity; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
// todo: split into APIConfig/deviceConfig/testConfig | ||
public class HydraLabAPIConfig { | ||
public String schema = "https"; | ||
public String host = ""; | ||
public String contextPath = ""; | ||
public String authToken = ""; | ||
public boolean onlyAuthPost = true; | ||
public String checkCenterVersionAPIPath = "/api/center/info"; | ||
public String checkCenterAliveAPIPath = "/api/center/isAlive"; | ||
public String getBlobSAS = "/api/package/getSAS"; | ||
public String uploadAPKAPIPath = "/api/package/add"; | ||
public String addAttachmentAPIPath = "/api/package/addAttachment"; | ||
public String generateAccessKeyAPIPath = "/api/deviceGroup/generate?deviceIdentifier=%s"; | ||
public String runTestAPIPath = "/api/test/task/run/"; | ||
public String testStatusAPIPath = "/api/test/task/"; | ||
public String cancelTestTaskAPIPath = "/api/test/task/cancel/%s?reason=%s"; | ||
public String testPortalTaskInfoPath = "/portal/index.html?redirectUrl=/info/task/"; | ||
public String testPortalTaskDeviceVideoPath = "/portal/index.html?redirectUrl=/info/videos/"; | ||
public String pkgName = ""; | ||
public String testPkgName = ""; | ||
public String groupTestType = "SINGLE"; | ||
public String pipelineLink = ""; | ||
public String frameworkType = "JUnit4"; | ||
public int maxStepCount = 100; | ||
public int deviceTestCount = -1; | ||
public boolean needUninstall = true; | ||
public boolean needClearData = true; | ||
public String teamName = ""; | ||
public String testRunnerName = "androidx.test.runner.AndroidJUnitRunner"; | ||
public String testScope = ""; | ||
public List<String> neededPermissions = new ArrayList<>(); | ||
public String deviceActionsStr = ""; | ||
|
||
public String getBlobSASUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, getBlobSAS); | ||
} | ||
|
||
public String checkCenterAliveUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, checkCenterAliveAPIPath); | ||
} | ||
|
||
public String getUploadUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, uploadAPKAPIPath); | ||
} | ||
|
||
public String getAddAttachmentUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, addAttachmentAPIPath); | ||
} | ||
|
||
public String getGenerateAccessKeyUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, generateAccessKeyAPIPath); | ||
} | ||
|
||
public String getRunTestUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, runTestAPIPath); | ||
} | ||
|
||
public String getTestStatusUrl(String testTaskId) { | ||
return String.format(Locale.US, "%s://%s%s%s%s", schema, host, contextPath, testStatusAPIPath, testTaskId); | ||
} | ||
|
||
public String getCancelTestTaskUrl() { | ||
return String.format(Locale.US, "%s://%s%s%s", schema, host, contextPath, cancelTestTaskAPIPath); | ||
} | ||
|
||
public String getTestReportUrl(String testTaskId) { | ||
return String.format(Locale.US, "%s://%s%s%s%s", schema, host, contextPath, testPortalTaskInfoPath, testTaskId); | ||
} | ||
|
||
public String getDeviceTestVideoUrl(String id) { | ||
return String.format(Locale.US, "%s://%s%s%s%s", schema, host, contextPath, testPortalTaskDeviceVideoPath, id); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "HydraLabAPIConfig:\n" + | ||
"pkgName=" + pkgName + ",\n" + | ||
"testPkgName=" + testPkgName + ",\n" + | ||
"groupTestType=" + groupTestType + ",\n" + | ||
"pipelineLink=" + pipelineLink + ",\n" + | ||
"frameworkType=" + frameworkType + ",\n" + | ||
"maxStepCount=" + maxStepCount + ",\n" + | ||
"deviceTestCount=" + deviceTestCount + ",\n" + | ||
"needUninstall=" + needUninstall + ",\n" + | ||
"needClearData=" + needClearData + ",\n" + | ||
"teamName=" + teamName + ",\n" + | ||
"testRunnerName=" + testRunnerName + ",\n" + | ||
"testScope=" + testScope + ",\n" + | ||
"neededPermissions=" + (neededPermissions != null ? neededPermissions.toString() : "") + ",\n" + | ||
"deviceActionsStr=" + deviceActionsStr; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
gradle_plugin/src/main/groovy/com/microsoft/hydralab/entity/TestTask.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,39 @@ | ||
package com.microsoft.hydralab.entity; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
public class TestTask { | ||
public String id; | ||
public List<DeviceTestResult> deviceTestResults; | ||
public int testDevicesCount; | ||
public Date startDate; | ||
public Date endDate; | ||
public int totalTestCount; | ||
public int totalFailCount; | ||
public String testSuite; | ||
public String reportImagePath; | ||
public String status; | ||
public String testErrorMsg; | ||
public String message; | ||
public int retryTime; | ||
|
||
@Override | ||
public String toString() { | ||
return "TestTask{" + | ||
"id='" + id + '\'' + | ||
", testDevicesCount=" + testDevicesCount + | ||
", startDate=" + startDate + | ||
", totalTestCount=" + totalTestCount + | ||
", status='" + status + '\'' + | ||
'}'; | ||
} | ||
|
||
public interface TestStatus { | ||
String RUNNING = "running"; | ||
String FINISHED = "finished"; | ||
String CANCELED = "canceled"; | ||
String EXCEPTION = "error"; | ||
String WAITING = "waiting"; | ||
} | ||
} |
Oops, something went wrong.