This PR changes the ordering in which suite-local fixture afterAll methods are called.
It implements the trick @olafurpg describes in https://github.com/scalameta/munit/issues/573#issuecomment-1465269356 to restore the fixture ordering of v0.7.x
This ordering was changed in the first v1.0 milestone release
Therefore it is a breaking change within the v1.0 milestones in order to avoid a breaking change between v0.7.x and v1.0 overall.
Namely, we split up the suite-local fixture implementation into two fixtures, one of the before* methods, and one for the after* methods. Then we explicitly order munitFixtures to have the befores up front and the afters at the end.
Note: The v0.7.x style ordering is not to run the after* methods in opposite order to how the before* methods were run, making a mirror image like pattern. Instead it's more like after* methods run in the same order as before* methods except for suite-local fixtures which are special cased to run last.
:warning: Breaking Change :warning:
This PR changes the ordering in which suite-local fixture
afterAll
methods are called. It implements the trick @olafurpg describes in https://github.com/scalameta/munit/issues/573#issuecomment-1465269356 to restore the fixture ordering of v0.7.x This ordering was changed in the first v1.0 milestone release Therefore it is a breaking change within the v1.0 milestones in order to avoid a breaking change between v0.7.x and v1.0 overall.Namely, we split up the suite-local fixture implementation into two fixtures, one of the
before*
methods, and one for theafter*
methods. Then we explicitly ordermunitFixtures
to have the befores up front and the afters at the end.Of particular note, the tests/shared/src/main/scala/munit/FixtureOrderFrameworkSuite.scala file now looks the same as it did before https://github.com/scalameta/munit/pull/430/files?diff=split&w=0#diff-714f7ef13dfbbd4747770936315606f95d8aeba5f24890a45a4be216cda9d8a1
Note: The v0.7.x style ordering is not to run the
after*
methods in opposite order to how thebefore*
methods were run, making a mirror image like pattern. Instead it's more likeafter*
methods run in the same order asbefore*
methods except for suite-local fixtures which are special cased to run last.