Fix pipeline tests that were not respecting the pipeline test dry run setting
There are a few pipeline test classes that do not run Queue, but are classified as pipeline tests because they submit farm jobs. Make these unconventional pipeline tests respect the pipeline test dry run setting.
This commit is contained in:
parent
1ec56c9e64
commit
31827022db
|
|
@ -131,6 +131,8 @@ public abstract class BaseTest {
|
|||
|
||||
public static final String exampleFASTA = publicTestDir + "exampleFASTA.fasta";
|
||||
|
||||
public static final boolean pipelineTestRunModeIsSet = System.getProperty("pipeline.run").equals("run");
|
||||
|
||||
/** before the class starts up */
|
||||
static {
|
||||
// setup a basic log configuration
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import org.apache.commons.io.FileUtils;
|
|||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.ggf.drmaa.*;
|
||||
import org.testng.Assert;
|
||||
import org.testng.SkipException;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -51,19 +52,23 @@ public class JnaSessionPipelineTest extends BaseTest {
|
|||
|
||||
@Test(dependsOnMethods = { "testDrmaa" })
|
||||
public void testSubmitEcho() throws Exception {
|
||||
if ( ! pipelineTestRunModeIsSet ) {
|
||||
throw new SkipException("Skipping testSubmitEcho because we are in pipeline test dry run mode");
|
||||
}
|
||||
|
||||
if (implementation.contains("LSF")) {
|
||||
System.err.println(" ***********************************************************");
|
||||
System.err.println(" *************************************************************");
|
||||
System.err.println(" **** ****");
|
||||
System.err.println(" **** Skipping JnaSessionIntegrationTest.testSubmitEcho() ****");
|
||||
System.err.println(" **** Skipping JnaSessionPipelineTest.testSubmitEcho() ****");
|
||||
System.err.println(" **** Are you using the dotkit .combined_LSF_SGE? ****");
|
||||
System.err.println(" **** ****");
|
||||
System.err.println(" *************************************************************");
|
||||
System.err.println(" ***********************************************************");
|
||||
return;
|
||||
throw new SkipException("Skipping testSubmitEcho because correct DRMAA implementation not found");
|
||||
}
|
||||
|
||||
File outFile = tryCreateNetworkTempFile("JnaSessionIntegrationTest.out");
|
||||
File outFile = tryCreateNetworkTempFile("JnaSessionPipelineTest.out");
|
||||
Session session = factory.getSession();
|
||||
session.init(null);
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import com.sun.jna.ptr.PointerByReference;
|
|||
import org.apache.commons.io.FileUtils;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.testng.Assert;
|
||||
import org.testng.SkipException;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -87,22 +88,26 @@ public class LibDrmaaPipelineTest extends BaseTest {
|
|||
|
||||
@Test(dependsOnMethods = { "testDrmaa" })
|
||||
public void testSubmitEcho() throws Exception {
|
||||
if ( ! pipelineTestRunModeIsSet ) {
|
||||
throw new SkipException("Skipping testSubmitEcho because we are in pipeline test dry run mode");
|
||||
}
|
||||
|
||||
if (implementation.contains("LSF")) {
|
||||
System.err.println(" *********************************************************");
|
||||
System.err.println(" ***********************************************************");
|
||||
System.err.println(" **** ****");
|
||||
System.err.println(" **** Skipping LibDrmaaIntegrationTest.testSubmitEcho() ****");
|
||||
System.err.println(" **** Skipping LibDrmaaPipelineTest.testSubmitEcho() ****");
|
||||
System.err.println(" **** Are you using the dotkit .combined_LSF_SGE? ****");
|
||||
System.err.println(" **** ****");
|
||||
System.err.println(" ***********************************************************");
|
||||
System.err.println(" *********************************************************");
|
||||
return;
|
||||
throw new SkipException("Skipping testSubmitEcho because correct DRMAA implementation not found");
|
||||
}
|
||||
|
||||
Memory error = new Memory(LibDrmaa.DRMAA_ERROR_STRING_BUFFER);
|
||||
int errnum;
|
||||
|
||||
File outFile = tryCreateNetworkTempFile("LibDrmaaIntegrationTest.out");
|
||||
File outFile = tryCreateNetworkTempFile("LibDrmaaPipelineTest.out");
|
||||
|
||||
errnum = LibDrmaa.drmaa_init(null, error, LibDrmaa.DRMAA_ERROR_STRING_BUFFER_LEN);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.sun.jna.ptr.IntByReference;
|
|||
import org.apache.commons.io.FileUtils;
|
||||
import org.broadinstitute.sting.utils.Utils;
|
||||
import org.testng.Assert;
|
||||
import org.testng.SkipException;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
|
|
@ -43,7 +44,7 @@ import java.io.File;
|
|||
public class LibBatPipelineTest extends BaseTest {
|
||||
@BeforeClass
|
||||
public void initLibBat() {
|
||||
Assert.assertFalse(LibBat.lsb_init("LibBatIntegrationTest") < 0, LibBat.lsb_sperror("lsb_init() failed"));
|
||||
Assert.assertFalse(LibBat.lsb_init("LibBatPipelineTest") < 0, LibBat.lsb_sperror("lsb_init() failed"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -93,15 +94,19 @@ public class LibBatPipelineTest extends BaseTest {
|
|||
|
||||
@Test
|
||||
public void testSubmitEcho() throws Exception {
|
||||
if ( ! pipelineTestRunModeIsSet ) {
|
||||
throw new SkipException("Skipping testSubmitEcho because we are in pipeline test dry run mode");
|
||||
}
|
||||
|
||||
String queue = "hour";
|
||||
File outFile = tryCreateNetworkTempFile("LibBatIntegrationTest.out");
|
||||
File outFile = tryCreateNetworkTempFile("LibBatPipelineTest.out");
|
||||
|
||||
submit req = new submit();
|
||||
|
||||
for (int i = 0; i < LibLsf.LSF_RLIM_NLIMITS; i++)
|
||||
req.rLimits[i] = LibLsf.DEFAULT_RLIMIT;
|
||||
|
||||
req.projectName = "LibBatIntegrationTest";
|
||||
req.projectName = "LibBatPipelineTest";
|
||||
req.options |= LibBat.SUB_PROJECT_NAME;
|
||||
|
||||
req.queue = queue;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,6 @@ object PipelineTest extends BaseTest with Logging {
|
|||
private val validationReportsDataLocation = "/humgen/gsa-hpprojects/GATK/validationreports/submitted/"
|
||||
private val md5DB = new MD5DB()
|
||||
|
||||
final val run = System.getProperty("pipeline.run") == "run"
|
||||
|
||||
final val allJobRunners = {
|
||||
val commandLinePluginManager = new CommandLinePluginManager
|
||||
commandLinePluginManager.getPlugins.map(commandLinePluginManager.getName(_)).toSeq
|
||||
|
|
@ -100,7 +98,7 @@ object PipelineTest extends BaseTest with Logging {
|
|||
Assert.fail("PipelineTestSpec.name is null")
|
||||
println(Utils.dupString('-', 80));
|
||||
executeTest(name, pipelineTest.args, pipelineTest.jobQueue, pipelineTest.expectedException, jobRunner)
|
||||
if (run) {
|
||||
if (BaseTest.pipelineTestRunModeIsSet) {
|
||||
assertMatchingMD5s(name, pipelineTest.fileMD5s.map{case (file, md5) => new File(runDir(name, jobRunner), file) -> md5}, pipelineTest.parameterize)
|
||||
if (pipelineTest.evalSpec != null)
|
||||
validateEval(name, pipelineTest.evalSpec, jobRunner)
|
||||
|
|
@ -169,7 +167,7 @@ object PipelineTest extends BaseTest with Logging {
|
|||
if (jobQueue != null)
|
||||
command = Utils.appendArray(command, "-jobQueue", jobQueue)
|
||||
|
||||
if (run)
|
||||
if (BaseTest.pipelineTestRunModeIsSet)
|
||||
command = Utils.appendArray(command, "-run")
|
||||
|
||||
// run the executable
|
||||
|
|
|
|||
Loading…
Reference in New Issue