Skip to content

Commit 51f1207

Browse files
authored
Escape context.pipelineConfig property for tests (#291)
1 parent b976bfc commit 51f1207

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

SequenceAnalysis/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ dependencies {
177177
if (project.findProject(BuildUtils.getTestProjectPath(project.gradle)) != null && project.hasProperty("teamcity"))
178178
{
179179
project.evaluationDependsOn(BuildUtils.getTestProjectPath(project.gradle))
180-
def configDir = "${ServerDeployExtension.getServerDeployDirectory(project)}/config"
180+
def configDir = new File(ServerDeployExtension.getServerDeployDirectory(project), "config")
181181
def testProject = project.findProject(BuildUtils.getTestProjectPath(project.gradle))
182182
def createPipelineConfigTask = project.tasks.register("createPipelineConfig", Copy) {
183183
Copy task ->
@@ -197,13 +197,9 @@ if (project.findProject(BuildUtils.getTestProjectPath(project.gradle)) != null &
197197
return newLine
198198

199199
})
200-
task.destinationDir = new File(configDir)
200+
task.destinationDir = configDir
201201

202202
if (BuildUtils.useEmbeddedTomcat(project)) {
203-
task.doFirst {
204-
new File(new File(BuildUtils.getEmbeddedConfigPath(project)), "application.properties") << "\n${configDir}"
205-
}
206-
207203
rootProject.allprojects {
208204
task.mustRunAfter tasks.withType(DoThenSetup)
209205
}
@@ -213,7 +209,8 @@ if (project.findProject(BuildUtils.getTestProjectPath(project.gradle)) != null &
213209
dependsOn(createPipelineConfigTask)
214210
if (BuildUtils.useEmbeddedTomcat(project)) {
215211
it.doFirst {
216-
new File(new File(BuildUtils.getEmbeddedConfigPath(project)), "application.properties") << "\ncontext.pipelineConfig=${configDir}"
212+
new File(new File(BuildUtils.getEmbeddedConfigPath(project)), "application.properties")
213+
<< "\ncontext.pipelineConfig=${configDir.getAbsolutePath().replace("\\", "\\\\")}"
217214
}
218215
}
219216
}

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceRemoteIntegrationTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ private File setupConfigDir(File outDir) throws IOException
8383

8484
path = path.replaceAll("\\\\", "/");
8585
line = line.replaceAll("@@SEQUENCEANALYSIS_TOOLS@@", path);
86+
_log.info("Writing to pipelineConfig.xml: " + line);
8687
}
8788
else if (line.contains("@@WORK_DIR@@"))
8889
{
8990
line = line.replaceAll("@@WORK_DIR@@", outDir.getPath().replaceAll("\\\\", "/"));
91+
_log.info("Writing to pipelineConfig.xml: " + line);
9092
}
9193

9294
writer.println(line);
@@ -213,6 +215,8 @@ protected void executeJobRemote(File workDir, @Nullable File jobJson) throws IOE
213215
ProcessBuilder pb = new ProcessBuilder(args);
214216
pb.directory(workDir);
215217

218+
_log.info("Executing job in '" + pb.directory().getAbsolutePath() + "': " + String.join(" ", pb.command()));
219+
216220
Process proc;
217221
try
218222
{

0 commit comments

Comments
 (0)