Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
<dependency>
<groupId>br.eti.kinoshita</groupId>
<artifactId>testlink-java-api</artifactId>
<version>1.9.17-0</version>
<version>1.9.20-1</version>
</dependency>
<dependency>
<groupId>org.tap4j</groupId>
Expand All @@ -246,7 +246,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.9</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -292,6 +292,13 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1.24</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>scm-api</artifactId>
<version>2.0.8</version>
<type>jar</type>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, why did you have to include the scm-api? Was it to fix an issue running tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kinow, yes I assumed this from one of the error messages while getting the build to run. Also forgot to mention, that I built the project with mvn package -Dmaven.test.skip=true for the same reason. Thus all warnings and errors seem to relate to testing/doc, where I have no clue how to fix.

Build environment is:

  • CentOS 7
  • OpenJDK 1.8
  • Maven 3.9.6 (manually installed)

Thanks for your valuable work and superfast response!

</dependency>
</dependencies>

Expand Down
59 changes: 36 additions & 23 deletions src/main/java/hudson/plugins/testlink/TestLinkSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,20 @@ public Report getReport() {
*/
public TestCase[] getAutomatedTestCases(String[] customFieldsNames) {
final TestCase[] testCases = this.api.getTestCasesForTestPlan(
getTestPlan().getId(),
null,
null,
null,
null,
null,
null,
getTestPlan().getId(),
null, // testCasesId
null, // buildId
null, // keywordsIds
null, // keywords
null, // executed
null, // assigned to
null, // execute status
ExecutionType.AUTOMATED,
ExecutionType.AUTOMATED,
Boolean.TRUE,
TestCaseDetails.FULL);
TestCaseDetails.FULL);

ArrayList<TestCase> filteredTestcases = new ArrayList<TestCase>();

for( final TestCase testCase : testCases ) {
testCase.setTestProjectId(getTestProject().getId());
testCase.setExecutionStatus(ExecutionStatus.NOT_RUN);
Expand All @@ -162,11 +162,12 @@ public TestCase[] getAutomatedTestCases(String[] customFieldsNames) {
testCase.getCustomFields().add(customField);
}
}
if(platform == null || testCase.getPlatform().getName().equals(platform.getName()))

if(platform == null || testCase.getPlatform().getName().equals(platform.getName())) {
filteredTestcases.add(testCase);
}
}

return filteredTestcases.toArray(new TestCase[filteredTestcases.size()]);
}

Expand Down Expand Up @@ -202,25 +203,37 @@ public int updateTestCase(TestCaseWrapper testCase) {
// platformId is set to null
platformName = testCase.getPlatform(); // platform name
}

if (testCase.getExecutionStatus() != null && !ExecutionStatus.NOT_RUN.equals(testCase.getExecutionStatus())) {
// Update Test Case status

/* from Java API:
* public ReportTCResultResponse reportTCResult(Integer testCaseId, Integer testCaseExternalId, Integer testPlanId,
ExecutionStatus status, List<TestCaseStepResult> steps, Integer buildId, String buildName, String notes,
Integer executionDuration, Boolean guess, String bugId, Integer platformId, String platformName,
Map<String, String> customFields, Boolean overwrite, String user, String timestamp)
*/

final ReportTCResultResponse reportTCResultResponse = api.reportTCResult(
testCase.getId(),
testCase.getInternalId(),
testPlan.getId(),
testCase.getId(),
testCase.getInternalId(),
testPlan.getId(),
testCase.getExecutionStatus(),
null, // List<TestCaseStepResult> steps
build.getId(),
build.getName(),
testCase.getNotes(),
build.getId(),
build.getName(),
testCase.getNotes(),
null, // execution duration
null, // guess
null, // bug id
platformId, // platform id
platformName, // platform name
null, // custom fields
null);

null, // overwrite
null, // user
null // timestamp
);

switch(testCase.getExecutionStatus()) {
case PASSED:
report.setPassed(report.getPassed()+1);
Expand Down