Skip to content

Commit

Permalink
Merge pull request #83 from ZhouYixun/beta2
Browse files Browse the repository at this point in the history
save_beta3_1
  • Loading branch information
ZhouYixun authored Nov 30, 2021
2 parents 9139a95 + 43e6929 commit 2529e41
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 29 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
ports:
- "8094:8094"
sonic-server-controller:
image: "zhouyixun/sonic-server-controller:v1.2.0-beta2"
image: "zhouyixun/sonic-server-controller:v1.2.0-beta3"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand Down
19 changes: 19 additions & 0 deletions sonic-server-bus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,23 @@
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- &lt;!&ndash; 只作为公共依赖,不需要打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.spotify</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipDocker>true</skipDocker>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>
2 changes: 1 addition & 1 deletion sonic-server-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>sonic-server-controller</artifactId>
<version>v1.2.0-beta2</version>
<version>v1.2.0-beta3</version>
<packaging>jar</packaging>

<!-- 依赖列表 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public RespModel runSuite(int suiteId, String strike) {
}
int deviceIndex = 0;
if (testSuites.getCover() == CoverType.CASE) {
List<JSONObject> suiteDetail = new ArrayList<>();
Set<Integer> agentIds = new HashSet<>();
for (TestCases testCases : testSuites.getTestCases()) {
JSONObject suite = new JSONObject();
List<JSONObject> steps = new ArrayList<>();
Expand All @@ -106,7 +108,7 @@ public RespModel runSuite(int suiteId, String strike) {
suite.put("steps", steps);
suite.put("cid", testCases.getId());
Devices devices = devicesList.get(deviceIndex);
suite.put("device", devices);
suite.put("device", Arrays.asList(devices));
if (deviceIndex == devicesList.size() - 1) {
deviceIndex = 0;
} else {
Expand All @@ -124,15 +126,23 @@ public RespModel runSuite(int suiteId, String strike) {
}
suite.put("gp", gp);
suite.put("rid", results.getId());
suite.put("wait", 0);
suite.put("id", devices.getAgentId());
RespModel testDataResp = transportFeignClient.sendTestData(suite);
if (testDataResp.getCode() != 2000) {
resultsService.subResultCount(results.getId());
}
agentIds.add(devices.getAgentId());
suiteDetail.add(suite);
}
JSONObject result = new JSONObject();
result.put("cases", suiteDetail);
for (Integer id : agentIds) {
result.put("id", id);
transportFeignClient.sendTestData(result);
}
// RespModel testDataResp = transportFeignClient.sendTestData(suite);
// if (testDataResp.getCode() != 2000) {
// resultsService.subResultCount(results.getId());
// }
}
if (testSuites.getCover() == CoverType.DEVICE) {
List<JSONObject> suiteDetail = new ArrayList<>();
Set<Integer> agentIds = new HashSet<>();
for (TestCases testCases : testSuites.getTestCases()) {
JSONObject suite = new JSONObject();
List<JSONObject> steps = new ArrayList<>();
Expand All @@ -141,28 +151,30 @@ public RespModel runSuite(int suiteId, String strike) {
steps.add(getStep(s));
}
for (Devices devices : devicesList) {
suite.put("steps", steps);
suite.put("cid", testCases.getId());
suite.put("device", devices);
//如果该字段的多参数数组还有,放入对象。否则去掉字段
for (String k : valueMap.keySet()) {
if (valueMap.get(k).size() > 0) {
String v = valueMap.get(k).get(0);
gp.put(k, v);
valueMap.get(k).remove(0);
} else {
valueMap.remove(k);
}
}
suite.put("gp", gp);
suite.put("rid", results.getId());
suite.put("wait", 0);
suite.put("id", devices.getAgentId());
RespModel testDataResp = transportFeignClient.sendTestData(suite);
if (testDataResp.getCode() != 2000) {
resultsService.subResultCount(results.getId());
agentIds.add(devices.getAgentId());
}
suite.put("steps", steps);
suite.put("cid", testCases.getId());
suite.put("device", devicesList);
//如果该字段的多参数数组还有,放入对象。否则去掉字段
for (String k : valueMap.keySet()) {
if (valueMap.get(k).size() > 0) {
String v = valueMap.get(k).get(0);
gp.put(k, v);
valueMap.get(k).remove(0);
} else {
valueMap.remove(k);
}
}
suite.put("gp", gp);
suite.put("rid", results.getId());
suiteDetail.add(suite);
}
JSONObject result = new JSONObject();
result.put("cases", suiteDetail);
for (Integer id : agentIds) {
result.put("id", id);
transportFeignClient.sendTestData(result);
}
}
return new RespModel(RespEnum.HANDLE_OK);
Expand Down
20 changes: 20 additions & 0 deletions sonic-server-eureka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,24 @@
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- &lt;!&ndash; 只作为公共依赖,不需要打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.spotify</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipDocker>true</skipDocker>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>
19 changes: 19 additions & 0 deletions sonic-server-folder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,23 @@
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- &lt;!&ndash; 只作为公共依赖,不需要打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.spotify</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipDocker>true</skipDocker>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>
20 changes: 20 additions & 0 deletions sonic-server-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,24 @@
</exclusions>
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- &lt;!&ndash; 只作为公共依赖,不需要打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.spotify</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipDocker>true</skipDocker>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>
20 changes: 20 additions & 0 deletions sonic-server-task/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,24 @@
</exclusions>
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- &lt;!&ndash; 只作为公共依赖,不需要打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.spotify</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipDocker>true</skipDocker>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>
20 changes: 20 additions & 0 deletions sonic-server-transport/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,24 @@
</exclusions>
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- &lt;!&ndash; 只作为公共依赖,不需要打包 &ndash;&gt;-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>com.spotify</groupId>-->
<!-- <artifactId>docker-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <skipDocker>true</skipDocker>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
</project>

0 comments on commit 2529e41

Please sign in to comment.