This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Show only last scenario execution after campaign retry (#1132)
Co-authored-by: nbrouand <[email protected]>
- Loading branch information
1 parent
3e382ba
commit d5c433a
Showing
26 changed files
with
657 additions
and
72 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
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 |
---|---|---|
|
@@ -60,4 +60,6 @@ private <T> List<T> initListNullOrEmpty(List<T> list) { | |
} | ||
return new ArrayList<>(); | ||
} | ||
|
||
|
||
} |
78 changes: 78 additions & 0 deletions
78
...rc/main/java/com/chutneytesting/server/core/domain/scenario/campaign/CampaignBuilder.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,78 @@ | ||
package com.chutneytesting.server.core.domain.scenario.campaign; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class CampaignBuilder { | ||
private Long id; | ||
private String title; | ||
private String description; | ||
private List<String> scenarioIds; | ||
private Map<String, String> executionParameters; | ||
private String environment; | ||
private boolean parallelRun; | ||
private boolean retryAuto; | ||
private String externalDatasetId; | ||
private List<String> tags; | ||
|
||
public static CampaignBuilder builder() { | ||
return new CampaignBuilder(); | ||
} | ||
|
||
public CampaignBuilder(){ | ||
|
||
} | ||
public CampaignBuilder setId(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setTitle(String title) { | ||
this.title = title; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setDescription(String description) { | ||
this.description = description; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setScenarioIds(List<String> scenarioIds) { | ||
this.scenarioIds = scenarioIds; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setExecutionParameters(Map<String, String> executionParameters) { | ||
this.executionParameters = executionParameters; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setEnvironment(String environment) { | ||
this.environment = environment; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setParallelRun(boolean parallelRun) { | ||
this.parallelRun = parallelRun; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setRetryAuto(boolean retryAuto) { | ||
this.retryAuto = retryAuto; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setExternalDatasetId(String externalDatasetId) { | ||
this.externalDatasetId = externalDatasetId; | ||
return this; | ||
} | ||
|
||
public CampaignBuilder setTags(List<String> tags) { | ||
this.tags = tags; | ||
return this; | ||
} | ||
|
||
public Campaign build() { | ||
return new Campaign(id, title, description, scenarioIds, executionParameters, environment, parallelRun, retryAuto, externalDatasetId, tags); | ||
} | ||
} |
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
109 changes: 109 additions & 0 deletions
109
...m/chutneytesting/server/core/domain/scenario/campaign/CampaignExecutionReportBuilder.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,109 @@ | ||
package com.chutneytesting.server.core.domain.scenario.campaign; | ||
|
||
import static java.util.Optional.ofNullable; | ||
|
||
import com.chutneytesting.server.core.domain.execution.report.ServerReportStatus; | ||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class CampaignExecutionReportBuilder { | ||
// Mandatory fields | ||
private Long executionId; | ||
private String campaignName; | ||
private boolean partialExecution; | ||
private String executionEnvironment; | ||
private String dataSetId; | ||
private Integer dataSetVersion; | ||
private String userId; | ||
|
||
// Optional fields | ||
private List<ScenarioExecutionReportCampaign> scenarioExecutionReports = new ArrayList<>(); | ||
private Long campaignId; | ||
private LocalDateTime startDate; | ||
private ServerReportStatus status; | ||
|
||
public static CampaignExecutionReportBuilder builder() { | ||
return new CampaignExecutionReportBuilder(); | ||
} | ||
|
||
private CampaignExecutionReportBuilder() { | ||
|
||
} | ||
|
||
public CampaignExecutionReportBuilder setExecutionId(Long executionId) { | ||
this.executionId = executionId; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setCampaignName(String campaignName) { | ||
this.campaignName = campaignName; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setPartialExecution(boolean partialExecution) { | ||
this.partialExecution = partialExecution; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setExecutionEnvironment(String executionEnvironment) { | ||
this.executionEnvironment = executionEnvironment; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setStartDate(LocalDateTime startDate) { | ||
this.startDate = startDate; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setStatus(ServerReportStatus status) { | ||
this.status = status; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setDataSetId(String dataSetId) { | ||
this.dataSetId = dataSetId; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setDataSetVersion(Integer dataSetVersion) { | ||
this.dataSetVersion = dataSetVersion; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setUserId(String userId) { | ||
this.userId = userId; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder addScenarioExecutionReport(ScenarioExecutionReportCampaign scenarioExecutionReport) { | ||
this.scenarioExecutionReports.add(scenarioExecutionReport); | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setScenarioExecutionReport(List<ScenarioExecutionReportCampaign> scenarioExecutionsReports) { | ||
this.scenarioExecutionReports = new ArrayList<>(scenarioExecutionsReports); | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReportBuilder setCampaignId(Long campaignId) { | ||
this.campaignId = campaignId; | ||
return this; | ||
} | ||
|
||
public CampaignExecutionReport build() { | ||
return new CampaignExecutionReport( | ||
executionId, | ||
campaignId, | ||
campaignName, | ||
partialExecution, | ||
executionEnvironment, | ||
userId, | ||
ofNullable(dataSetId), | ||
ofNullable(dataSetVersion), | ||
startDate, | ||
status, | ||
scenarioExecutionReports | ||
); | ||
} | ||
} |
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
Oops, something went wrong.