io.qameta.allure.core.Configuration Java Examples

The following examples show how to use io.qameta.allure.core.Configuration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Allure1Plugin.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@Override
public void readResults(final Configuration configuration,
                        final ResultsVisitor visitor,
                        final Path resultsDirectory) {
    final Properties allureProperties = loadAllureProperties(resultsDirectory);
    final RandomUidContext context = configuration.requireContext(RandomUidContext.class);

    final Map<String, String> environment = processEnvironment(resultsDirectory);
    getStreamOfAllure1Results(resultsDirectory).forEach(testSuite -> testSuite.getTestCases()
            .forEach(testCase -> {
                convert(context.getValue(), resultsDirectory, visitor, testSuite, testCase, allureProperties);
                getEnvironmentParameters(testCase).forEach(param ->
                        environment.put(param.getName(), param.getValue())
                );
            })
    );

    visitor.visitExtra(ENVIRONMENT_BLOCK_NAME, environment);
}
 
Example #2
Source File: HistoryTrendPluginTest.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@Test
void shouldProcessCorruptedData(@TempDir final Path resultsDirectory) throws Exception {
    final Path history = Files.createDirectories(resultsDirectory.resolve("history"));
    Files.createFile(history.resolve("history-trend.json"));

    final Configuration configuration = mock(Configuration.class);
    when(configuration.requireContext(JacksonContext.class))
            .thenReturn(new JacksonContext());

    final ResultsVisitor visitor = mock(ResultsVisitor.class);

    final HistoryTrendPlugin plugin = new HistoryTrendPlugin();
    plugin.readResults(configuration, visitor, resultsDirectory);

    final ArgumentCaptor<List<HistoryTrendItem>> captor = ArgumentCaptor.forClass(List.class);
    verify(visitor, times(1))
            .visitExtra(eq(HISTORY_TREND_BLOCK_NAME), captor.capture());

    assertThat(captor.getValue()).hasSize(0);
}
 
Example #3
Source File: DummyReportGenerator.java    From allure2 with Apache License 2.0 6 votes vote down vote up
/**
 * Generate Allure report data from directories with allure report results.
 *
 * @param args a list of directory paths. First (args.length - 1) arguments -
 *             results directories, last argument - the folder to generated data
 */
public static void main(final String... args) throws IOException {
    if (args.length < MIN_ARGUMENTS_COUNT) {
        LOGGER.error("There must be at least two arguments");
        return;
    }
    final int lastIndex = args.length - 1;
    final Path[] files = getFiles(args);
    final List<Plugin> plugins = loadPlugins();
    LOGGER.info("Found {} plugins", plugins.size());
    plugins.forEach(plugin -> LOGGER.info(plugin.getConfig().getName()));
    final Configuration configuration = new ConfigurationBuilder()
            .fromExtensions(EXTENSIONS)
            .fromPlugins(plugins)
            .build();
    final ReportGenerator generator = new ReportGenerator(configuration);
    generator.generate(files[lastIndex], Arrays.copyOf(files, lastIndex));
}
 
Example #4
Source File: HistoryTrendPluginTest.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Test
void shouldReadOldData(@TempDir final Path resultsDirectory) throws Exception {
    final Path history = Files.createDirectories(resultsDirectory.resolve("history"));
    final Path trend = history.resolve(JSON_FILE_NAME);
    TestData.unpackFile("history-trend-old.json", trend);

    final Configuration configuration = mock(Configuration.class);
    when(configuration.requireContext(JacksonContext.class))
            .thenReturn(new JacksonContext());

    final ResultsVisitor visitor = mock(ResultsVisitor.class);

    final HistoryTrendPlugin plugin = new HistoryTrendPlugin();
    plugin.readResults(configuration, visitor, resultsDirectory);

    final ArgumentCaptor<List<HistoryTrendItem>> captor = ArgumentCaptor.forClass(List.class);
    verify(visitor, times(1))
            .visitExtra(eq(HISTORY_TREND_BLOCK_NAME), captor.capture());

    assertThat(captor.getValue())
            .hasSize(4)
            .extracting(HistoryTrendItem::getStatistic)
            .extracting(Statistic::getTotal)
            .containsExactly(20L, 12L, 12L, 1L);
}
 
