|
1 | 1 | package com.mathworks.ci; |
2 | | -/** |
3 | | - * Copyright 2020 The MathWorks, Inc. |
4 | | - * |
5 | | - */ |
6 | | -import java.io.IOException; |
7 | | -import java.io.InputStream; |
8 | | - |
9 | 2 | /** |
10 | 3 | * Copyright 2020 The MathWorks, Inc. |
11 | 4 | * |
@@ -104,16 +97,9 @@ public void setModelCoverageCobertura(String modelCoverageCobertura) { |
104 | 97 |
|
105 | 98 | @Override |
106 | 99 | public StepExecution start(StepContext context) throws Exception { |
107 | | - Launcher launcher = context.get(Launcher.class); |
108 | | - FilePath workspace = context.get(FilePath.class); |
109 | | - |
110 | | - //Copy Scratch file needed to run MATLAB tests in workspace |
111 | | - FilePath targetWorkspace = new FilePath(launcher.getChannel(), workspace.getRemote()); |
112 | | - copyScratchFileInWorkspace(MatlabBuilderConstants.MATLAB_TESTS_RUNNER_RESOURCE, |
113 | | - MatlabBuilderConstants.MATLAB_TESTS_RUNNER_TARGET_FILE, targetWorkspace); |
114 | | - return new MatlabRunTestsStepExecution(context,constructCommandForTest(getInputArgs())); |
| 100 | + return new MatlabRunTestsStepExecution(context, constructCommandForTest(getInputArgs())); |
115 | 101 | } |
116 | | - |
| 102 | + |
117 | 103 | @Extension |
118 | 104 | public static class RunTestsStepDescriptor extends StepDescriptor { |
119 | 105 |
|
@@ -169,17 +155,4 @@ private Map<String, String> getMatlabArgs() { |
169 | 155 | args.put("CoberturaModelCoveragePath", getModelCoverageCobertura()); |
170 | 156 | return args; |
171 | 157 | } |
172 | | - |
173 | | - /* |
174 | | - * Method to copy given file from source to target node specific workspace. |
175 | | - */ |
176 | | - private void copyScratchFileInWorkspace(String sourceFile, String targetFile, FilePath targetWorkspace) |
177 | | - throws IOException, InterruptedException { |
178 | | - final ClassLoader classLoader = getClass().getClassLoader(); |
179 | | - FilePath targetFilePath = new FilePath(targetWorkspace, targetFile); |
180 | | - InputStream in = classLoader.getResourceAsStream(sourceFile); |
181 | | - targetFilePath.copyFrom(in); |
182 | | - // set executable permission |
183 | | - targetFilePath.chmod(0755); |
184 | | - } |
185 | 158 | } |
0 commit comments