Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix displaying of ignore reasons for test methods in allure report #145

Closed
oomelianchuk opened this issue Oct 1, 2020 · 4 comments
Closed
Assignees
Labels
bug codeDone The issue is rechecked for development branch codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there High Priority
Milestone

Comments

@oomelianchuk
Copy link
Contributor

There is an option to add a description to org.junit.@Ignore to make Allure display a reason for test ignorance, like this:
@Ignore("not implemented yet")/@Ignore("it's possible to add property with missing key")

so that allure report looks like this for the class:
ignore_allure_class

and for the method:
ignore_allure_test

Currently, this works only for class level and a test method annotated in the named above way will still be displayed as:
ignore_allure_test_without_reason

This behavior can be caused by overriding the describeChild method of BlockJUnit4ClassRunner in the NeodymiumRunner. The method from Neodymium doesn't pass test method annotations to the description, which makes it impossible for allure to figure out the ignorance reason.

@oomelianchuk
Copy link
Contributor Author

oomelianchuk commented Oct 1, 2020

The issue can probably be fixed by editing the describeChild method to match the following code:

    @Override
    protected Description describeChild(FrameworkMethod method)
    {
        return childDescriptions.computeIfAbsent(method, (m) -> {
            return Description.createTestDescription(getTestClass().getJavaClass(), m.getName(), method.getAnnotations());
        });
    }

@occupant23
Copy link
Contributor

added the fix

occupant23 pushed a commit that referenced this issue Oct 13, 2020
occupant23 pushed a commit that referenced this issue Oct 14, 2020
@occupant23 occupant23 added the codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there label Oct 16, 2020
@occupant23
Copy link
Contributor

@oomelianchuk and @h-arlt : Can be recheck.

@h-arlt
Copy link
Contributor

h-arlt commented Oct 19, 2020

Works as desired.

@h-arlt h-arlt added the codeDone The issue is rechecked for development branch label Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug codeDone The issue is rechecked for development branch codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there High Priority
Projects
None yet
Development

No branches or pull requests

3 participants