Example #5
Source File: IdeaLinksPluginTest.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@Test
void shouldExportTestResultToJira() {
    final LaunchResults launchResults = mock(LaunchResults.class);
    final TestResult testResult = new TestResult()
            .setLabels(Collections.singletonList(new Label().setName("testClass").setValue(TEST_CLASS)));

    final Set<TestResult> results = new HashSet<>(Collections.singletonList(testResult));
    when(launchResults.getAllResults()).thenReturn(results);

    final IdeaLinksPlugin jiraTestResultExportPlugin = new IdeaLinksPlugin(true, 63342);

    jiraTestResultExportPlugin.aggregate(
            mock(Configuration.class),
            Collections.singletonList(launchResults),
            Paths.get("/")
    );

    assertThat(testResult.getLinks()).hasSize(1);
    final Link link = testResult.getLinks().get(0);
    assertThat(link.getName()).isEqualTo("Open in Idea");
    assertThat(link.getType()).isEqualTo("idea");
    assertThat(link.getUrl()).contains(TEST_CLASS.replace(".", "/"));

}
 
Example #6
Source File: Allure1EnvironmentPluginTest.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@SafeVarargs
private final List<EnvironmentItem> process(List<String>... results) throws IOException {
    List<LaunchResults> launches = new ArrayList<>();
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    Allure1Plugin reader = new Allure1Plugin();
    for (List<String> result : results) {
        Path resultsDirectory = Files.createTempDirectory(temp, "results");
        Iterator<String> iterator = result.iterator();
        while (iterator.hasNext()) {
            String first = iterator.next();
            String second = iterator.next();
            copyFile(resultsDirectory, first, second);
        }
        final DefaultResultsVisitor resultsVisitor = new DefaultResultsVisitor(configuration);
        reader.readResults(configuration, resultsVisitor, resultsDirectory);
        launches.add(resultsVisitor.getLaunchResults());
    }
    Allure1EnvironmentPlugin envPlugin = new Allure1EnvironmentPlugin();
    return envPlugin.getData(launches);
}
 
Example #7
Source File: JiraExportPlugin.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@Override
public void aggregate(final Configuration configuration,
                      final List<LaunchResults> launchesResults,
                      final Path outputDirectory) {
    if (enabled) {
        final JiraService jiraService = jiraServiceSupplier.get();

        final List<String> issues = JiraExportUtils.splitByComma(this.issues);
        final ExecutorInfo executor = JiraExportUtils.getExecutor(launchesResults);
        final Statistic statisticToConvert = JiraExportUtils.getStatistic(launchesResults);
        final List<LaunchStatisticExport> statistic = JiraExportUtils.convertStatistics(statisticToConvert);
        final JiraLaunch launch = JiraExportUtils.getJiraLaunch(executor, statistic);
        exportLaunchToJira(jiraService, launch, issues);

        JiraExportUtils.getTestResults(launchesResults).stream()
                .map(testResult -> JiraExportUtils.getJiraTestResult(executor, testResult))
                .filter(Optional::isPresent)
                .map(Optional::get)
                .forEach(jiraTestResult -> {
                    JiraExportUtils.getTestResults(launchesResults)
                            .stream()
                            .forEach(testResult ->
                                    exportTestResultToJira(jiraService, jiraTestResult, testResult));
                });
    }
}
 
