Skip to content

Commit 8fd710a

Browse files
Merge branch 'develop' into feature/predefined_resolutions
# Conflicts: # CHANGELOG.md # src/main/java/main/model/db/imports/Importer.java
2 parents 604a74a + a2eaaad commit 8fd710a

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Features:
66
- Milestone View: Add functionality that displays the latest results of the tests from the test runs -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/11)
77
- List of predefined Resolutions -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/26)
8+
- Import: Mark import as debug -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/47)
89

910
Bugfixes:
1011
- Add ALLOW_UNQUOTED_CONTROL_CHARS for mapper -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/45)

src/main/java/main/model/db/imports/Importer.java

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,27 @@
1212
import java.util.List;
1313

1414
public class Importer extends BaseImporter {
15-
private String environment;
16-
private String build_name;
17-
private Integer testRunId;
1815
private List<String> files;
1916
private String type;
2017
private TestNameNodeType testNameNodeType;
2118
private String suiteName;
22-
private String author;
23-
private String ci_build;
19+
private TestRunDto testRunTemplate;
2420
private boolean singleTestRun;
2521

2622
private HandlerFactory handlerFactory = new HandlerFactory();
2723

2824
public Importer(List<String> files, TestRunDto testRunTemplate, String pattern, String type, TestNameNodeType testNameNodeType, boolean singleTestRun, UserDto user) throws AqualityException {
2925
super(testRunTemplate.getProject_id(), pattern, user);
30-
this.environment = testRunTemplate.getExecution_environment();
31-
this.ci_build = testRunTemplate.getCi_build();
32-
this.build_name = testRunTemplate.getBuild_name();
26+
this.testRunTemplate = testRunTemplate;
3327
this.suiteName = testRunTemplate.getTest_suite().getName();
34-
this.testRunId = testRunTemplate.getId();
3528
this.files = files;
36-
this.author = testRunTemplate.getAuthor();
3729
this.type = type;
3830
this.testNameNodeType = testNameNodeType;
3931
this.singleTestRun = singleTestRun;
4032
}
4133

4234
public List<ImportDto> executeImport() throws AqualityException {
43-
if(testRunId == null && !singleTestRun){
35+
if(testRunTemplate.getId() == null && !singleTestRun){
4436
return parseIntoMultiple();
4537
}
4638

@@ -85,7 +77,7 @@ private List<ImportDto> parseIntoMultiple() throws AqualityException {
8577
private void executeResultsCreation() throws AqualityException {
8678
fillTestRunWithInputData();
8779
fillTestSuiteWithInputData();
88-
this.processImport(testRunId != null);
80+
this.processImport(testRunTemplate.getId() != null);
8981
this.testRun = new TestRunDto();
9082
this.testResults = new ArrayList<>();
9183
this.tests = new ArrayList<>();
@@ -105,11 +97,12 @@ private void fillTestSuiteWithInputData(){
10597

10698
private void fillTestRunWithInputData(){
10799
testRun.setProject_id(this.projectId);
108-
testRun.setCi_build(this.ci_build);
109-
if(author != null) this.testRun.setAuthor(author);
110-
if(environment != null) this.testRun.setExecution_environment(environment);
111-
if(build_name != null) this.testRun.setBuild_name(build_name);
112-
if(testRunId != null) this.testRun.setId(testRunId);
100+
testRun.setCi_build(testRunTemplate.getCi_build());
101+
this.testRun.setAuthor(testRunTemplate.getAuthor());
102+
this.testRun.setExecution_environment(testRunTemplate.getExecution_environment());
103+
this.testRun.setBuild_name(testRunTemplate.getBuild_name());
104+
this.testRun.setId(testRunTemplate.getId());
105+
this.testRun.setDebug(testRunTemplate.getDebug());
113106
}
114107

115108
private ImportDto finishImport() throws AqualityException {

src/main/java/main/view/Project/ExecuteImportServlet.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class ExecuteImportServlet extends BaseServlet implements IPost {
3535
private String suiteName;
3636
private Integer testRunId;
3737
private Boolean addToLastTestRun;
38+
private Boolean debug;
3839
private String environment;
3940
private String cilink;
4041
private Boolean singleTestRun;
@@ -92,6 +93,7 @@ private void readParameters(HttpServletRequest req) throws AqualityQueryParamete
9293
addToLastTestRun = getBooleanQueryParameter(req, ImportParams.addToLastTestRun.name());
9394
environment = getStringQueryParameter(req, ImportParams.environment.name());
9495
cilink = getStringQueryParameter(req, ImportParams.cilink.name());
96+
debug = getBooleanQueryParameter(req, ImportParams.debug.name());
9597
validateRequest();
9698
}
9799

@@ -108,6 +110,7 @@ private TestRunDto prepareTestRun() throws AqualityException {
108110
testRunTemplate.setExecution_environment(environment);
109111
testRunTemplate.setTest_suite(testSuiteTemplate);
110112
testRunTemplate.setId(getTestRunId());
113+
testRunTemplate.setDebug(debug ? 1 : 0);
111114

112115
return testRunTemplate;
113116
}

src/main/java/main/view/Project/ImportParams.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ public enum ImportParams {
1313
format,
1414
singleTestRun,
1515
testNameKey,
16-
addToLastTestRun
16+
addToLastTestRun,
17+
debug
1718
}

0 commit comments

Comments
 (0)