Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove runnerfile from .matlab folder #219

Closed
wants to merge 3 commits into from
Closed
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
6 changes: 1 addition & 5 deletions src/main/java/com/mathworks/ci/MatlabBuilderConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ public class MatlabBuilderConstants {
static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";

static final String NEW_LINE = System.getProperty("line.separator");

//MATLAB Runner Script

static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE,
"tmpDir=tempname;",
"mkdir(tmpDir);",
"addpath(tmpDir);",
"zipURL='${ZIP_FILE}';",
"unzip(zipURL,tmpDir);",
"testScript = genscript(${PARAMS});",
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mathworks/ci/RunMatlabTestsBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,
public String constructCommandForTest(FilePath scriptPath) {
final String matlabScriptName = getValidMatlabFileName(scriptPath.getBaseName());
final String runCommand = "addpath('" + scriptPath.getRemote().replaceAll("'", "''")
+ "'); " + matlabScriptName + ",delete('.matlab/" + scriptPath.getBaseName() + "/"
+ matlabScriptName + ".m'),runnerScript,rmdir(tmpDir,'s')";
+ "');tmpDir=tempname;mkdir(tmpDir), ,movefile('.matlab/" + scriptPath.getBaseName() + "/"
Copy link
Member

Choose a reason for hiding this comment

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

Why move file here, Cant we keep the runner script as is and just call it here with simple script name

Copy link
Member

Choose a reason for hiding this comment

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

@dolonm-mw can you pls look into this

Copy link
Member Author

Choose a reason for hiding this comment

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

On it!

+ matlabScriptName + ".m',tmpDir),addpath(tmpDir),"+matlabScriptName+",runnerScript,rmdir(tmpDir,'s')";
return runCommand;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public void verifyRunnerScriptDeleted() throws Exception {
project.getBuildWrappersList().add(this.buildWrapper);
project.getBuildersList().add(testBuilder);
FreeStyleBuild build = project.scheduleBuild2(0).get();
jenkins.assertLogContains("delete('.matlab/", build);
jenkins.assertLogContains("movefile('.matlab/", build);
}

/*
Expand Down