Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit b19294f

Browse files
committed
Merge remote-tracking branch 'origin/dev_main' into integ_tests
2 parents c73c73a + 699d4a7 commit b19294f

File tree

25 files changed

+2051
-149
lines changed

25 files changed

+2051
-149
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ src/main/resources/**/run-matlab-command*
88
src/main/resources/license.txt
99

1010
.idea/
11+
matlab.iml
1112

1213
**/.DS_Store

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
buildPlugin()
1+
buildPlugin(jdkVersions: [11])

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64
<parent>
75
<groupId>org.jenkins-ci.plugins</groupId>
@@ -11,7 +9,7 @@
119
</parent>
1210

1311
<artifactId>matlab</artifactId>
14-
<version>2.15.1-SNAPSHOT</version>
12+
<version> 2.16.1-SNAPSHOT</version>
1513
<packaging>hpi</packaging>
1614

1715
<name>MATLAB Plugin</name>
@@ -25,7 +23,6 @@
2523
<email>continuous-integration@mathworks.com</email>
2624
</developer>
2725
</developers>
28-
2926
<licenses>
3027
<license>
3128
<name>MIT License</name>
@@ -54,11 +51,13 @@
5451
<tag>HEAD</tag>
5552
</scm>
5653

57-
<properties>
58-
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
59-
<jenkins.baseline>2.387</jenkins.baseline>
60-
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
61-
</properties>
54+
<properties>
55+
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
56+
<jenkins.baseline>2.387</jenkins.baseline>
57+
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
58+
<maven.compiler.source>11</maven.compiler.source>
59+
<maven.compiler.target>11</maven.compiler.target>
60+
</properties>
6261

6362
<dependencyManagement>
6463
<dependencies>
@@ -73,6 +72,7 @@
7372
</dependencyManagement>
7473

7574
<dependencies>
75+
7676
<!-- JSON Parser -->
7777
<dependency>
7878
<groupId>com.googlecode.json-simple</groupId>

src/main/java/com/mathworks/ci/MatlabBuilderConstants.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.mathworks.ci;
22

33
/*
4-
* Copyright 2019-2024 The MathWorks, Inc.
4+
* Copyright 2019-2025 The MathWorks, Inc.
55
*/
66