Example #8
Source File: CommonCsvExportAggregator.java    From allure2 with Apache License 2.0 6 votes vote down vote up
@Override
public void aggregate(final Configuration configuration,
                      final List<LaunchResults> launchesResults,
                      final Path outputDirectory) throws IOException {
    final Path dataFolder = Files.createDirectories(outputDirectory.resolve(Constants.DATA_DIR));
    final Path csv = dataFolder.resolve(fileName);

    try (Writer writer = Files.newBufferedWriter(csv)) {
        final StatefulBeanToCsvBuilder<T> builder = new StatefulBeanToCsvBuilder<>(writer);
        final CustomMappingStrategy<T> mappingStrategy = new CustomMappingStrategy<>();
        mappingStrategy.setType(type);
        final StatefulBeanToCsv<T> beanWriter = builder.withMappingStrategy(mappingStrategy).build();
        try {
            beanWriter.write(getData(launchesResults));
        } catch (Exception e) {
            throw new IOException(e);
        }
    }
}
 
Example #9
Source File: Commands.java    From allure2 with Apache License 2.0 6 votes vote down vote up
/**
 * Creates report configuration for a given profile.
 *
 * @param profile selected profile.
 * @return created report configuration.
 */
protected Configuration createReportConfiguration(final ConfigOptions profile) {
    final DefaultPluginLoader loader = new DefaultPluginLoader();
    final CommandlineConfig commandlineConfig = getConfig(profile);
    final ClassLoader classLoader = getClass().getClassLoader();
    final List<Plugin> plugins = commandlineConfig.getPlugins().stream()
            .map(name -> loader.loadPlugin(classLoader, allureHome.resolve("plugins").resolve(name)))
            .filter(Optional::isPresent)
            .map(Optional::get)
            .collect(Collectors.toList());

    return new ConfigurationBuilder()
            .useDefault()
            .fromPlugins(plugins)
            .build();
}
 
Example #10
Source File: EmptyResultsTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Test
void shouldAllowNonExistsResultsDirectory(@TempDir final Path temp) throws Exception {
    final Path resultsDirectory = temp.resolve("results");
    final Path outputDirectory = Files.createDirectories(temp.resolve("report"));
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    final ReportGenerator generator = new ReportGenerator(configuration);

    generator.generate(outputDirectory, resultsDirectory);
}
 
Example #11
Source File: XcTestPlugin.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readResults(final Configuration configuration,
                        final ResultsVisitor visitor,
                        final Path directory) {
    final List<Path> testSummaries = listSummaries(directory);
    testSummaries.forEach(summaryPath -> readSummaries(directory, summaryPath, visitor));
}
 
Example #12
Source File: EmptyResultsTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Test
void shouldAllowRegularFileAsResultsDirectory(@TempDir final Path temp) throws Exception {
    final Path resultsDirectory = Files.createTempFile(temp, "a", ".txt");
    final Path outputDirectory = Files.createDirectories(temp.resolve("report"));
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    final ReportGenerator generator = new ReportGenerator(configuration);

    generator.generate(outputDirectory, resultsDirectory);
}
 
Example #13
Source File: EmptyResultsTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Test
void shouldAllowEmptyResultsDirectory(@TempDir final Path temp) throws Exception {
    final Path resultsDirectory = Files.createDirectories(temp.resolve("results"));
    final Path outputDirectory = Files.createDirectories(temp.resolve("report"));
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    final ReportGenerator generator = new ReportGenerator(configuration);

    generator.generate(outputDirectory, resultsDirectory);
}
 
Example #14
Source File: Allure1PluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
private LaunchResults process(String... strings) throws IOException {
    Iterator<String> iterator = Arrays.asList(strings).iterator();
    while (iterator.hasNext()) {
        String first = iterator.next();
        String second = iterator.next();
        copyFile(directory, first, second);
    }
    Allure1Plugin reader = new Allure1Plugin();
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    final DefaultResultsVisitor resultsVisitor = new DefaultResultsVisitor(configuration);
    reader.readResults(configuration, resultsVisitor, directory);
    return resultsVisitor.getLaunchResults();
}
 
Example #15
Source File: ReportGeneratorTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@BeforeAll
static void setUp(@TempDir final Path temp) throws Exception {
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    final ReportGenerator generator = new ReportGenerator(configuration);
    output = temp.resolve("report");
    final Path resultsDirectory = Files.createDirectories(temp.resolve("results"));
    allure1data().forEach(resource -> unpackFile(
            "allure1data/" + resource,
            resultsDirectory.resolve(resource)
    ));
    generator.generate(output, resultsDirectory);
}
 
Example #16
Source File: HistoryTrendPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Test
void shouldReadNewData(@TempDir final Path resultsDirectory) throws Exception {
    final Path history = Files.createDirectories(resultsDirectory.resolve("history"));
    final Path trend = history.resolve(JSON_FILE_NAME);
    TestData.unpackFile("history-trend.json", trend);

    final Configuration configuration = mock(Configuration.class);
    when(configuration.requireContext(JacksonContext.class))
            .thenReturn(new JacksonContext());

    final ResultsVisitor visitor = mock(ResultsVisitor.class);

    final HistoryTrendPlugin plugin = new HistoryTrendPlugin();
    plugin.readResults(configuration, visitor, resultsDirectory);

    final ArgumentCaptor<List<HistoryTrendItem>> captor = ArgumentCaptor.forClass(List.class);
    verify(visitor, times(1))
            .visitExtra(eq(HISTORY_TREND_BLOCK_NAME), captor.capture());

    assertThat(captor.getValue())
            .hasSize(4)
            .extracting(HistoryTrendItem::getStatistic)
            .extracting(Statistic::getTotal)
            .containsExactly(20L, 12L, 12L, 1L);

    assertThat(captor.getValue())
            .hasSize(4)
            .extracting(HistoryTrendItem::getBuildOrder,
                    HistoryTrendItem::getReportName, HistoryTrendItem::getReportUrl)
            .containsExactly(
                    Tuple.tuple(7L, "some", "some/report#7"),
                    Tuple.tuple(6L, "some", "some/report#6"),
                    Tuple.tuple(5L, "some", "some/report#5"),
                    Tuple.tuple(4L, "some", "some/report#4")
            );
}
 
Example #17
Source File: Allure2PluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
private LaunchResults process(String... strings) throws IOException {
    Iterator<String> iterator = Arrays.asList(strings).iterator();
    while (iterator.hasNext()) {
        String first = iterator.next();
        String second = iterator.next();
        copyFile(directory, first, second);
    }
    Allure2Plugin reader = new Allure2Plugin();
    final Configuration configuration = new ConfigurationBuilder().useDefault().build();
    final DefaultResultsVisitor resultsVisitor = new DefaultResultsVisitor(configuration);
    reader.readResults(configuration, resultsVisitor, directory);
    return resultsVisitor.getLaunchResults();
}
 
Example #18
Source File: HistoryTrendPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Test
void shouldAggregateForEmptyReport(@TempDir final Path outputDirectory) throws Exception {
    final Configuration configuration = mock(Configuration.class);
    final JacksonContext context = mock(JacksonContext.class);
    final ObjectMapper mapper = mock(ObjectMapper.class);

    when(configuration.requireContext(JacksonContext.class))
            .thenReturn(context);

    when(context.getValue())
            .thenReturn(mapper);

    final HistoryTrendPlugin.JsonAggregator aggregator = new HistoryTrendPlugin.JsonAggregator();
    aggregator.aggregate(configuration, Collections.emptyList(), outputDirectory);

    final ArgumentCaptor<List<HistoryTrendItem>> captor = ArgumentCaptor.forClass(List.class);
    verify(mapper, times(1))
            .writeValue(any(OutputStream.class), captor.capture());

    assertThat(captor.getValue())
            .hasSize(1)
            .extracting(HistoryTrendItem::getStatistic)
            .extracting(Statistic::getTotal)
            .containsExactly(0L);

    assertThat(captor.getValue())
            .hasSize(1)
            .extracting(HistoryTrendItem::getBuildOrder,
                    HistoryTrendItem::getReportName, HistoryTrendItem::getReportUrl)
            .containsExactly(Tuple.tuple(null, null, null));

}
 
