use of org.apache.hive.ptest.api.server.TestLogger in project hive by apache.
the class JIRAService method main.
public static void main(String[] args) throws Exception {
CommandLine cmd = null;
try {
cmd = parseCommandLine(args);
} catch (ParseException e) {
System.out.println("Error parsing command arguments: " + e.getMessage());
System.exit(1);
}
// If null is returned, then help message was displayed in parseCommandLine method
if (cmd == null) {
System.exit(0);
}
Map<String, Object> jsonValues = parseJsonFile(cmd.getOptionValue(OPT_FILE_LONG));
Map<String, String> context = Maps.newHashMap();
context.put(FIELD_JIRA_URL, (String) jsonValues.get(FIELD_JIRA_URL));
context.put(FIELD_JIRA_USER, cmd.getOptionValue(OPT_USER_LONG));
context.put(FIELD_JIRA_PASS, cmd.getOptionValue(OPT_PASS_LONG));
context.put(FIELD_LOGS_URL, (String) jsonValues.get(FIELD_LOGS_URL));
context.put(FIELD_REPO, (String) jsonValues.get(FIELD_REPO));
context.put(FIELD_REPO_NAME, (String) jsonValues.get(FIELD_REPO_NAME));
context.put(FIELD_REPO_TYPE, (String) jsonValues.get(FIELD_REPO_TYPE));
context.put(FIELD_REPO_BRANCH, (String) jsonValues.get(FIELD_REPO_BRANCH));
context.put(FIELD_JENKINS_URL, (String) jsonValues.get(FIELD_JENKINS_URL));
TestLogger logger = new TestLogger(System.err, TestLogger.LEVEL.TRACE);
TestConfiguration configuration = new TestConfiguration(new Context(context), logger);
configuration.setJiraName((String) jsonValues.get(FIELD_JIRA_NAME));
configuration.setPatch((String) jsonValues.get(FIELD_PATCH_URL));
JIRAService service = new JIRAService(logger, configuration, (String) jsonValues.get(FIELD_BUILD_TAG));
List<String> messages = (List) jsonValues.get(FIELD_MESSAGES);
SortedSet<String> failedTests = (SortedSet) jsonValues.get(FIELD_FAILED_TESTS);
boolean error = (Integer) jsonValues.get(FIELD_BUILD_STATUS) == 0 ? false : true;
service.postComment(error, (Integer) jsonValues.get(FIELD_NUM_TESTS_EXECUTED), failedTests, messages);
}
use of org.apache.hive.ptest.api.server.TestLogger in project hive by apache.
the class AbstractTestPhase method initialize.
public void initialize(String name) throws Exception {
baseDir = createBaseDir(name);
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"));
executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(2));
executionContext = mock(ExecutionContext.class);
hostExecutorBuilder = mock(HostExecutorBuilder.class);
localCommandFactory = new MockLocalCommandFactory(LOG);
localCommand = mock(LocalCommand.class);
localCommandFactory.setInstance(localCommand);
sshCommandExecutor = spy(new MockSSHCommandExecutor(LOG));
rsyncCommandExecutor = spy(new MockRSyncCommandExecutor(LOG));
logger = new TestLogger(System.err, TestLogger.LEVEL.TRACE);
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