Search in sources :

Example 1 with UnitTestBatch

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);
}
Also used : UnitTestBatch(org.apache.hive.ptest.execution.conf.UnitTestBatch) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ArrayList(java.util.ArrayList)

Example 2 with UnitTestBatch

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);
}
Also used : UnitTestBatch(org.apache.hive.ptest.execution.conf.UnitTestBatch) AtomicInteger(java.util.concurrent.atomic.AtomicInteger)

Example 3 with UnitTestBatch

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);
}
Also used : UnitTestBatch(org.apache.hive.ptest.execution.conf.UnitTestBatch) UnitTestBatch(org.apache.hive.ptest.execution.conf.UnitTestBatch) TestBatch(org.apache.hive.ptest.execution.conf.TestBatch) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Host(org.apache.hive.ptest.execution.conf.Host) File(java.io.File) Before(org.junit.Before)

Aggregations

AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 UnitTestBatch (org.apache.hive.ptest.execution.conf.UnitTestBatch)3 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Host (org.apache.hive.ptest.execution.conf.Host)1 TestBatch (org.apache.hive.ptest.execution.conf.TestBatch)1 Before (org.junit.Before)1