Skip to content

Commit

Permalink
Merge pull request #129 from SonicCloudOrg/v1.3.1-beta
Browse files Browse the repository at this point in the history
V1.3.1 beta
  • Loading branch information
ZhouYixun authored Feb 11, 2022
2 parents 5df4c47 + 3482ffd commit a4ab8d6
Show file tree
Hide file tree
Showing 18 changed files with 199 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/badge/release-v1.2.0-orange">
<img src="https://img.shields.io/github/v/release/SonicCloudOrg/sonic-server?include_prereleases">
</a>
<a href="#">
<img src="https://img.shields.io/github/commit-activity/m/SonicCloudOrg/sonic-agent">
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<p align="center">
<a href="#">
<img src="https://img.shields.io/badge/release-v1.2.0-orange">
<img src="https://img.shields.io/github/v/release/SonicCloudOrg/sonic-server?include_prereleases">
</a>
<a href="#">
<img src="https://img.shields.io/github/commit-activity/m/SonicCloudOrg/sonic-agent">
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-server-eureka:
image: "sonicorg/sonic-server-eureka:v1.3.0-release"
image: "sonicorg/sonic-server-eureka:v1.3.1-beta"
hostname: sonic-server-eureka
environment:
- EUREKA_HOST=sonic-server-eureka
Expand All @@ -12,7 +12,7 @@ services:
ports:
- "9090:9090"
sonic-server-bus:
image: "sonicorg/sonic-server-bus:v1.3.0-release"
image: "sonicorg/sonic-server-bus:v1.3.1-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand All @@ -24,7 +24,7 @@ services:
depends_on:
- sonic-server-eureka
sonic-server-gateway:
image: "sonicorg/sonic-server-gateway:v1.3.0-release"
image: "sonicorg/sonic-server-gateway:v1.3.1-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand All @@ -38,7 +38,7 @@ services:
ports:
- "8094:8094"
sonic-server-controller:
image: "sonicorg/sonic-server-controller:v1.3.0-release"
image: "sonicorg/sonic-server-controller:v1.3.1-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand All @@ -51,7 +51,7 @@ services:
- sonic-server-eureka
- sonic-server-gateway
sonic-server-folder:
image: "sonicorg/sonic-server-folder:v1.3.0-release"
image: "sonicorg/sonic-server-folder:v1.3.1-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand All @@ -68,7 +68,7 @@ services:
- sonic-server-eureka
- sonic-server-gateway
sonic-server-task:
image: "sonicorg/sonic-server-task:v1.3.0-release"
image: "sonicorg/sonic-server-task:v1.3.1-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand All @@ -81,7 +81,7 @@ services:
- sonic-server-eureka
- sonic-server-gateway
sonic-server-transport:
image: "sonicorg/sonic-server-transport:v1.3.0-release"
image: "sonicorg/sonic-server-transport:v1.3.1-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</goals>
<configuration>
<pushImage>true</pushImage>
<imageName>sonicorg/${project.artifactId}:${project.version}</imageName>
<imageName>sonicorg/${project.artifactId}:v${project.version}</imageName>
<baseImage>adoptopenjdk/openjdk15:alpine AS builder</baseImage>
<runs>
<run>ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</run>
Expand Down
2 changes: 1 addition & 1 deletion sonic-server-bus/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-bus</artifactId>
<version>v1.3.0-release</version>
<version>1.3.1-beta</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
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.3.0-release</version>
<version>1.3.1-beta</version>
<packaging>jar</packaging>

<!-- 依赖列表 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void delete(int id) throws SonicException {
versionsService.deleteByProjectId(id);
baseMapper.deleteById(id);
} catch (Exception e) {
e.printStackTrace();
throw new SonicException("删除出错!请联系管理员!");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;

import java.util.*;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -134,9 +135,14 @@ public PublicStepsDTO findById(int id) {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteByProjectId(int projectId) {
PublicSteps publicSteps = lambdaQuery().eq(PublicSteps::getProjectId, projectId).one();
publicStepsStepsMapper.delete(new LambdaQueryWrapper<PublicStepsSteps>()
.eq(PublicStepsSteps::getPublicStepsId, publicSteps.getId()));
return delete(publicSteps.getId());
List<PublicSteps> publicSteps = lambdaQuery().eq(PublicSteps::getProjectId, projectId).list();
for (PublicSteps publicStep : publicSteps) {
if (!ObjectUtils.isEmpty(publicSteps)) {
publicStepsStepsMapper.delete(new LambdaQueryWrapper<PublicStepsSteps>()
.eq(PublicStepsSteps::getPublicStepsId, publicStep.getId()));
delete(publicStep.getId());
}
}
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ public JSONObject findSteps(int id) {

@Override
public List<TestCases> findByIdIn(List<Integer> ids) {
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}
return listByIds(ids);
}

Expand Down Expand Up @@ -160,7 +163,7 @@ private JSONObject getStep(StepsDTO steps) {

@Override
public boolean deleteByProjectId(int projectId) {
return baseMapper.delete(new LambdaQueryWrapper<>()) > 0;
return baseMapper.delete(new LambdaQueryWrapper<TestCases>().eq(TestCases::getProjectId, projectId)) > 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public RespModel<String> runSuite(int suiteId, String strike) {
}

List<Devices> devicesList = BeanTool.transformFromInBatch(testSuitesDTO.getDevices(), Devices.class);
for (int i = devicesList.size() - 1; i >= 0; i--) {
if (devicesList.get(i).getStatus().equals(DeviceStatus.OFFLINE) || devicesList.get(i).getStatus().equals(DeviceStatus.DISCONNECTED)) {
devicesList.remove(devicesList.get(i));
}
}
if (devicesList.size() == 0) {
return new RespModel<>(3003, "所选设备暂无可用!");
}
Expand Down Expand Up @@ -89,7 +94,7 @@ public RespModel<String> runSuite(int suiteId, String strike) {
JSONObject gp = new JSONObject();
for (GlobalParams g : globalParamsList) {
if (g.getParamsValue().contains("|")) {
List<String> shuffle = Arrays.asList(g.getParamsValue().split("\\|"));
List<String> shuffle = new ArrayList<>(Arrays.asList(g.getParamsValue().split("\\|")));
Collections.shuffle(shuffle);
valueMap.put(g.getParamsKey(), shuffle);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</foreach>
</if>
<if test="params.agentId != null and params.agentId.size() > 0">
and d.agentId in
and d.agent_id in
<foreach collection="params.agentId" item="agentId" open="(" close=")" separator=",">
#{agentId}
</foreach>
Expand Down
Loading

0 comments on commit a4ab8d6

Please sign in to comment.