use of org.apache.hive.ptest.execution.conf.UnitTestBatch in project hive by apache.
the class TestExecutionPhase method setupUnitTest.
private void setupUnitTest(int nTests) throws Exception {
List<String> testList = new ArrayList<>();
for (int i = 0; i < nTests; i++) {
testList.add("TestClass-" + i);
}
testBatch = new UnitTestBatch(new AtomicInteger(1), "testcase", testList, "fakemodule", false);
testBatches = Collections.singletonList(testBatch);
}
use of org.apache.hive.ptest.execution.conf.UnitTestBatch in project hive by apache.
the class TestExecutionPhase method setupUnitTest.
private void setupUnitTest() throws Exception {
testBatch = new UnitTestBatch(new AtomicInteger(1), "testcase", Arrays.asList(DRIVER), "fakemodule", false);
testBatches = Collections.singletonList(testBatch);
}
use of org.apache.hive.ptest.execution.conf.UnitTestBatch in project hive by apache.
the class TestHostExecutor method setup.
@Before
public void setup() throws Exception {
baseDir = AbstractTestPhase.createBaseDir(getClass().getSimpleName());
logDir = Dirs.create(new File(baseDir, "logs"));
scratchDir = Dirs.create(new File(baseDir, "scratch"));
succeededLogDir = Dirs.create(new File(logDir, "succeeded"));
failedLogDir = Dirs.create(new File(logDir, "failed"));
parallelWorkQueue = new LinkedBlockingQueue<TestBatch>();
isolatedWorkQueue = new LinkedBlockingQueue<TestBatch>();
failedTestResults = Sets.newHashSet();
AtomicInteger unitTestBatchCounter = new AtomicInteger(1);
testBatchParallel1 = new UnitTestBatch(unitTestBatchCounter, "testcase", Arrays.asList(DRIVER_PARALLEL_1), "fakeModule1", true);
testBatchParallel2 = new UnitTestBatch(unitTestBatchCounter, "testcase", Arrays.asList(DRIVER_PARALLEL_2), "fakeModule2", true);
testBatchIsolated1 = new UnitTestBatch(unitTestBatchCounter, "testcase", Arrays.asList(DRIVER_ISOLATED_1), "fakeModule3", false);
testBatchIsolated2 = new UnitTestBatch(unitTestBatchCounter, "testcase", Arrays.asList(DRIVER_ISOLATED_2), "fakeModule4", false);
executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(2));
localCommandFactory = new MockLocalCommandFactory(LOG);
localCommand = mock(LocalCommand.class);
localCommandFactory.setInstance(localCommand);
sshCommandExecutor = spy(new MockSSHCommandExecutor(LOG));
rsyncCommandExecutor = spy(new MockRSyncCommandExecutor(LOG));
logger = LOG;
templateDefaults = ImmutableMap.<String, String>builder().put("localDir", LOCAL_DIR).put("workingDir", WORKING_DIR).put("instanceName", INSTANCE_NAME).put("branch", BRANCH).put("logDir", logDir.getAbsolutePath()).put("repository", REPOSITORY).put("repositoryName", REPOSITORY_NAME).build();
host = new Host(HOST, USER, new String[] { LOCAL_DIR }, 2);
}
Aggregations