Update integration test system to allow us to differentiate between testing data and cpu parallelism
This commit is contained in:
parent
9bf1d138d9
commit
225f3a0ebe
|
|
@ -40,13 +40,13 @@ import org.broadinstitute.sting.utils.collections.Pair;
|
||||||
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
||||||
import org.broadinstitute.sting.utils.exceptions.StingException;
|
import org.broadinstitute.sting.utils.exceptions.StingException;
|
||||||
import org.broadinstitute.sting.utils.variantcontext.VariantContextTestProvider;
|
import org.broadinstitute.sting.utils.variantcontext.VariantContextTestProvider;
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
|
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.AfterSuite;
|
import org.testng.annotations.AfterSuite;
|
||||||
import org.testng.annotations.BeforeMethod;
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.PrintStream;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
@ -251,20 +251,43 @@ public class WalkerTest extends BaseTest {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Pair<List<File>, List<String>> executeTestParallel(final String name, WalkerTestSpec spec) {
|
public enum ParallelTestType {
|
||||||
return executeTest(name, spec, Arrays.asList(1, 4));
|
TREE_REDUCIBLE,
|
||||||
|
NANO_SCHEDULED,
|
||||||
|
BOTH
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Pair<List<File>, List<String>> executeTest(final String name, WalkerTestSpec spec, List<Integer> parallelThreads) {
|
protected Pair<List<File>, List<String>> executeTestParallel(final String name, WalkerTestSpec spec, ParallelTestType testType) {
|
||||||
|
final List<Integer> ntThreads = testType == ParallelTestType.TREE_REDUCIBLE || testType == ParallelTestType.BOTH ? Arrays.asList(1, 4) : Collections.<Integer>emptyList();
|
||||||
|
final List<Integer> cntThreads = testType == ParallelTestType.NANO_SCHEDULED || testType == ParallelTestType.BOTH ? Arrays.asList(1, 4) : Collections.<Integer>emptyList();
|
||||||
|
|
||||||
|
return executeTest(name, spec, ntThreads, cntThreads);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Pair<List<File>, List<String>> executeTestParallel(final String name, WalkerTestSpec spec) {
|
||||||
|
return executeTestParallel(name, spec, ParallelTestType.BOTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Pair<List<File>, List<String>> executeTest(final String name, WalkerTestSpec spec, List<Integer> ntThreads, List<Integer> cpuThreads) {
|
||||||
String originalArgs = spec.args;
|
String originalArgs = spec.args;
|
||||||
Pair<List<File>, List<String>> results = null;
|
Pair<List<File>, List<String>> results = null;
|
||||||
|
|
||||||
for ( int nt : parallelThreads ) {
|
boolean ran1 = false;
|
||||||
|
for ( int nt : ntThreads ) {
|
||||||
String extra = nt == 1 ? "" : (" -nt " + nt);
|
String extra = nt == 1 ? "" : (" -nt " + nt);
|
||||||
|
ran1 = ran1 || nt == 1;
|
||||||
spec.args = originalArgs + extra;
|
spec.args = originalArgs + extra;
|
||||||
results = executeTest(name + "-nt-" + nt, spec);
|
results = executeTest(name + "-nt-" + nt, spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for ( int cnt : cpuThreads ) {
|
||||||
|
if ( cnt != 1 ) {
|
||||||
|
String extra = " -cnt " + cnt;
|
||||||
|
spec.args = originalArgs + extra;
|
||||||
|
results = executeTest(name + "-cnt-" + cnt, spec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue