Skip to content

Commit 3f538b5

Browse files
committed
Merge pull request #172 from SeqWare/feature/SEQWARE-1833_testing_across_cluster
Feature/seqware 1833 testing across cluster Former-commit-id: 7b58f46
2 parents 635fe24 + 744c050 commit 3f538b5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

seqware-ext-testing/src/test/java/net/sourceforge/seqware/pipeline/plugins/PluginRunnerET.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.List;
1111
import java.util.Map;
1212
import java.util.Map.Entry;
13+
import java.util.Random;
1314
import java.util.concurrent.Callable;
1415
import java.util.concurrent.CompletionService;
1516
import java.util.concurrent.ExecutionException;
@@ -19,6 +20,7 @@
1920
import junit.framework.Assert;
2021
import net.sourceforge.seqware.common.module.ReturnValue;
2122
import net.sourceforge.seqware.common.util.Log;
23+
import net.sourceforge.seqware.common.util.configtools.ConfigTools;
2224
import net.sourceforge.seqware.pipeline.runner.PluginRunner;
2325
import org.apache.commons.io.FileUtils;
2426
import org.junit.AfterClass;
@@ -48,7 +50,8 @@
4850
*/
4951
public class PluginRunnerET {
5052

51-
private static File tempDir = Files.createTempDir();
53+
private static File tempDir = null;
54+
5255
private static Map<String, Integer> installedWorkflows = new HashMap<String, Integer>();
5356
private static Map<String, File> bundleLocations = new HashMap<String, File>();
5457
private static List<Integer> launchedWorkflowRuns = new ArrayList<Integer>();
@@ -86,8 +89,8 @@ public static void createAndInstallArchetypes() throws IOException {
8689
return;
8790
}
8891
}
92+
createSharedTempDir();
8993

90-
tempDir = Files.createTempDir();
9194
Log.info("Trying to build and test archetypes at: " + tempDir.getAbsolutePath());
9295
PluginRunner it = new PluginRunner();
9396
String SEQWARE_VERSION = it.getClass().getPackage().getImplementationVersion();
@@ -166,7 +169,7 @@ public static void clearStaticVariables() {
166169
installedWorkflows.clear();
167170
bundleLocations.clear();
168171
launchedWorkflowRuns.clear();
169-
tempDir = Files.createTempDir();
172+
createSharedTempDir();
170173
}
171174

172175
public static void monitorAndClean(boolean monitor) throws IOException {
@@ -184,6 +187,14 @@ public static void monitorAndClean(boolean monitor) throws IOException {
184187

185188
clearStaticVariables();
186189
}
190+
191+
private static void createSharedTempDir() {
192+
// need to create in a shared location for seqware installs with multiple nodes
193+
//tempDir = Files.createTempDir();
194+
String parentDir = ConfigTools.getSettings().get("OOZIE_WORK_DIR");
195+
tempDir = new File(parentDir, String.valueOf(Math.abs(new Random().nextInt())));
196+
tempDir.mkdir();
197+
}
187198

188199
@Test
189200
public void testExportParameters() throws IOException{

0 commit comments

Comments
 (0)