-
Notifications
You must be signed in to change notification settings - Fork 3.6k
More tuncate() in tests #10378
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
More tuncate() in tests #10378
Conversation
@@ -122,7 +121,7 @@ void verifyCheckConstraints2(SessionFactoryScope scope) { | |||
|
|||
@AfterEach | |||
void dropTestData(SessionFactoryScope scope) { | |||
scope.inTransaction( (session) -> session.createMutationQuery( "delete Person" ).executeUpdate() ); | |||
scope.getSessionFactory().getSchemaManager().truncate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder ... what if we add something like
public @interface SessionFactory {
boolean truncate() default true;
....
And do it as part of the extension rather than in the tests? (then we could skip a lot of these after each calls ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marko-bekhta Yeah, that would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I gave it a try (truncate after each, evict cache after each):
15901 tests
756 failures
🙈 🥲
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's that experiment: #10380
from a few tests I've checked they either want to do something witch cache or rely on BeforeAll to setup the test data ...
(I set the defaults to NEVER
in that PR so it should pass the tests ... but if we want to make the cleanups more automatic, we'd probably have to adjust those failing tests 😃 )
[Please describe here what your change is about]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.