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

Support for test execution optimization #31

Closed
odrotbohm opened this issue Jul 28, 2022 · 0 comments
Closed

Support for test execution optimization #31

odrotbohm opened this issue Jul 28, 2022 · 0 comments
Assignees
Labels
in: infrastructure Build / CI / Release in: test support Spring Boot integration testing type: enhancement Major enhanvements, new features
Milestone

Comments

@odrotbohm
Copy link
Member

odrotbohm commented Jul 28, 2022

Context

A common challenge for modulithic applications is that a change in the version control system triggers a build of the overall system. That build usually consists of steps that are executed for the entire system, which means: for all modules, whether the change in question actually affects a module directly or transitively.

The structural information we have about the system could be combined with knowledge about the change set at hand to identify which modules are directly affected by the change itself. We could then find out about all modules directly or transitively depending on the "dirty" modules and limit the test execution to filter test cases contained in those modules only. Similarly to limiting the parts of the application that are actually bootstrapped during module-specific test via @ApplicationModuleTest.

Ideas

JUnit 5 has dedicated support to hook into the test discovery process, i.e. it should be possible to place a JAR in the classpath of e.g. the Maven Surefire execution that filters the test cases to actually be executed.

We also need to find a mechanism to identify, what the set of changes is, we want to start from. During local development, this is likely to be the files currently considered changed by Git. During a CI run (the more important aspect) it's likely the last change set or the set of change sets in between the previous build and the current one.

Original ticket:

@odrotbohm odrotbohm added in: infrastructure Build / CI / Release in: test support Spring Boot integration testing labels Jul 28, 2022
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 11, 2024
…guration property

The configuration property is received via the ApplicationContext of the running test (this should be fine, since a relevant test should always be an @ApplicationModuleTest and thus, by meta-annotation, have a Spring ApplicationContext).

The strategy instance is then looked up via a ServiceLoader. This is meant as an SPI/extension point to allow custom implementations in the future.
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 14, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 14, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 14, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 24, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 24, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 24, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Aug 24, 2024
…sticated logic to determine changed classes
lukasdo added a commit to lukasdo/spring-modulith that referenced this issue Aug 29, 2024
lukasdo added a commit to lukasdo/spring-modulith that referenced this issue Sep 2, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Sep 3, 2024
davidbilge added a commit to lukasdo/spring-modulith that referenced this issue Sep 3, 2024
@odrotbohm odrotbohm changed the title Investigate support for build time optimization Support for test execution optimization Sep 5, 2024
odrotbohm added a commit that referenced this issue Sep 8, 2024
odrotbohm pushed a commit that referenced this issue Sep 8, 2024
Initital prototype to support optimized test execution based on the Spring Modulith application module model. The change introduces a new artifact spring-modulith-junit that extends JUnit's test execution lifecycle. It obtains the ApplicationModules model for the application and potentially skips test classes for execution in case the changes made to the application reside in modules the current test case's module does not depend on.

Co-authored-by: Lukas Dohmen <[email protected]>
Co-authored-by: David Bilge <[email protected]>
odrotbohm added a commit that referenced this issue Sep 8, 2024
Added unit tests for the test execution conditions.

Add JUnit module to the BOM. Moved the jGit version into a managed property in the root pom.xml.
odrotbohm added a commit that referenced this issue Sep 8, 2024
Added unit tests for the test execution conditions.

Add JUnit module to the BOM. Moved the jGit version into a managed property in the root pom.xml.
odrotbohm added a commit that referenced this issue Sep 8, 2024
Added unit tests for the test execution conditions.

Add JUnit module to the BOM. Moved the jGit version into a managed property in the root pom.xml.
odrotbohm added a commit that referenced this issue Sep 11, 2024
odrotbohm pushed a commit that referenced this issue Sep 11, 2024
Initital prototype to support optimized test execution based on the Spring Modulith application module model. The change introduces a new artifact spring-modulith-junit that extends JUnit's test execution lifecycle. It obtains the ApplicationModules model for the application and potentially skips test classes for execution in case the changes made to the application reside in modules the current test case's module does not depend on.

Co-authored-by: Lukas Dohmen <[email protected]>
Co-authored-by: David Bilge <[email protected]>
odrotbohm added a commit that referenced this issue Sep 11, 2024
Added unit tests for the test execution conditions.

Add JUnit module to the BOM. Moved the jGit version into a managed property in the root pom.xml.
odrotbohm added a commit that referenced this issue Sep 16, 2024
odrotbohm pushed a commit that referenced this issue Sep 16, 2024
Initital prototype to support optimized test execution based on the Spring Modulith application module model. The change introduces a new artifact spring-modulith-junit that extends JUnit's test execution lifecycle. It obtains the ApplicationModules model for the application and potentially skips test classes for execution in case the changes made to the application reside in modules the current test case's module does not depend on.

Co-authored-by: Lukas Dohmen <[email protected]>
Co-authored-by: David Bilge <[email protected]>
odrotbohm added a commit that referenced this issue Sep 16, 2024
Added unit tests for the test execution conditions.

Add JUnit module to the BOM. Moved the jGit version into a managed property in the root pom.xml.
odrotbohm pushed a commit that referenced this issue Sep 16, 2024
Initital prototype to support optimized test execution based on the Spring Modulith application module model. The change introduces a new artifact spring-modulith-junit that extends JUnit's test execution lifecycle. It obtains the ApplicationModules model for the application and potentially skips test classes for execution in case the changes made to the application reside in modules the current test case's module does not depend on.

Co-authored-by: Lukas Dohmen <[email protected]>
Co-authored-by: David Bilge <[email protected]>
odrotbohm added a commit that referenced this issue Sep 16, 2024
Added unit tests for the test execution conditions.

Add JUnit module to the BOM. Moved the jGit version into a managed property in the root pom.xml.
@odrotbohm odrotbohm added this to the 1.3 M3 milestone Sep 16, 2024
@odrotbohm odrotbohm self-assigned this Sep 16, 2024
@odrotbohm odrotbohm added the type: enhancement Major enhanvements, new features label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: infrastructure Build / CI / Release in: test support Spring Boot integration testing type: enhancement Major enhanvements, new features
Projects
None yet
Development

No branches or pull requests

1 participant