Example #19
Source File: HistoryPlugin.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readResults(final Configuration configuration,
                        final ResultsVisitor visitor,
                        final Path directory) {
    final JacksonContext context = configuration.requireContext(JacksonContext.class);
    final Path historyFile = directory.resolve(HISTORY_BLOCK_NAME).resolve(HISTORY_FILE_NAME);
    if (Files.exists(historyFile)) {
        try (InputStream is = Files.newInputStream(historyFile)) {
            final Map<String, HistoryData> history = context.getValue().readValue(is, HISTORY_TYPE);
            visitor.visitExtra(HISTORY_BLOCK_NAME, history);
        } catch (IOException e) {
            visitor.error("Could not read history file " + historyFile, e);
        }
    }
}
 
Example #20
Source File: XcTestPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@BeforeEach
void setUp(@TempDir final Path resultsDirectory) {
    configuration = mock(Configuration.class);
    when(configuration.requireContext(JacksonContext.class)).thenReturn(new JacksonContext());
    visitor = mock(ResultsVisitor.class);
    this.resultsDirectory = resultsDirectory;
}
 
Example #21
Source File: XunitXmlPlugin.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readResults(final Configuration configuration,
                        final ResultsVisitor visitor,
                        final Path directory) {
    final RandomUidContext context = configuration.requireContext(RandomUidContext.class);
    listResults(directory).forEach(result -> parseAssemblies(result, context, visitor));
}
 
Example #22
Source File: XunitXmlPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@BeforeEach
void setUp(@TempDir final Path resultsDirectory) {
    configuration = mock(Configuration.class);
    when(configuration.requireContext(RandomUidContext.class)).thenReturn(new RandomUidContext());
    visitor = mock(ResultsVisitor.class);
    this.resultsDirectory = resultsDirectory;
}
 
Example #23
Source File: TrxPlugin.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void readResults(final Configuration configuration,
                        final ResultsVisitor visitor,
                        final Path directory) {
    final RandomUidContext context = configuration.requireContext(RandomUidContext.class);
    listResults(directory).forEach(result -> parseTestRun(result, context, visitor));
}
 
Example #24
Source File: TrxPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@BeforeEach
void setUp(@TempDir final Path resultsDirectory) {
    configuration = mock(Configuration.class);
    when(configuration.requireContext(RandomUidContext.class)).thenReturn(new RandomUidContext());
    visitor = mock(ResultsVisitor.class);
    this.resultsDirectory = resultsDirectory;
}
 
Example #25
Source File: PackagesPlugin.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void aggregate(final Configuration configuration,
                      final List<LaunchResults> launchesResults,
                      final Path outputDirectory) throws IOException {
    final JacksonContext jacksonContext = configuration.requireContext(JacksonContext.class);
    final Path dataFolder = Files.createDirectories(outputDirectory.resolve("data"));
    final Path dataFile = dataFolder.resolve("packages.json");
    try (OutputStream os = Files.newOutputStream(dataFile)) {
        jacksonContext.getValue().writeValue(os, getData(launchesResults));
    }
}
 
Example #26
Source File: JiraLaunchExportPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Test
void shouldExportLaunchToJira() {
    final LaunchResults launchResults = mock(LaunchResults.class);
    final TestResult passed = createTestResult(Status.PASSED);
    final TestResult failed = createTestResult(Status.FAILED);
    final TestResult broken = createTestResult(Status.BROKEN);
    final TestResult skipped = createTestResult(Status.SKIPPED);
    final TestResult unknown = createTestResult(Status.UNKNOWN);

    final Set<TestResult> results = new HashSet<>(Arrays.asList(passed, failed, broken, skipped, unknown));
    when(launchResults.getAllResults()).thenReturn(results);
    final Statistic statistic = JiraExportUtils.getStatistic(Arrays.asList(launchResults));
    final List<LaunchStatisticExport> launchStatisticExports = JiraExportUtils.convertStatistics(statistic);

    final ExecutorInfo executorInfo = new ExecutorInfo()
            .setBuildName(RandomStringUtils.random(10))
            .setReportUrl(RandomStringUtils.random(10));
    when(launchResults.getExtra("executor")).thenReturn(Optional.of(executorInfo));
    final JiraService service = TestData.mockJiraService();
    final JiraExportPlugin jiraLaunchExportPlugin = new JiraExportPlugin(
            true,
            "ALLURE-1,ALLURE-2",
            () -> service
    );

    jiraLaunchExportPlugin.aggregate(
            mock(Configuration.class),
            Collections.singletonList(launchResults),
            Paths.get("/")
    );

    verify(service, times(1)).createJiraLaunch(any(JiraLaunch.class), anyList());

    verify(service).createJiraLaunch(argThat(launch -> executorInfo.getBuildName().equals(launch.getExternalId())), anyList());
    verify(service).createJiraLaunch(argThat(launch -> executorInfo.getReportUrl().equals(launch.getUrl())), anyList());
    verify(service).createJiraLaunch(argThat(launch -> launchStatisticExports.equals(launch.getStatistic())), anyList());
    verify(service).createJiraLaunch(argThat(launch -> executorInfo.getBuildName().equals(launch.getName())), anyList());
    verify(service).createJiraLaunch(any(JiraLaunch.class), argThat(issues -> !issues.isEmpty()));

}
 
Example #27
Source File: JunitXmlPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@BeforeEach
void setUp(@TempDir final Path resultsDirectory) {
    configuration = mock(Configuration.class);
    when(configuration.requireContext(RandomUidContext.class)).thenReturn(new RandomUidContext());
    visitor = mock(ResultsVisitor.class);
    this.resultsDirectory = resultsDirectory;
}
 
Example #28
Source File: XrayTestRunExportPlugin.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void aggregate(final Configuration configuration,
                      final List<LaunchResults> launchesResults,
                      final Path outputDirectory) {
    if (enabled) {
        updateTestRunStatuses(launchesResults);
    }
}
 
Example #29
Source File: XrayTestRunExportPluginTest.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Test
void shouldExportTestRunToXray() {
    final LaunchResults launchResults = mock(LaunchResults.class);
    final TestResult testResult = createTestResult(Status.FAILED)
            .setLinks(Collections.singletonList(new Link().setName(TESTRUN_KEY).setType("tms")));

    final Set<TestResult> results = new HashSet<>(Collections.singletonList(testResult));
    when(launchResults.getAllResults()).thenReturn(results);

    final ExecutorInfo executorInfo = new ExecutorInfo()
            .setBuildName(RandomStringUtils.random(10))
            .setReportUrl(RandomStringUtils.random(10));
    when(launchResults.getExtra("executor")).thenReturn(Optional.of(executorInfo));

    final JiraService service = mock(JiraService.class);
    when(service.getTestRunsForTestExecution(EXECUTION_ISSUES)).thenReturn(
            Collections.singletonList(new XrayTestRun().setId(TESTRUN_ID).setKey(TESTRUN_KEY).setStatus("TODO"))
    );

    final XrayTestRunExportPlugin xrayTestRunExportPlugin = new XrayTestRunExportPlugin(
            true,
            "ALLURE-2",
            Collections.emptyMap(),
            () -> service
    );

    xrayTestRunExportPlugin.aggregate(
            mock(Configuration.class),
            Collections.singletonList(launchResults),
            Paths.get("/")
    );

    final String reportLink = String.format("[%s|%s]", executorInfo.getBuildName(), executorInfo.getReportUrl());
    verify(service, times(1)).createIssueComment(
            argThat(issue -> issue.equals(EXECUTION_ISSUES)),
            argThat(comment -> comment.getBody().contains(reportLink)
            ));
    verify(service, times(1)).updateTestRunStatus(TESTRUN_ID, "FAIL");
}
 
Example #30
Source File: DummyReportGenerator.java    From allure2 with Apache License 2.0 5 votes vote down vote up
@Override
public void aggregate(final Configuration configuration,
                      final List<LaunchResults> launchesResults,
                      final Path outputDirectory) throws IOException {
    writePluginsStatic(configuration, outputDirectory);
    writeIndexHtml(configuration, outputDirectory);
}