-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Verify AOT testing support for all tests in the spring-test
module
#29122
Comments
This commit introduces endToEndTestsForEntireSpringTestModule() in AotIntegrationTests to allow us to periodically check on our AOT support. Status quo: - several test classes cannot be processed for AOT due to exceptions thrown during processing - some generated classes fail to compile - some tests fail See spring-projectsgh-29122
…ngTestModule() Current results for the spring-test module: Test run finished after 6785 ms [ 403 containers found ] [ 6 containers skipped ] [ 397 containers started ] [ 0 containers aborted ] [ 381 containers successful ] [ 16 containers failed ] [ 757 tests found ] [ 41 tests skipped ] [ 703 tests started ] [ 9 tests aborted ] [ 599 tests successful ] [ 95 tests failed ] Failing Test Classes: org.springframework.test.context.testng.transaction.ejb.RollbackForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.env.ExplicitPropertiesFileTestPropertySourceTests$ClasspathTests$PlaceholderAndClasspathPrefixTests org.springframework.test.context.env.ExplicitPropertiesFileTestPropertySourceTests$ClasspathTests$PlaceholderTests org.springframework.test.context.env.ExplicitPropertiesFileTestPropertySourceTests$FileSystemTests$CustomPlaceholderTests org.springframework.test.context.env.ExplicitPropertiesFileTestPropertySourceTests$FileSystemTests$PlaceholdersFollowedByRelativePathsTests org.springframework.test.context.env.ExplicitPropertiesFileTestPropertySourceTests$FileSystemTests$UserDirAndCustomPlaceholdersTests org.springframework.test.web.servlet.samples.client.context.WebAppResourceTests org.springframework.test.web.servlet.samples.client.context.XmlConfigTests org.springframework.test.web.servlet.samples.context.WebAppResourceTests org.springframework.test.web.servlet.samples.context.XmlConfigTests org.springframework.test.context.junit4.ParameterizedDependencyInjectionTests org.springframework.test.context.junit4.nested.NestedTestsWithSpringRulesTests$NestedTestCase org.springframework.test.context.junit4.spr9799.Spr9799XmlConfigTests See gh-29122
This commit applies @DisabledInAotMode to test classes in the spring-test module that will never be able to be processed for AOT optimizations. Test classes that fail for reasons that can potentially be addressed in a future version of the framework have not been annotated with @DisabledInAotMode. See gh-29122
Prior to this commit, the NestedTestCase resulted in errors during our AOT end-to-end integration tests since it did not comply to our "*Tests" naming convention. See spring-projectsgh-29122
Prior to this commit, AotIntegrationTests only printed "failing test classes" for tests that failed at the class level. This commit updates the reporting logic to report test classes for failing test methods as well. Current results for the spring-test module: Test run finished after 6531 ms [ 403 containers found ] [ 27 containers skipped ] [ 376 containers started ] [ 0 containers aborted ] [ 366 containers successful ] [ 10 containers failed ] [ 757 tests found ] [ 61 tests skipped ] [ 689 tests started ] [ 9 tests aborted ] [ 585 tests successful ] [ 95 tests failed ] Failing Test Classes: org.springframework.test.context.configuration.interfaces.ContextHierarchyInterfaceTests org.springframework.test.context.configuration.interfaces.SqlConfigInterfaceTests org.springframework.test.context.expression.ExpressionUsageTests org.springframework.test.context.groovy.AbsolutePathGroovySpringContextTests org.springframework.test.context.groovy.GroovySpringContextTests org.springframework.test.context.groovy.RelativePathGroovySpringContextTests org.springframework.test.context.hierarchies.meta.MetaHierarchyLevelTwoTests org.springframework.test.context.hierarchies.standard.ClassHierarchyWithMergedConfigLevelOneTests org.springframework.test.context.hierarchies.standard.ClassHierarchyWithMergedConfigLevelTwoTests org.springframework.test.context.hierarchies.standard.ClassHierarchyWithOverriddenConfigLevelTwoTests org.springframework.test.context.hierarchies.standard.DirtiesContextWithContextHierarchyTests org.springframework.test.context.hierarchies.standard.SingleTestClassWithTwoLevelContextHierarchyAndMixedConfigTypesTests org.springframework.test.context.hierarchies.standard.SingleTestClassWithTwoLevelContextHierarchyTests org.springframework.test.context.hierarchies.standard.TestHierarchyLevelTwoWithBareContextConfigurationInSubclassTests org.springframework.test.context.hierarchies.standard.TestHierarchyLevelTwoWithBareContextConfigurationInSuperclassTests org.springframework.test.context.hierarchies.standard.TestHierarchyLevelTwoWithSingleLevelContextHierarchyAndMixedConfigTypesTests org.springframework.test.context.hierarchies.standard.TestHierarchyLevelTwoWithSingleLevelContextHierarchyTests org.springframework.test.context.hierarchies.web.ControllerIntegrationTests org.springframework.test.context.hierarchies.web.DispatcherWacRootWacEarTests org.springframework.test.context.hierarchies.web.RootWacEarTests org.springframework.test.context.jdbc.CustomScriptSyntaxSqlScriptsTests org.springframework.test.context.jdbc.GlobalCustomScriptSyntaxSqlScriptsTests org.springframework.test.context.jdbc.InferredDataSourceTransactionalSqlScriptsTests org.springframework.test.context.jdbc.InfrastructureProxyTransactionalSqlScriptsTests org.springframework.test.context.jdbc.MultipleDataSourcesAndTransactionManagersSqlScriptsTests org.springframework.test.context.jdbc.MultipleDataSourcesAndTransactionManagersTransactionalSqlScriptsTests org.springframework.test.context.jdbc.NonTransactionalSqlScriptsTests org.springframework.test.context.jdbc.RepeatableSqlAnnotationSqlScriptsChildTests org.springframework.test.context.jdbc.RepeatableSqlAnnotationSqlScriptsParentTests org.springframework.test.context.jdbc.TransactionalAfterTestMethodSqlScriptsTests org.springframework.test.context.jdbc.TransactionalInlinedStatementsSqlScriptsTests org.springframework.test.context.junit.jupiter.nested.ContextHierarchyNestedTests$NestedTestCaseWithInheritedConfigTests org.springframework.test.context.junit.jupiter.nested.ContextHierarchyNestedTests$NestedTestCaseWithInheritedConfigTests$DoubleNestedTestCaseWithOverriddenConfigTests org.springframework.test.context.junit.jupiter.nested.ContextHierarchyNestedTests$NestedTestCaseWithInheritedConfigTests$DoubleNestedTestCaseWithOverriddenConfigTests$TripleNestedWithInheritedConfigAndTestInterfaceTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$ConfigOverriddenByDefaultTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests$TripleNestedWithInheritedConfigAndTestInterfaceTests org.springframework.test.context.junit.jupiter.orm.JpaEntityListenerTests org.springframework.test.context.junit4.AbsolutePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ConcreteTransactionalJUnit4SpringContextTests org.springframework.test.context.junit4.InheritedConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ParameterizedDependencyInjectionTests org.springframework.test.context.junit4.RelativePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.SpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.annotation.AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.rules.TransactionalSqlScriptsSpringRuleTests org.springframework.test.context.junit4.spr9799.Spr9799XmlConfigTests org.springframework.test.context.testng.ConcreteTransactionalTestNGSpringContextTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.transaction.ejb.CommitForRequiredEjbTxDaoTests org.springframework.test.context.transaction.ejb.CommitForRequiresNewEjbTxDaoTests org.springframework.test.context.transaction.ejb.RollbackForRequiredEjbTxDaoTests org.springframework.test.context.transaction.ejb.RollbackForRequiresNewEjbTxDaoTests org.springframework.test.web.servlet.samples.client.context.JavaConfigTests org.springframework.test.web.servlet.samples.client.context.WebAppResourceTests org.springframework.test.web.servlet.samples.client.context.XmlConfigTests org.springframework.test.web.servlet.samples.context.JavaConfigTests org.springframework.test.web.servlet.samples.context.WebAppResourceTests org.springframework.test.web.servlet.samples.context.XmlConfigTests See gh-29122
This commit applies @DisabledInAotMode to all integration test classes in the spring-test module that use @ContextHierarchy since that feature is not supported for AOT optimizations. Current AOT test results for the spring-test module: Test run finished after 6888 ms [ 403 containers found ] [ 57 containers skipped ] [ 346 containers started ] [ 0 containers aborted ] [ 338 containers successful ] [ 8 containers failed ] [ 757 tests found ] [ 98 tests skipped ] [ 654 tests started ] [ 9 tests aborted ] [ 576 tests successful ] [ 69 tests failed ] Failing Test Classes: org.springframework.test.context.configuration.interfaces.SqlConfigInterfaceTests org.springframework.test.context.expression.ExpressionUsageTests org.springframework.test.context.groovy.AbsolutePathGroovySpringContextTests org.springframework.test.context.groovy.GroovySpringContextTests org.springframework.test.context.groovy.RelativePathGroovySpringContextTests org.springframework.test.context.hierarchies.meta.MetaHierarchyLevelTwoTests org.springframework.test.context.hierarchies.standard.TestHierarchyLevelTwoWithBareContextConfigurationInSubclassTests org.springframework.test.context.jdbc.CustomScriptSyntaxSqlScriptsTests org.springframework.test.context.jdbc.GlobalCustomScriptSyntaxSqlScriptsTests org.springframework.test.context.jdbc.InferredDataSourceTransactionalSqlScriptsTests org.springframework.test.context.jdbc.InfrastructureProxyTransactionalSqlScriptsTests org.springframework.test.context.jdbc.MultipleDataSourcesAndTransactionManagersSqlScriptsTests org.springframework.test.context.jdbc.MultipleDataSourcesAndTransactionManagersTransactionalSqlScriptsTests org.springframework.test.context.jdbc.NonTransactionalSqlScriptsTests org.springframework.test.context.jdbc.RepeatableSqlAnnotationSqlScriptsChildTests org.springframework.test.context.jdbc.RepeatableSqlAnnotationSqlScriptsParentTests org.springframework.test.context.jdbc.TransactionalAfterTestMethodSqlScriptsTests org.springframework.test.context.jdbc.TransactionalInlinedStatementsSqlScriptsTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$ConfigOverriddenByDefaultTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests$TripleNestedWithInheritedConfigAndTestInterfaceTests org.springframework.test.context.junit.jupiter.orm.JpaEntityListenerTests org.springframework.test.context.junit4.AbsolutePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ConcreteTransactionalJUnit4SpringContextTests org.springframework.test.context.junit4.InheritedConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ParameterizedDependencyInjectionTests org.springframework.test.context.junit4.RelativePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.SpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.annotation.AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.rules.TransactionalSqlScriptsSpringRuleTests org.springframework.test.context.junit4.spr9799.Spr9799XmlConfigTests org.springframework.test.context.testng.ConcreteTransactionalTestNGSpringContextTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.transaction.ejb.CommitForRequiredEjbTxDaoTests org.springframework.test.context.transaction.ejb.CommitForRequiresNewEjbTxDaoTests org.springframework.test.context.transaction.ejb.RollbackForRequiredEjbTxDaoTests org.springframework.test.context.transaction.ejb.RollbackForRequiresNewEjbTxDaoTests See gh-29122
... to avoid database name conflicts when test classes are executed in a different order. See gh-29122
Most of the remaining failures are due to @Resource usage. Current AOT test results for the spring-test module: Test run finished after 6140 ms [ 399 containers found ] [ 64 containers skipped ] [ 335 containers started ] [ 0 containers aborted ] [ 333 containers successful ] [ 2 containers failed ] [ 745 tests found ] [ 116 tests skipped ] [ 628 tests started ] [ 1 tests aborted ] [ 589 tests successful ] [ 38 tests failed ] Failing Test Classes: org.springframework.test.context.groovy.AbsolutePathGroovySpringContextTests org.springframework.test.context.groovy.GroovySpringContextTests org.springframework.test.context.groovy.RelativePathGroovySpringContextTests org.springframework.test.context.jdbc.BeforeTestClassSqlScriptsTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$ConfigOverriddenByDefaultTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests$TripleNestedWithInheritedConfigAndTestInterfaceTests org.springframework.test.context.junit.jupiter.orm.JpaEntityListenerTests org.springframework.test.context.junit4.AbsolutePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ConcreteTransactionalJUnit4SpringContextTests org.springframework.test.context.junit4.InheritedConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ParameterizedDependencyInjectionTests org.springframework.test.context.junit4.RelativePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.SpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.annotation.AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.spr9799.Spr9799XmlConfigTests org.springframework.test.context.testng.ConcreteTransactionalTestNGSpringContextTests See gh-29122
spring-test
module
For the sake of simplicity, we have not introduced a dedicated build for this purpose. Instead, we currently rely on manual runs of Several tests are now annotated with the newly introduced Current results
Failure CategoriesUses
|
If that's the case, then we need to revisit #29030 (comment) |
Now that #31733 has been resolved, we only have 2 remaining test classes that fail in AOT mode.
|
spring-test
modulespring-test
module
Update
|
This commit also ensures that @Bean methods are declared within @Configuration classes instead of within test classes. See gh-29122
As a follow up to the previous commit (31f8e12), this commit polishes bean override tests and revises them with a focus on AOT testing support and simplified maintenance. - Introduce EngineTestKitUtils to simplify working with JUnit's EngineTestKit. - Use idiomatic EngineTestKit APIs to simplify assertions on EngineTestKit results. - Introduce BeanOverrideTestSuite to simplify running all bean override tests within the IDE. - Separate failure and success scenario tests, so that failure tests do not launch the JUnit Platform to run tests using the Spring TestContext Framework (TCF) within a test class that itself uses the TCF. - Make AbstractTestBeanIntegrationTestCase actually abstract. - Rename test case classes to give them meaningful names and simplify understanding of what's being tested. - Ensure tests for @MockitoSpyBean functionality use @MockitoSpyBean instead of @MockitoBean. - Declare @Configuration classes local to @SpringJUnitConfig test classes whenever possible. See gh-29122 See gh-32925
UpdateAfter recent revisions to our bean override tests, the results are now as follows.
|
Overview
Now that we have AOT testing support in place, we should introduce a way to run end-to-end tests for all Spring TestContext Framework integration tests in the
spring-test
module.This will help us to discover issues with our ongoing AOT efforts.
Related Issues
@DisabledInAotMode
in the TestContext framework #30834<mvc:annotation-driven>
should not instantiate bean property values #31472@Resource
in test classes in AOT mode #31733The text was updated successfully, but these errors were encountered: