Package org.apache.hive.ptest.execution.conf

Examples of org.apache.hive.ptest.execution.conf.TestConfiguration


                getGlobalLogDirectory(), test.getStartRequest().getTestHandle()));
            File logFile = new File(logDir, "execution.txt");
            test.setOutputFile(logFile);
            logStream = new PrintStream(logFile);
            logger = new TestLogger(logStream, TestLogger.LEVEL.DEBUG);
            TestConfiguration testConfiguration = TestConfiguration.fromFile(profileConfFile, logger);
            testConfiguration.setPatch(startRequest.getPatchURL());
            testConfiguration.setJiraName(startRequest.getJiraName());
            testConfiguration.setClearLibraryCache(startRequest.isClearLibraryCache());
            LocalCommandFactory localCommandFactory = new LocalCommandFactory(logger);
            PTest ptest = mPTestBuilder.build(testConfiguration, mExecutionContext,
                test.getStartRequest().getTestHandle(), logDir,
                localCommandFactory, new SSHCommandExecutor(logger),
                new RSyncCommandExecutor(logger, mExecutionContextConfiguration.getMaxRsyncThreads(),
View Full Code Here


    context.put("branch", "trunk");
    context.put("repository", "repo");
    context.put("repositoryName", "repoName");
    context.put("antArgs", "-Dsome=thing");
    context.put("logsURL", "http://ec2-174-129-184-35.compute-1.amazonaws.com/logs");
    TestConfiguration configuration = new TestConfiguration(new Context(context), logger);
    configuration.setJiraName("HIVE-4892");
    JIRAService service = new JIRAService(logger, configuration, "test-123");
    List<String> messages = Lists.newArrayList("msg1", "msg2");
    SortedSet<String> failedTests = Sets.newTreeSet(Collections.singleton("failed"));
    service.postComment(false, 5, failedTests, messages);
  }
View Full Code Here

    LogDirectoryCleaner cleaner = new LogDirectoryCleaner(new File(executionContextConfiguration.
        getGlobalLogDirectory()), 5);
    cleaner.setName("LogCleaner-" + executionContextConfiguration.getGlobalLogDirectory());
    cleaner.setDaemon(true);
    cleaner.start();
    TestConfiguration conf = TestConfiguration.fromFile(testConfigurationFile, LOG);
    String repository = Strings.nullToEmpty(commandLine.getOptionValue(REPOSITORY)).trim();
    if(!repository.isEmpty()) {
      conf.setRepository(repository);
    }
    String repositoryName = Strings.nullToEmpty(commandLine.getOptionValue(REPOSITORY_NAME)).trim();
    if(!repositoryName.isEmpty()) {
      conf.setRepositoryName(repositoryName);
    }
    String branch = Strings.nullToEmpty(commandLine.getOptionValue(BRANCH)).trim();
    if(!branch.isEmpty()) {
      conf.setBranch(branch);
    }
    String patch = Strings.nullToEmpty(commandLine.getOptionValue(PATCH)).trim();
    if(!patch.isEmpty()) {
      conf.setPatch(patch);
    }
    String javaHome = Strings.nullToEmpty(commandLine.getOptionValue(JAVA_HOME)).trim();
    if(!javaHome.isEmpty()) {
      conf.setJavaHome(javaHome);
    }
    String javaHomeForTests = Strings.nullToEmpty(commandLine.getOptionValue(JAVA_HOME_TEST)).trim();
    if(!javaHomeForTests.isEmpty()) {
      conf.setJavaHomeForTests(javaHomeForTests);
    }
    String antTestArgs = Strings.nullToEmpty(commandLine.getOptionValue(ANT_TEST_ARGS)).trim();
    if(!antTestArgs.isEmpty()) {
      conf.setAntTestArgs(antTestArgs);
    }
    String antEnvOpts = Strings.nullToEmpty(commandLine.getOptionValue(ANT_ENV_OPTS)).trim();
    if(!antEnvOpts.isEmpty()) {
      conf.setAntEnvOpts(antEnvOpts);
    }
    String antTestTarget = Strings.nullToEmpty(commandLine.getOptionValue(ANT_TEST_TARGET)).trim();
    if(!antTestTarget.isEmpty()) {
      conf.setAntTestTarget(antTestTarget);
    }
    String[] supplementalAntArgs = commandLine.getOptionValues(ANT_ARG);
    if(supplementalAntArgs != null && supplementalAntArgs.length > 0) {
      String antArgs = Strings.nullToEmpty(conf.getAntArgs());
      if(!(antArgs.isEmpty() || antArgs.endsWith(" "))) {
        antArgs += " ";
      }
      antArgs += "-" + ANT_ARG + Joiner.on(" -" + ANT_ARG).join(supplementalAntArgs);
      conf.setAntArgs(antArgs);
    }
    ExecutionContextProvider executionContextProvider = null;
    ExecutionContext executionContext = null;
    int exitCode = 0;
    try {
      executionContextProvider = executionContextConfiguration
          .getExecutionContextProvider();
      executionContext = executionContextProvider.createExecutionContext();
      LocalCommandFactory localCommandFactory = new LocalCommandFactory(LOG);
      PTest ptest = new PTest(conf, executionContext, buildTag, logDir,
          localCommandFactory, new SSHCommandExecutor(LOG, localCommandFactory, conf.getSshOpts()),
          new RSyncCommandExecutor(LOG, 10, localCommandFactory), LOG);
      exitCode = ptest.run();
    } finally {
      if(executionContext != null) {
        executionContext.terminate();
View Full Code Here

    context.put("jiraPassword", "password goes here");
    context.put("branch", "trunk");
    context.put("repository", "repo");
    context.put("repositoryName", "repoName");
    context.put("antArgs", "-Dsome=thing");
    TestConfiguration configuration = new TestConfiguration(new Context(context), logger);
    configuration.setJiraName("HIVE-4892");
    JIRAService service = new JIRAService(logger, configuration, "test-123");
    List<String> messages = Lists.newArrayList("msg1", "msg2");
    SortedSet<String> failedTests = Sets.newTreeSet(Collections.singleton("failed"));
    service.postComment(false, 5, failedTests, messages);
  }
View Full Code Here

                getGlobalLogDirectory(), test.getStartRequest().getTestHandle()));
            File logFile = new File(logDir, "execution.txt");
            test.setOutputFile(logFile);
            logStream = new PrintStream(logFile);
            logger = new TestLogger(logStream, TestLogger.LEVEL.DEBUG);
            TestConfiguration testConfiguration = TestConfiguration.fromFile(profileConfFile, logger);
            testConfiguration.setPatch(startRequest.getPatchURL());
            testConfiguration.setJiraName(startRequest.getJiraName());
            testConfiguration.setClearLibraryCache(startRequest.isClearLibraryCache());
            PTest ptest = mPTestBuilder.build(testConfiguration, mExecutionContext,
                test.getStartRequest().getTestHandle(), logDir,
                new LocalCommandFactory(logger), new SSHCommandExecutor(logger),
                new RSyncCommandExecutor(logger), logger);
            int result = ptest.run();
View Full Code Here

        LogDirectoryCleaner cleaner = new LogDirectoryCleaner(new File(executionContextConfiguration.
            getGlobalLogDirectory()), 5);
        cleaner.setName("LogCleaner-" + executionContextConfiguration.getGlobalLogDirectory());
        cleaner.setDaemon(true);
        cleaner.start();
        TestConfiguration conf = TestConfiguration.fromFile(testConfigurationFile, LOG);
        String repository = Strings.nullToEmpty(commandLine.getOptionValue(REPOSITORY)).trim();
        if(!repository.isEmpty()) {
          conf.setRepository(repository);
        }
        String repositoryName = Strings.nullToEmpty(commandLine.getOptionValue(REPOSITORY_NAME)).trim();
        if(!repositoryName.isEmpty()) {
          conf.setRepositoryName(repositoryName);
        }
        String branch = Strings.nullToEmpty(commandLine.getOptionValue(BRANCH)).trim();
        if(!branch.isEmpty()) {
          conf.setBranch(branch);
        }
        String patch = Strings.nullToEmpty(commandLine.getOptionValue(PATCH)).trim();
        if(!patch.isEmpty()) {
          conf.setPatch(patch);
        }
        String javaHome = Strings.nullToEmpty(commandLine.getOptionValue(JAVA_HOME)).trim();
        if(!javaHome.isEmpty()) {
          conf.setJavaHome(javaHome);
        }
        String javaHomeForTests = Strings.nullToEmpty(commandLine.getOptionValue(JAVA_HOME_TEST)).trim();
        if(!javaHomeForTests.isEmpty()) {
          conf.setJavaHomeForTests(javaHomeForTests);
        }
        String antTestArgs = Strings.nullToEmpty(commandLine.getOptionValue(ANT_TEST_ARGS)).trim();
        if(!antTestArgs.isEmpty()) {
          conf.setAntTestArgs(antTestArgs);
        }
        String antEnvOpts = Strings.nullToEmpty(commandLine.getOptionValue(ANT_ENV_OPTS)).trim();
        if(!antEnvOpts.isEmpty()) {
          conf.setAntEnvOpts(antEnvOpts);
        }
        String antTestTarget = Strings.nullToEmpty(commandLine.getOptionValue(ANT_TEST_TARGET)).trim();
        if(!antTestTarget.isEmpty()) {
          conf.setAntTestTarget(antTestTarget);
        }
        String[] supplementalAntArgs = commandLine.getOptionValues(ANT_ARG);
        if(supplementalAntArgs != null && supplementalAntArgs.length > 0) {
          String antArgs = Strings.nullToEmpty(conf.getAntArgs());
          if(!(antArgs.isEmpty() || antArgs.endsWith(" "))) {
            antArgs += " ";
          }
          antArgs += "-" + ANT_ARG + Joiner.on(" -" + ANT_ARG).join(supplementalAntArgs);
          conf.setAntArgs(antArgs);
        }
        ExecutionContextProvider executionContextProvider = null;
        ExecutionContext executionContext = null;
        int exitCode = 0;
        try {
View Full Code Here

TOP

Related Classes of org.apache.hive.ptest.execution.conf.TestConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.