-
Notifications
You must be signed in to change notification settings - Fork 462
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
JAMES-2586 Integration tests for JMAP postgres #2029
JAMES-2586 Integration tests for JMAP postgres #2029
Conversation
Do annotate @disabled tests in a separate commit to ease review please! |
e7d93e6
to
f141a39
Compare
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.
Looks good to me. Can you create a ticket though for fixing those unstable tests? Then I'm ok to merge it :)
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.
Some file configs were copied from the memory package,
I think we can try with postgres
backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresFixture.java
Outdated
Show resolved
Hide resolved
...integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/resources/lmtpserver.xml
Outdated
Show resolved
Hide resolved
...ration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/resources/mailetcontainer.xml
Outdated
Show resolved
Hide resolved
...on-tests/postgres-jmap-rfc-8621-integration-tests/src/test/resources/mailrepositorystore.xml
Outdated
Show resolved
Hide resolved
...ration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/resources/usersrepository.xml
Outdated
Show resolved
Hide resolved
f141a39
to
fdb033c
Compare
|
Issues maybe? => https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-2029/5/
|
:(( It still run fine in my local. Does any other PR have the same issue? |
Potentially racing issue? Like I had with domain table before? |
No sorry didnt realize that the faulty tests in question were not even part of this PR. Thinking more of a bad test isolation here..? |
9c8398e
to
e055627
Compare
backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresFixture.java
Outdated
Show resolved
Hide resolved
I think should do it... the rabbitmq.properties file that you added @hungphan227 created issues. Because of it it was thinking of using rabbitmq for all tests classes in server/apps/postgres-app. There was an injection issue (user and password missing for uri management) Also not all tests are using rabbitmq. Rabbitmq values are being injected into the conf in the tests that need it btw, so unnecessary changes. Please avoid making changes that are not related to the work, here integration tests, the test resources on the server-app module are not related to this work |
if (!rlsEnabled) { | ||
dropAllConnections(); | ||
} |
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.
Another way without introducing more code: move disposePostgresSession
from afterAll
to afterEach
?
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.
what disposePostgresSession close is connection of PostgresExtension, not connections created when running PostgresJamesServerMain
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements AuthenticationContract { | |||
.extension(new AwsS3BlobStoreExtension()) | |||
.server(configuration -> CassandraRabbitMQJamesServerMain.createServer(configuration) | |||
.overrideWith(new TestJMAPServerModule())) | |||
.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS) |
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'm not keen on having modifications on other tests suites than Postgres tbh on a separate working branch than master
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 tend to agree with @Arsnael. We should not modify the contract test unless something is actually wrong with the contract test itself.
@hungphan227 maybe try more on releasing the connection upon James shutdown? As I think the production code deserves the connection release as well.
e.g. add this to the SinglePostgresConnectionFactory
@PreDestroy
public void dispose() {
Mono.from(connection.close()).block();
}
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.
@quantranhong1999 you commented on wrong thread
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'm not keen on having modifications on other tests suites than Postgres tbh on a separate working branch than master
I have reversed code and used a new solution
...ts-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/QuotaGetMethodContract.scala
Outdated
Show resolved
Hide resolved
02981dd
to
37851b5
Compare
Disabled PostgresAuthenticationTest due to JamesServerExtension. Created another ticket: linagora#5099 |
I currently disable some failed tests because they are not easy to fix (need to check business logic). I will create other tickets to fix these tests