Skip to content

Commit

Permalink
Fix (#258)
Browse files Browse the repository at this point in the history
* fix endTime

* feat: rerun pt2
  • Loading branch information
wildeslam authored Aug 30, 2023
1 parent 1ba152a commit 9edce8b
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion arex-web-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.arextest</groupId>
<artifactId>arex-web</artifactId>
<version>0.4.3.5</version>
<version>0.4.3.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>${packagingType}</packaging>
Expand Down
2 changes: 1 addition & 1 deletion arex-web-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.arextest</groupId>
<artifactId>arex-web</artifactId>
<version>0.4.3.5</version>
<version>0.4.3.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion arex-web-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.arextest</groupId>
<artifactId>arex-web</artifactId>
<version>0.4.3.5</version>
<version>0.4.3.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>arex-web-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,17 @@ public boolean changeReportStatus(ChangeReplayStatusRequestType request) {
request.getPlanId(),
request.getStatus(),
request.getTotalCaseCount(),
request.getErrorMessage()
request.getErrorMessage(),
request.isRerun()
);
if (request.getItems() != null) {
for (ChangeReplayStatusRequestType.ReplayItem item : request.getItems()) {
planItemStatisticRepository.changePlanItemStatus(
item.getPlanItemId(),
item.getStatus(),
item.getTotalCaseCount(),
item.getErrorMessage()
item.getErrorMessage(),
request.isRerun()
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public interface ReportPlanItemStatisticRepository extends RepositoryProvider {
List<Integer> findStatusesByPlanId(String planId);


PlanItemDto changePlanItemStatus(String planItemId, Integer status, Integer totalCaseCount, String errorMessage);
PlanItemDto changePlanItemStatus(String planItemId, Integer status, Integer totalCaseCount, String errorMessage,
boolean rerun);

boolean deletePlanItemsByPlanId(String planId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ List<LatestDailySuccessPlanIdDto> findLatestDailySuccessPlanId(String rangeField
List<MutablePair<Object, Object>> matches, String groupField,
String timeDate, String orderField, boolean desc);

ReportPlanStatisticDto changePlanStatus(String planId, Integer status, Integer totalCaseCount, String errorMessage);
ReportPlanStatisticDto changePlanStatus(String planId, Integer status, Integer totalCaseCount,
String errorMessage, boolean rerun);

boolean deletePlan(String planId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,21 @@ public List<Integer> findStatusesByPlanId(String planId) {
}

@Override
public PlanItemDto changePlanItemStatus(String planItemId, Integer status, Integer totalCaseCount, String errorMessage) {
public PlanItemDto changePlanItemStatus(String planItemId, Integer status, Integer totalCaseCount,
String errorMessage, boolean rerun) {
if (planItemId == null || planItemId == "") {
return null;
}
Update update = MongoHelper.getUpdate();
if (status != null) {
update.set(STATUS, status);
if (Objects.equals(status, ReplayStatusType.RUNNING)) {
update.set(REPLAY_START_TIME, System.currentTimeMillis());
} else {
update.set(REPLAY_END_TIME, System.currentTimeMillis());
// rerun does not update start time and end time
if (!rerun) {
if (Objects.equals(status, ReplayStatusType.RUNNING)) {
update.set(REPLAY_START_TIME, System.currentTimeMillis());
} else {
update.set(REPLAY_END_TIME, System.currentTimeMillis());
}
}
}
if (totalCaseCount != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ public Document toDocument(AggregationOperationContext aggregationOperationConte
public ReportPlanStatisticDto changePlanStatus(String planId,
Integer status,
Integer totalCaseCount,
String errorMessage) {
String errorMessage,
boolean rerun) {
if (planId == null || planId == "") {
return null;
}
Expand All @@ -322,7 +323,9 @@ public ReportPlanStatisticDto changePlanStatus(String planId,
if (errorMessage != null) {
update.set(ERROR_MESSAGE, errorMessage);
}
update.set(REPLAY_END_TIME, System.currentTimeMillis());
if (!rerun) {
update.set(REPLAY_END_TIME, System.currentTimeMillis());
}
if (update.getUpdateObject().keySet().size() == 0) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion arex-web-model-contract/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.arextest</groupId>
<artifactId>arex-web</artifactId>
<version>0.4.3.5</version>
<version>0.4.3.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ChangeReplayStatusRequestType {
private Integer status;
private String errorMessage;
private List<ReplayItem> items;
private boolean rerun;


@Data
Expand Down
2 changes: 1 addition & 1 deletion arex-web-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.arextest</groupId>
<artifactId>arex-web</artifactId>
<version>0.4.3.5</version>
<version>0.4.3.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.arextest</groupId>
<artifactId>arex-web</artifactId>
<packaging>pom</packaging>
<version>0.4.3.5</version>
<version>0.4.3.6</version>
<modules>
<module>arex-web-api</module>
<module>arex-web-common</module>
Expand Down

0 comments on commit 9edce8b

Please sign in to comment.