77
public class MatlabBuilderConstants {
@@ -35,10 +35,14 @@ public class MatlabBuilderConstants {
3535
// Temporary MATLAB folder name in workspace
3636
public static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";
3737

38-
// MATLAB default function/plugin paths
38+
// MATLAB default function, plugin, service paths
3939
public static final String DEFAULT_PLUGIN = "+ciplugins/+jenkins/getDefaultPlugins.m";
4040
public static final String BUILD_REPORT_PLUGIN = "+ciplugins/+jenkins/BuildReportPlugin.m";
4141
public static final String TASK_RUN_PROGRESS_PLUGIN = "+ciplugins/+jenkins/TaskRunProgressPlugin.m";
42+
public static final String TEST_RESULTS_VIEW_PLUGIN = "+ciplugins/+jenkins/TestResultsViewPlugin.m";
43+
public static final String TEST_RESULTS_VIEW_PLUGIN_SERVICE = "+matlab/+unittest/+internal/+services/+plugins/TestResultsViewPluginService.m";
44+
45+
public static final String TEST_RESULTS_VIEW_ARTIFACT = "matlabTestResults";
4246
public static final String BUILD_ARTIFACT = "buildArtifact";
4347

4448
public static final String NEW_LINE = System.getProperty("line.separator");
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.mathworks.ci;
2+
3+
/**
4+
* Copyright 2025, The MathWorks Inc.
5+
*
6+
* Class to store MATLAB test case information
7+
*
8+
*/
9+
10+
import java.util.List;
11+
import java.math.BigDecimal;
12+
import java.util.ArrayList;
13+
14+
import org.apache.commons.lang.RandomStringUtils;
15+
16+
import com.mathworks.ci.TestResultsViewAction.TestStatus;
17+
18+
public class MatlabTestCase {
19+
private String name;
20+
private List<MatlabTestDiagnostics> diagnostics;
21+
private TestStatus status;
22+
private BigDecimal duration;
23+
private String id;
24+
25+
public MatlabTestCase(String name) {
26+
this.name = name;
27+
this.diagnostics = new ArrayList<MatlabTestDiagnostics>();
28+
this.status = TestStatus.NOT_RUN;
29+
this.duration = new BigDecimal("0.0");
30+
this.id = RandomStringUtils.randomAlphanumeric(8);
31+
}
32+
33+
public String getName() {
34+
return this.name;
35+
}
36+
37+
public void setName(String name) {
38+
this.name = name;
39+
}
40+
41+
public List<MatlabTestDiagnostics> getDiagnostics() {
42+
return this.diagnostics;
43+
}
44+
45+
public void setDiagnostics(List<MatlabTestDiagnostics> diagnostics) {
46+
this.diagnostics = diagnostics;
47+
}
48+
49+
public TestStatus getStatus() {
50+
return this.status;
51+
}
52+
53+
public void setStatus(TestStatus status) {
54+
this.status = status;
55+
}
56+
57+
public BigDecimal getDuration() {
58+
return this.duration;
59+
}
60+
61+
public void setDuration(BigDecimal duration) {
62+
this.duration = duration;
63+
}
64+
65+
public String getId() {
66+
return this.id;
67+
}
68+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.mathworks.ci;
2+
3+
/**
4+
* Copyright 2025, The MathWorks Inc.
5+
*
6+
* Class to store MATLAB test diagnostics information
7+
*
8+
*/
9+
10+
import org.apache.commons.lang.RandomStringUtils;
11+
12+
public class MatlabTestDiagnostics {
13+
private String event;
14+
private String report;
15+
private String id;
16+
17+
public MatlabTestDiagnostics() {
18+
this.event = "";
19+
this.report = "";
20+
this.id = RandomStringUtils.randomAlphanumeric(8);
21+
}
22+
23+
public String getEvent() {
24+
return this.event;
25+
}
26+
27+
public void setEvent(String event) {
28+
this.event = event;
29+
}
30+
31+
public String getReport() {
32+
return this.report;
33+
}
34+
35+
public void setReport(String report) {
36+
this.report = report;
37+
}
38+
39+
public String getId() {
40+
return this.id;
41+
}
42+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package com.mathworks.ci;
2+
3+
/**
4+
* Copyright 2025, The MathWorks Inc.
5+
*
6+
* Class to store MATLAB test file information
7+
*
8+
*/
9+
10+
import java.util.List;
11+
import java.math.BigDecimal;
12+
import java.util.ArrayList;
13+
14+
import org.apache.commons.lang.RandomStringUtils;
15+
16+
import com.mathworks.ci.TestResultsViewAction.TestStatus;
17+
18+
public class MatlabTestFile {
19+
private String path;
20+
private String name;
21+
private BigDecimal duration;
22+
private TestStatus status;
23+
private List<MatlabTestCase> matlabTestCases;
24+
private String id;
25+
26+
public MatlabTestFile(String name) {
27+
this.name = name;
28+
this.path = "";
29+
this.duration = new BigDecimal("0.0");
30+
this.status = TestStatus.NOT_RUN;
31+
this.matlabTestCases = new ArrayList<MatlabTestCase>();
32+
this.id = RandomStringUtils.randomAlphanumeric(8);
33+
}
34+
35+
private void incrementDuration(BigDecimal matlabTestCaseDuration) {
36+
this.duration = this.duration.add(matlabTestCaseDuration);
37+
}
38+
39+
private void updateStatus(MatlabTestCase matlabTestCase) {
40+
if (!this.status.equals(TestStatus.FAILED)) {
41+
if (matlabTestCase.getStatus().equals(TestStatus.FAILED)){
42+
this.status = TestStatus.FAILED;
43+
}
44+
else if (!this.status.equals(TestStatus.INCOMPLETE)){
45+
if (matlabTestCase.getStatus().equals(TestStatus.INCOMPLETE)){
46+
this.status = TestStatus.INCOMPLETE;
47+
}
48+
else if (matlabTestCase.getStatus().equals(TestStatus.PASSED)){
49+
this.status = TestStatus.PASSED;
50+
}
51+
}
52+
}
53+
}
54+
55+
public void addTestCase(MatlabTestCase matlabTestCase){
56+
this.incrementDuration(matlabTestCase.getDuration());
57+
this.updateStatus(matlabTestCase);
58+
this.getMatlabTestCases().add(matlabTestCase);
59+
}
60+
61+
public String getPath() {
62+
return this.path;
63+
}
64+
65+
public void setPath(String path) {
66+
this.path = path;
67+
}
68+
69+
public String getName() {
70+
return this.name;
71+
}
72+
73+
public void setName(String name) {
74+
this.name = name;
75+
}
76+
77+
public BigDecimal getDuration() {
78+
return this.duration;
79+
}
80+
81+
public void setDuration(BigDecimal duration) {
82+
this.duration = duration;
83+
}
84+
85+
public TestStatus getStatus() {
86+
return this.status;
87+
}
88+
89+
public void setStatus(TestStatus status) {
90+
this.status = status;
91+
}
92+
93+
public List<MatlabTestCase> getMatlabTestCases() {
94+
return this.matlabTestCases;
95+
}
96+
97+
public void setMatlabTestCases(List<MatlabTestCase> matlabTestCases) {
98+
this.matlabTestCases = matlabTestCases;
99+
}
100+
101+
public String getId() {
102+
return this.id;
103+
}
104+
}

0 commit comments

Comments
 (0)