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

Inherited test methods don't support their annotations. #2497

Closed
1 task done
ingvard opened this issue Apr 10, 2024 · 1 comment
Closed
1 task done

Inherited test methods don't support their annotations. #2497

ingvard opened this issue Apr 10, 2024 · 1 comment
Labels
triage type:bug Something isn't working

Comments

@ingvard
Copy link

ingvard commented Apr 10, 2024

Describe the Bug

The getTestMethod method in the io.qameta.allure.junitplatform.AllureJunitPlatformUtils class doesn't function as expected for tests that are inherited. This is because it uses aClass.getDeclaredMethods(), which only operates on the current instance and does not include methods that are inherited. This can cause issues with annotations related to methods, such as descriptions and others.

Steps to Reproduce

  1. Create two test classes:
abstract class AbstractTest {
    @Test
    @Description("Test description")
    fun test() {
    }
}

class ImplTest: AbstractTest() {
}
  1. Run ImplTest.
  2. Check the description in the Allure UI.

Expected Behaviour

The test should contain the "Test description" text in the description section.

Screenshots or Additional Context

The description is absent.

What Language are you using?

Java, Kotlin

What Framework/Allure Integration you are using?

allure-junit5

What version of Allure Integration you are using?

2.27.0

What version of Allure Report you are using?

2.11.2

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ingvard ingvard added triage type:bug Something isn't working labels Apr 10, 2024
@ingvard
Copy link
Author

ingvard commented Apr 12, 2024

Moved to the right module allure-framework/allure-java#1032

@ingvard ingvard closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant