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

Commit 1a2acbc

Browse files
committed
Fixed test failures
1 parent 9c08600 commit 1a2acbc

File tree

5 files changed

+11
-23
lines changed

5 files changed

+11
-23
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher
188188
// Set Environment variable
189189
setEnv(initialEnvironment);
190190

191-
String nodeSpecificMatlab = getNodeSpecificMatlab(Computer.currentComputer(), listener) + getNodeSpecificExecutable(launcher);
191+
String nodeSpecificMatlab = "";
192+
if(getNodeSpecificMatlab(Computer.currentComputer(), listener) != null) {
193+
nodeSpecificMatlab = getNodeSpecificMatlab(Computer.currentComputer(), listener) + getNodeSpecificExecutable(launcher);
194+
} else {
195+
throw new IOException ("ERROR***");
196+
}
197+
192198
FilePath matlabExecutablePath = new FilePath(launcher.getChannel(), nodeSpecificMatlab);
193199

194200
if (!matlabExecutablePath.exists()) {

src/test/java/integ/com/mathworks/ci/RunMatlabBuildBuilderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static void classSetup() throws URISyntaxException, IOException {
6262
url = classLoader.getResource("com/mathworks/ci/linux/bin/matlab.sh");
6363
try {
6464
matlabExecutorAbsolutePath = new File(url.toURI()).getAbsolutePath();
65+
System.out.println ("THE EXECUTOR PATH IS" + matlabExecutorAbsolutePath);
6566

6667
// Need to do this operation due to bug in maven Resource copy plugin [
6768
// https://issues.apache.org/jira/browse/MRESOURCES-132 ]

src/test/java/integ/com/mathworks/ci/RunMatlabBuildBuilderTester.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,7 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,
9393
TaskListener listener) throws IOException, InterruptedException {
9494
ProcStarter matlabLauncher;
9595
try {
96-
matlabLauncher = launcher.launch().pwd(workspace).envs(this.env);
97-
if (matlabRel.verLessThan(MatlabBuilderConstants.BASE_MATLAB_VERSION_BATCH_SUPPORT)) {
98-
ListenerLogDecorator outStream = new ListenerLogDecorator(listener);
99-
matlabLauncher = matlabLauncher.cmds(testMatlabBuild()).stderr(outStream);
100-
} else {
101-
matlabLauncher = matlabLauncher.cmds(testMatlabBuild()).stdout(listener);
102-
}
96+
matlabLauncher = launcher.launch().pwd(workspace).envs(this.env).cmds(testMatlabBuild()).stdout(listener);
10397

10498
} catch (Exception e) {
10599
listener.getLogger().println(e.getMessage());

src/test/java/integ/com/mathworks/ci/RunMatlabCommandBuilderTester.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,7 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,
9494
TaskListener listener) throws IOException, InterruptedException {
9595
ProcStarter matlabLauncher;
9696
try {
97-
matlabLauncher = launcher.launch().pwd(workspace).envs(this.env);
98-
if (matlabRel.verLessThan(MatlabBuilderConstants.BASE_MATLAB_VERSION_BATCH_SUPPORT)) {
99-
ListenerLogDecorator outStream = new ListenerLogDecorator(listener);
100-
matlabLauncher = matlabLauncher.cmds(testMatlabCommand()).stderr(outStream);
101-
} else {
102-
matlabLauncher = matlabLauncher.cmds(testMatlabCommand()).stdout(listener);
103-
}
97+
matlabLauncher = launcher.launch().pwd(workspace).envs(this.env).cmds(testMatlabCommand()).stdout(listener);
10498

10599
} catch (Exception e) {
106100
listener.getLogger().println(e.getMessage());

src/test/java/integ/com/mathworks/ci/RunMatlabTestsBuilderTester.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,7 @@ public int execCommand(FilePath workspace, Launcher launcher, TaskListener liste
179179
}
180180
ProcStarter matlabLauncher;
181181
try {
182-
matlabLauncher = launcher.launch().pwd(workspace).envs(this.env);
183-
if (this.matlabroot != null && matlabRel.verLessThan(MatlabBuilderConstants.BASE_MATLAB_VERSION_BATCH_SUPPORT)) {
184-
ListenerLogDecorator outStream = new ListenerLogDecorator(listener);
185-
matlabLauncher = matlabLauncher.cmds(testMatlabCommand()).stderr(outStream);
186-
} else {
187-
matlabLauncher = matlabLauncher.cmds(testMatlabCommand()).stdout(listener);
188-
}
189-
182+
matlabLauncher = launcher.launch().pwd(workspace).envs(this.env).cmds(testMatlabCommand()).stdout(listener);
190183
} catch (Exception e) {
191184
listener.getLogger().println(e.getMessage());
192185
return 1;

0 commit comments

Comments
 (0)