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

Vintage engine reports intermediate containers as finished before executing dynamic children #1819

Closed
1 task
marcphilipp opened this issue Mar 16, 2019 · 2 comments

Comments

@marcphilipp
Copy link
Member

For the demo project below, Vintage reports the AbcTest class as finished before starting its dynamic children:

Started:     JUnit Vintage ([engine:junit-vintage])
Started:     AbcTestSuite ([engine:junit-vintage]/[runner:AbcTestSuite])
Started:     AbcTest ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest])
Started:     simple ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest]/[test:simple(AbcTest)])
Finished:    simple ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest]/[test:simple(AbcTest)])
Finished:    AbcTest ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest])
Test registered:   aaa 1 ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest]/[dynamic:aaa 1(AbcTest)])
Started:     aaa 1 ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest]/[dynamic:aaa 1(AbcTest)])
Finished:    aaa 1 ([engine:junit-vintage]/[runner:AbcTestSuite]/[test:AbcTest]/[dynamic:aaa 1(AbcTest)])
Finished:    AbcTestSuite ([engine:junit-vintage]/[runner:AbcTestSuite])
Finished:    JUnit Vintage ([engine:junit-vintage])

Steps to reproduce

run ./gradlew test with https://github.com/tomekgajdos/tmp-test-lib-a

Context

  • Used versions (Jupiter/Vintage/Platform): 5.4.0
  • Build Tool/IDE: Gradle

Deliverables

  • Report intermediate containers as finished lazily, i.e. when a new test is started that is not a child of the current container or when the runner is finished (except for well-known runners such as Parameterized)
@marcphilipp
Copy link
Member Author

Originally reported in gradle/gradle#8787

marcphilipp added a commit that referenced this issue Mar 16, 2019
Since JUnit 4 does report events for intermediate containers, the
Vintage engine has to synthesize them. Until now this was done lazily
for start events, i.e. when the first child was started, but eagerly for
finish events, i.e. when the last static child of a container was
finished. However, the latter approach is problematic for containers
that contain both static and dynamic children, for example a Spock
specification with a regular and an unrolled feature method. Instead,
intermediate containers are now reported as finished as soon as a test
is started for which the container is not an ancestor.

Fixes #1819.
@ghost ghost added the status: reviewing label Mar 16, 2019
marcphilipp added a commit that referenced this issue Mar 16, 2019
Since JUnit 4 does report events for intermediate containers, the
Vintage engine has to synthesize them. Until now this was done lazily
for start events, i.e. when the first child was started, but eagerly for
finish events, i.e. when the last static child of a container was
finished. However, the latter approach is problematic for containers
that contain both static and dynamic children, for example a Spock
specification with a regular and an unrolled feature method. Instead,
intermediate containers are now reported as finished as soon as a test
is started for which the container is not an ancestor.

Fixes #1819.
marcphilipp added a commit that referenced this issue Mar 16, 2019
Since JUnit 4 does report events for intermediate containers, the
Vintage engine has to synthesize them. Until now this was done lazily
for start events, i.e. when the first child was started, but eagerly for
finish events, i.e. when the last static child of a container was
finished. However, the latter approach is problematic for containers
that contain both static and dynamic children, for example a Spock
specification with a regular and an unrolled feature method. Instead,
intermediate containers are now reported as finished as soon as a test
is started for which the container is not an ancestor.

Fixes #1819.
@marcphilipp
Copy link
Member Author

Fixed in #1820.

marcphilipp added a commit that referenced this issue Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant