Skip to content

Calculating test optimization data before the build starts

Bartosz Majsak edited this page Jul 7, 2017 · 1 revision

Based on analysis done for #44 we realized that calculating anything related to test execution from within surefire-provider is too late, as it will be recalculated for each and every module. Therefore we should try to pre-calculate all relevant data based on user's selected criteria for ordering tests before the build starts.

Maven offers a mechanism for this - Lifecycle Extensions

By implementing out our MavenLifecycleParticipant we can achieve following:

  • pre-calculate all needed data before build actually starts (by hooking to #afterSessionStart()
  • collect all relevant data to be send (by hooking to #afterSessionEnd()
  • attach our configuration dynamically instead of asking user to adjust their pom - this way we can provide seamless experience. This can be achieved by manipulating MavenSession object in afterSessionStart hook.

TODO

user experience (build invocation)

Clone this wiki locally