Skip to content

🐞: No execution info when running tests via JUnit5 Launcher API #1153

@korpus95

Description

@korpus95

What happened?

I run tests this way, but the results show an incomplete report, there is no data with annotations @step and @attachment

private static void executeTest(String testIdentifier) {
        LauncherDiscoveryRequest request;

        if (testIdentifier.contains("#")) {
            request = LauncherDiscoveryRequestBuilder.request()
                    .selectors(selectMethod(testIdentifier))
                    .build();
        } else {
            request = LauncherDiscoveryRequestBuilder.request()
                    .selectors(selectClass(testIdentifier))
                    .build();
        }
        System.setProperty("allure.results.directory", "target/test-result/allure-results");
        System.setProperty("junit.jupiter.extensions.autodetection.enabled", "true");

        LauncherConfig launcherConfig = LauncherConfig.builder()
                .enableTestExecutionListenerAutoRegistration(true)
                .build();

        SummaryGeneratingListener summaryGeneratingListener = new SummaryGeneratingListener();

        try (LauncherSession session = LauncherFactory.openSession(launcherConfig)) {
            Launcher launcher = session.getLauncher();
            launcher.registerTestExecutionListeners(summaryGeneratingListener);
            TestPlan testPlan = launcher.discover(request);
            launcher.execute(testPlan);
        }
    }

Can this be fixed?

What Allure Integration are you using?

allure-junit5

What version of Allure Integration you are using?

2.29.0

What version of Allure Report you are using?

2.29.0

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions