-
Notifications
You must be signed in to change notification settings - Fork 124
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
Enable eclipselink with H2 database in testing #158
Conversation
dbc4d23
to
52010b7
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.
I think the PolarisConnectionExtension
class is the best place to enable bootstrapping the metastore for tests. When we added the bootstrap
command, we explicitly removed this logic from the persistent metastore impls so that users couldn't accidentally bootstrap their production instance.
polaris-core/src/main/java/io/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
Outdated
Show resolved
Hide resolved
2d46176
to
9f936a3
Compare
@aihuaxu Could you please rebase this? |
9f936a3
to
3d760b3
Compare
@RussellSpitzer Rebased. Please help take a look. |
3d760b3
to
5da0d7a
Compare
5da0d7a
to
592c485
Compare
...e/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
Outdated
Show resolved
Hide resolved
@@ -108,6 +108,9 @@ dependencies { | |||
testImplementation(libs.assertj.core) | |||
testImplementation(libs.mockito.core) | |||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | |||
|
|||
testRuntimeOnly(project(":polaris-eclipselink")) |
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.
For now I think this could be okay, but I feel like we may not want these dependencies here forever. We have intentionally not included these dependencies in the service. A new project to include all these dependencies could make sense.
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.
If we create a separate project to include the dependencies, we still need to include such project here , right? This is for test only though.
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 will try to address in the following PRs to include the dependency if needed. I saw that we have -PeclipseLink=$ECLIPSELINK
.
...is-service/src/test/java/org/apache/polaris/service/admin/PolarisOverlappingCatalogTest.java
Outdated
Show resolved
Hide resolved
polaris-service/src/test/java/org/apache/polaris/service/test/PolarisConnectionExtension.java
Outdated
Show resolved
Hide resolved
592c485
to
81440a4
Compare
17919f5
to
a77ca9f
Compare
polaris-service/src/main/java/org/apache/polaris/service/PolarisApplication.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/PolarisApplication.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
Outdated
Show resolved
Hide resolved
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.
Thanks @aihuaxu for the PR. LGTM overall, left minor comments.
...ervice/src/test/java/org/apache/polaris/service/task/ManifestFileCleanupTaskHandlerTest.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/PolarisApplication.java
Outdated
Show resolved
Hide resolved
ae5502f
to
283710f
Compare
@RussellSpitzer, @eric-maynard and @collado-mike Can you help review again? |
retest this please |
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.
+1
… for metastore manager other than in-memory
283710f
to
47b997a
Compare
Thanks @aihuaxu for working on it. Thanks @collado-mike @RussellSpitzer @eric-maynard for the review. |
Thanks @flyrain. |
Description
The change is to support the testing against eclipselink with file-based H2 database in addition to in-memory implementation. That will test the env closer to the production.
There is a difference between in-memory metastore and eclipseLink metastore: in-memory gets bootstrapped automatically since it's only used for test purpose while eclipseLink metastore doesn't boostrap automatically to avoid accidental wipeout in production.
To test out against eclipseLink metastore,
TODO:
Fixes #149
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
./gradlew test
and all the tests passed against eclipselink../gradlew test
and all the tests passed against in-memory.Test Configuration:
Checklist:
Please delete options that are not relevant.