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

Feature/issue 373 improve testing for jupiter #827

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

l-1squared
Copy link
Collaborator

No description provided.

@l-1squared l-1squared requested a review from fudler February 7, 2022 06:58

public class GuaranteedFieldRealTest extends ScenarioTest<GuaranteedFieldRealTest.RealGiven, GuaranteedFieldRealTest.RealWhen, GuaranteedFieldRealTest.RealThen> {
@ExtendWith(JGivenReportExtractingExtension.class)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not necessary, we don't test these with JUnit5

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, we should probably move those into core at some point

}

@Override
public String getFailureMessage(int i) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain better how these failure message routine came to be

@@ -2,5 +2,6 @@

public enum TestFramework {
JUnit,
JUnit5,
TestNG
}
Copy link
Collaborator Author

@l-1squared l-1squared Feb 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add empty line for POSIX conformity

{ TestFramework.JUnit },
{ TestFramework.TestNG },
} );
return Arrays.stream(TestFramework.values())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try if TestFramework.values() will work just fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation indicates that this won't be the case

@l-1squared l-1squared force-pushed the feature/Issue-373-Improve-testing-for-jupiter branch from 160e5e3 to 3d2fc1c Compare February 9, 2022 06:20
}

@Test
public void a_succeding_JUnit5_test() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in succeeding


@Test
@Issue("#25")
public void test_classes_with_only_ignored_test_result_in_a_valid_report() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it somehow possible to give this method some better name? Needed some time to figure out which word groups belong to the same context. Like "test_classes_which_consist_of_only_ignored_tests" or something.

Also update JGiven Framework tests to also test Junit5

Signed-off-by: l-1sqared <[email protected]>
JUnit5 offers to use the same class instance over several methods.
This however is not in line with the scenario concept of JGiven. The JGivenExtension removes the scenario after the exection of each state, resulting in failure if the next scenario is executed on the same instance

Moreover, it is unclear how scenarios that share the same instance react when these methods are executed in parallel.

In addition, the JUnit 5 testframework tests were adapted. It turns out that when JUnit5 fails on the class level it returns a successful report model for method but a failure for the class level.

Signed-off-by: l-1sqared <[email protected]>
@l-1squared l-1squared force-pushed the feature/Issue-373-Improve-testing-for-jupiter branch from 3d2fc1c to 1bc9d4a Compare February 10, 2022 07:44
@l-1squared l-1squared requested a review from fudler February 15, 2022 06:10
@l-1squared l-1squared merged commit 271f94a into master Feb 15, 2022
@l-1squared l-1squared deleted the feature/Issue-373-Improve-testing-for-jupiter branch February 15, 2022 08:56
@l-1squared l-1squared linked an issue Feb 23, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can we user ReportPortal?
2 participants