public void printOutTopTwoPercentHighestDurationTestClasses() { System.out.println("\n-- LONGEST RUNNING CLASSES --"); for (int i = 0; i < ((double) allTestClassesSortedByDuration.size() * 0.02); i++) { AgileTestingTestClass bambooTestClass = allTestClassesSortedByDuration.get(i); String durationMessage = "(" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForAllPlans()), 2) + " min) "; PrintTools.info(this, "Class in top 2% longest: " + durationMessage + bambooTestClass.getTestClassSimpleName()); } }
public void generateAllTestSuites() { double totalDuration = 0.0; for (AgileTestingProject bambooEnabledProject : nameToProjectMap.values()) { bambooEnabledProject.generateAllTestSuites(); totalDuration += bambooEnabledProject.getFastTotalDuration(); } PrintTools.info(this, "Fast total duration: " + new DecimalFormat("0.0").format(Conversions.secondsToMinutes(totalDuration)) + " minutes."); workspace.buildMaps(); }
public void generateAllTestSuites() { double totalDuration = 0.0; for (AgileTestingProject bambooEnabledProject : nameToProjectMap.values()) { bambooEnabledProject.generateAllTestSuites(); totalDuration += bambooEnabledProject.getFastTotalDuration(); } PrintTools.info(this, "Fast total duration: " + new DecimalFormat("0.0").format(Conversions.secondsToMinutes(totalDuration)) + " minutes."); workspace.buildMaps(); }
public void printOutTopOnePercentHighestDurationTests() { System.out.println("\n-- LONGEST RUNNING TESTS --"); for (int i = 0; i < ((double) allTestsSortedByDuration.size() * 0.01); i++) { AgileTestingTestMethod bambooTestMethod = allTestsSortedByDuration.get(i); String durationMessage = "(" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestMethod.getDuration()), 2) + " min) "; PrintTools.info(this, "Test in top 1% longest: " + durationMessage + bambooTestMethod.getTestClassSimpleName() + ":" + bambooTestMethod.getMethodName()); } }
public void generateAllTestSuites() { agileTestingProject.generateAllTestSuites(); double totalDuration = agileTestingProject.getFastTotalDuration(); PrintTools.info(this, "Fast total duration: " + new DecimalFormat("0.0").format(Conversions.secondsToMinutes(totalDuration)) + " minutes."); buildMaps(); }
public void printOutTopTwoPercentHighestDurationTestClasses() { ArrayList<AgileTestingTestClass> allTestClassesSortedByDuration = workspace.getAllTestClassesSortedByDuration(); System.out.println("\n-- LONGEST RUNNING CLASSES --"); for (int i = 0; i < ((double) allTestClassesSortedByDuration.size() * 0.02); i++) { AgileTestingTestClass bambooTestClass = allTestClassesSortedByDuration.get(i); String durationMessage = "(" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForAllPlans()), 2) + " min) "; PrintTools.info(this, "Class in top 2% longest: " + durationMessage + bambooTestClass.getTestClassSimpleName()); } }
public void sortAndPrintSuiteDurationsByPlanType() { for (IntegrationCategory bambooPlanType : IntegrationCategory.includedCategories) { System.out.println("\n-- SORTED TESTS FOR " + bambooPlanType.getName().toUpperCase() + " --"); for (AgileTestingTestSuiteFile bambooTestSuiteFile : sortedTestSuitesByDurationMap.get(bambooPlanType)) { PrintTools.info(this, bambooTestSuiteFile.getPlanShortName() + ": " + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestSuiteFile.getDuration()), 2) + " m"); } } }
public void printOutTopTwoPercentHighestDurationTestClasses() { ArrayList<AgileTestingTestClass> allTestClassesSortedByDuration = workspace.getAllTestClassesSortedByDuration(); System.out.println("\n-- LONGEST RUNNING CLASSES --"); for (int i = 0; i < ((double) allTestClassesSortedByDuration.size() * 0.02); i++) { AgileTestingTestClass bambooTestClass = allTestClassesSortedByDuration.get(i); String durationMessage = "(" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForAllPlans()), 2) + " min) "; PrintTools.info(this, "Class in top 2% longest: " + durationMessage + bambooTestClass.getTestClassSimpleName()); } }
public void generateSpecificTestSuites(Set<String> projectNameWhiteList) { double totalDuration = 0.0; for (AgileTestingProject bambooEnabledProject : nameToProjectMap.values()) { if (projectNameWhiteList.contains(bambooEnabledProject.getRawProjectName()) || projectNameWhiteList.contains(bambooEnabledProject.getModifiedProjectName())) { bambooEnabledProject.generateAllTestSuites(); totalDuration += bambooEnabledProject.getFastTotalDuration(); } } PrintTools.info(this, "Fast total duration: " + new DecimalFormat("0.0").format(Conversions.secondsToMinutes(totalDuration)) + " minutes."); workspace.buildMaps(); }
public void generateSpecificTestSuites(Set<String> projectNameWhiteList) { double totalDuration = 0.0; for (AgileTestingProject bambooEnabledProject : nameToProjectMap.values()) { if (projectNameWhiteList.contains(bambooEnabledProject.getRawProjectName()) || projectNameWhiteList.contains(bambooEnabledProject.getModifiedProjectName())) { bambooEnabledProject.generateAllTestSuites(); totalDuration += bambooEnabledProject.getFastTotalDuration(); } } PrintTools.info(this, "Fast total duration: " + new DecimalFormat("0.0").format(Conversions.secondsToMinutes(totalDuration)) + " minutes."); workspace.buildMaps(); }
public void printOutTopOnePercentHighestDurationTests() { ArrayList<AgileTestingTestMethod> allTestsSortedByDuration = workspace.getAllTestsSortedByDuration(); System.out.println("\n-- LONGEST RUNNING TESTS --"); for (int i = 0; i < ((double) allTestsSortedByDuration.size() * 0.01); i++) { AgileTestingTestMethod bambooTestMethod = allTestsSortedByDuration.get(i); String durationMessage = "(" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestMethod.getDuration()), 2) + " min) "; PrintTools.info(this, "Test in top 1% longest: " + durationMessage + bambooTestMethod.getTestClassSimpleName() + ":" + bambooTestMethod.getMethodName()); } }
public void printOutTopOnePercentHighestDurationTests() { ArrayList<AgileTestingTestMethod> allTestsSortedByDuration = workspace.getAllTestsSortedByDuration(); System.out.println("\n-- LONGEST RUNNING TESTS --"); for (int i = 0; i < ((double) allTestsSortedByDuration.size() * 0.01); i++) { AgileTestingTestMethod bambooTestMethod = allTestsSortedByDuration.get(i); String durationMessage = "(" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestMethod.getDuration()), 2) + " min) "; PrintTools.info(this, "Test in top 1% longest: " + durationMessage + bambooTestMethod.getTestClassSimpleName() + ":" + bambooTestMethod.getMethodName()); } }
public void sortAndPrintSuiteDurationsByPlanType() { Map<IntegrationCategory, ArrayList<AgileTestingTestSuiteFile>> sortedTestSuitesByDurationMap = workspace.getSortedTestSuitesByDurationMap(); for (IntegrationCategory bambooPlanType : IntegrationCategory.includedCategories) { System.out.println("\n-- SORTED TESTS FOR " + bambooPlanType.getName().toUpperCase() + " --"); for (AgileTestingTestSuiteFile bambooTestSuiteFile : sortedTestSuitesByDurationMap.get(bambooPlanType)) { PrintTools.info(this, bambooTestSuiteFile.getPlanShortName() + ": " + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestSuiteFile.getDuration()), 2) + " m"); } } }
public void sortAndPrintSuiteDurationsByPlanType() { Map<IntegrationCategory, ArrayList<AgileTestingTestSuiteFile>> sortedTestSuitesByDurationMap = workspace.getSortedTestSuitesByDurationMap(); for (IntegrationCategory bambooPlanType : IntegrationCategory.includedCategories) { System.out.println("\n-- SORTED TESTS FOR " + bambooPlanType.getName().toUpperCase() + " --"); for (AgileTestingTestSuiteFile bambooTestSuiteFile : sortedTestSuitesByDurationMap.get(bambooPlanType)) { PrintTools.info(this, bambooTestSuiteFile.getPlanShortName() + ": " + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestSuiteFile.getDuration()), 2) + " m"); } } }
private void processLoadBalancedTests(boolean generateTestSuites) { for (Character letter : loadBalancedTests.keySet()) { String testSuiteSimpleName = bambooEnabledProject.getModifiedProjectName() + letter + bambooPlanType.getName() + "TestSuite"; Path suitePath = bambooEnabledProject.getGeneratedTestSuitesDirectory().resolve(testSuiteSimpleName + ".java"); String packageName = bambooEnabledProject.getPackageName(); List<Path> testPathsToPutInTestSuite = loadBalancedTests.get(letter); double durationInMinutes = Conversions.secondsToMinutes(loadBalancedDurations.get(letter)); String formattedDuration = new DecimalFormat("0.0").format(durationInMinutes); String planShortName = testSuiteSimpleName.replaceAll("TestSuite", ""); AgileTestingTestSuiteFile bambooTestSuiteFile = new AgileTestingTestSuiteFile(suitePath, bambooPlanType, planShortName, loadBalancedDurations.get(letter)); testSuiteFiles.add(bambooTestSuiteFile); if (generateTestSuites) { PrintTools.info(this, "Generating: " + "(" + formattedDuration + " min) " + planShortName); bambooTestSuiteFile.generateTestSuite(testSuiteSimpleName, packageName, testPathsToPutInTestSuite); } else { PrintTools.info(this, "Loading: " + "(" + formattedDuration + " min) " + planShortName); } } }
private void processLoadBalancedTests(boolean generateTestSuites) { for (String letter : loadBalancedTests.keySet()) { String testSuiteSimpleName = bambooEnabledProject.getModifiedProjectName() + letter + bambooPlanType.getName() + "TestSuite"; Path suitePath = bambooEnabledProject.getGeneratedTestSuitesDirectory().resolve(testSuiteSimpleName + ".java"); String packageName = bambooEnabledProject.getPackageName(); List<Path> testPathsToPutInTestSuite = loadBalancedTests.get(letter); double durationInMinutes = Conversions.secondsToMinutes(loadBalancedDurations.get(letter)); String formattedDuration = new DecimalFormat("0.0").format(durationInMinutes); String planShortName = testSuiteSimpleName.replaceAll("TestSuite", ""); AgileTestingTestSuiteFile bambooTestSuiteFile = new AgileTestingTestSuiteFile(suitePath, bambooPlanType, planShortName, loadBalancedDurations.get(letter)); testSuiteFiles.add(bambooTestSuiteFile); if (generateTestSuites) { PrintTools.info(this, "Generating: " + "(" + formattedDuration + " min) " + planShortName); bambooTestSuiteFile.generateTestSuite(testSuiteSimpleName, packageName, testPathsToPutInTestSuite); } else { PrintTools.info(this, "Loading: " + "(" + formattedDuration + " min) " + planShortName); } } }
public void add(AgileTestingTestClass bambooTestClass) { if (bambooPlanType == IntegrationCategory.FAST && bambooTestClass.getTotalDurationForTarget(bambooPlanType) > AgileTestingAnnotationTools.JOB_DURATION_CAP) { PrintTools.warn(this, "classTotalDuration > JOB_DURATION_CAP in Fast: " + bambooTestClass.getTestClassSimpleName() + " (" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForTarget(bambooPlanType)), 2) + " m)"); } if (bambooPlanType == IntegrationCategory.SLOW && bambooTestClass.getTotalDurationForTarget(bambooPlanType) < AgileTestingAnnotationTools.RECOMMENDED_CLASS_CAP) { PrintTools.warn(this, "classTotalDuration < RECOMMENDED_CLASS_CAP in Slow. Consider moving to Fast: " + bambooTestClass.getTestClassSimpleName() + " (" + MathTools.roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForTarget(bambooPlanType)), 2) + " m)"); } if (loadBalancedDurations.get(currentLetter) != null && (loadBalancedDurations.get(currentLetter) + bambooTestClass.getTotalDurationForTarget(bambooPlanType)) > AgileTestingAnnotationTools.JOB_DURATION_CAP) { currentLetter++; } addTestClassToCurrentLetterJob(bambooTestClass); }
public void add(AgileTestingTestClass bambooTestClass) { if (bambooPlanType == IntegrationCategory.FAST && bambooTestClass.getTotalDurationForTarget(bambooPlanType) > Conversions .minutesToSeconds(bambooEnabledProject.getConfiguration().getMaximumSuiteDuration())) { PrintTools.warn(this, "classTotalDuration > MAXIMUM_SUITE_DURATION in Fast: " + bambooTestClass.getTestClassSimpleName() + " (" + MathTools .roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForTarget(bambooPlanType)), 2) + " m)"); } if (bambooPlanType == IntegrationCategory.SLOW && bambooTestClass.getTotalDurationForTarget(bambooPlanType) < Conversions .minutesToSeconds(bambooEnabledProject.getConfiguration().getRecommendedTestClassDuration())) { PrintTools.warn(this, "classTotalDuration < RECOMMENDED_TEST_CLASS_DURATION in Slow. Consider moving to Fast: " + bambooTestClass.getTestClassSimpleName() + " (" + MathTools .roundToSignificantFigures(Conversions.secondsToMinutes(bambooTestClass.getTotalDurationForTarget(bambooPlanType)), 2) + " m)"); } if (loadBalancedDurations.containsKey(currentLetter) && (loadBalancedDurations.get(currentLetter) + bambooTestClass.getTotalDurationForTarget(bambooPlanType)) > Conversions .minutesToSeconds(bambooEnabledProject.getConfiguration().getMaximumSuiteDuration())) { currentLetter = incrementCurrentLetter(currentLetter); } addTestClassToCurrentLetterJob(bambooTestClass); }