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

Commit 3b4387c

Browse files
authored
Merge pull request #321 from mathworks/2.13.2-SNAPSHOT-Qualification
2.13.2 snapshot qualification
2 parents 3232740 + 1cab505 commit 3b4387c

File tree

115 files changed

+2940
-1405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2940
-1405
lines changed

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
<artifactId>workflow-job</artifactId>
101101
<scope>test</scope>
102102
</dependency>
103+
<!-- Mockito -->
104+
<dependency>
105+
<groupId>org.mockito</groupId>
106+
<artifactId>mockito-core</artifactId>
107+
<version>3.1.0</version>
108+
<scope>test</scope>
109+
</dependency>
103110
</dependencies>
104111
<build>
105112
<plugins>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public FilePath getWorkspace() {
136136

137137
private void setCounts() throws InterruptedException, ParseException {
138138
List<BuildArtifactData> artifactData = new ArrayList<BuildArtifactData>();
139-
FilePath fl = new FilePath(new File(build.getRootDir().getAbsolutePath() + "/" + BUILD_ARTIFACT_FILE));
139+
FilePath fl = new FilePath(new File(build.getRootDir(), BUILD_ARTIFACT_FILE));
140140
try (InputStreamReader reader = new InputStreamReader(new FileInputStream(new File(fl.toURI())), "UTF-8")) {
141141
Object obj = new JSONParser().parse(reader);
142142
JSONObject jo = (JSONObject) obj;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ private static byte[][] createBuildNotes() {
3838
} catch (IOException e) {
3939
throw new RuntimeException(e);
4040
}
41-
4241
}
4342

4443
@Override
@@ -80,4 +79,4 @@ public OutputStream decorateLogger(Run build, OutputStream logger) throws IOExce
8079
return new BuildConsoleAnnotator(logger, Charsets.UTF_8, buildNotes);
8180
}
8281
}
83-
}
82+
}

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

Lines changed: 0 additions & 191 deletions
This file was deleted.

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

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,43 @@
44
*/
55

66
public class MatlabBuilderConstants {
7-
static final double BASE_MATLAB_VERSION_RUNTESTS_SUPPORT = 8.1;
8-
static final double BASE_MATLAB_VERSION_NO_APP_ICON_SUPPORT = 8.6;
9-
static final double BASE_MATLAB_VERSION_BATCH_SUPPORT = 9.5;
10-
static final double BASE_MATLAB_VERSION_COBERTURA_SUPPORT = 9.3;
11-
static final double BASE_MATLAB_VERSION_MODELCOVERAGE_SUPPORT = 9.5;
12-
static final double BASE_MATLAB_VERSION_EXPORTSTMRESULTS_SUPPORT = 9.6;
7+
public static final double BASE_MATLAB_VERSION_RUNTESTS_SUPPORT = 8.1;
8+
public static final double BASE_MATLAB_VERSION_NO_APP_ICON_SUPPORT = 8.6;
9+
public static final double BASE_MATLAB_VERSION_BATCH_SUPPORT = 9.5;
10+
public static final double BASE_MATLAB_VERSION_COBERTURA_SUPPORT = 9.3;
11+
public static final double BASE_MATLAB_VERSION_MODELCOVERAGE_SUPPORT = 9.5;
12+
public static final double BASE_MATLAB_VERSION_EXPORTSTMRESULTS_SUPPORT = 9.6;
1313

14-
static final String MATLAB_RUNNER_TARGET_FILE = "Builder.matlab.runner.target.file.name";
15-
static final String MATLAB_TESTS_RUNNER_TARGET_FILE = "runMatlabTests.m";
16-
static final String MATLAB_RUNNER_RESOURCE = "com/mathworks/ci/MatlabBuilder/runMatlabTests.m";
17-
static final String AUTOMATIC_OPTION = "RunTestsAutomaticallyOption";
14+
public static final String MATLAB_RUNNER_TARGET_FILE = "Builder.matlab.runner.target.file.name";
15+
public static final String MATLAB_TESTS_RUNNER_TARGET_FILE = "runMatlabTests.m";
16+
public static final String MATLAB_RUNNER_RESOURCE = "com/mathworks/ci/MatlabBuilder/runMatlabTests.m";
17+
public static final String AUTOMATIC_OPTION = "RunTestsAutomaticallyOption";
1818

1919
// Input parameter names (Passed to runMatlabTests.m as name-value pair arguments)
20-
static final String PDF_REPORT = "'PDFReport'";
21-
static final String TAP_RESULTS = "'TAPResults'";
22-
static final String JUNIT_RESULTS = "'JUnitResults'";
23-
static final String STM_RESULTS = "'SimulinkTestResults'";
24-
static final String COBERTURA_CODE_COVERAGE = "'CoberturaCodeCoverage'";
25-
static final String COBERTURA_MODEL_COVERAGE = "'CoberturaModelCoverage'";
20+
public static final String PDF_REPORT = "'PDFReport'";
21+
public static final String TAP_RESULTS = "'TAPResults'";
22+
public static final String JUNIT_RESULTS = "'JUnitResults'";
23+
public static final String STM_RESULTS = "'SimulinkTestResults'";
24+
public static final String COBERTURA_CODE_COVERAGE = "'CoberturaCodeCoverage'";
25+
public static final String COBERTURA_MODEL_COVERAGE = "'CoberturaModelCoverage'";
2626

2727
//Matlab Script generator package
28-
static final String MATLAB_SCRIPT_GENERATOR = "matlab-script-generator.zip";
28+
public static final String MATLAB_SCRIPT_GENERATOR = "matlab-script-generator.zip";
2929

3030
//Test runner file prefix
31-
static final String MATLAB_TEST_RUNNER_FILE_PREFIX = "runner_";
31+
public static final String MATLAB_TEST_RUNNER_FILE_PREFIX = "runner_";
3232

3333
//Temporary MATLAB folder name in workspace
34-
static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";
34+
public static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";
3535

36-
static final String NEW_LINE = System.getProperty("line.separator");
36+
public static final String NEW_LINE = System.getProperty("line.separator");
3737

3838
//MATLAB Runner Script
39-
static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE,
40-
"tmpDir=tempname;",
41-
"mkdir(tmpDir);",
42-
"addpath(tmpDir);",
43-
"zipURL='${ZIP_FILE}';",
44-
"unzip(zipURL,tmpDir);",
39+
public static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE,
40+
"addpath('${TEMP_FOLDER}');",
4541
"testScript = genscript(${PARAMS});",
4642
"disp('Running MATLAB script with content:');",
4743
"disp(testScript.Contents);",
48-
"testScript.writeToFile(fullfile(tmpDir,'runnerScript.m'));",
49-
"fprintf('___________________________________\\n\\n');");
44+
"fprintf('___________________________________\\n\\n');",
45+
"run(testScript);");
5046
}

0 commit comments

Comments
 (0)