gh-yzou commented on code in PR #1126:
URL: https://github.com/apache/polaris/pull/1126#discussion_r2011095483
##########
quarkus/service/src/intTest/java/org/apache/polaris/service/quarkus/it/QuarkusRestCatalogViewFileIT.java:
##########
@@ -20,20 +20,37 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;
import java.lang.reflect.Field;
+import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.Paths;
import org.apache.iceberg.view.ViewCatalogTests;
import
org.apache.polaris.service.it.test.PolarisRestCatalogViewFileIntegrationTest;
import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.extension.AnnotatedElementContext;
+import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.api.io.TempDirFactory;
@QuarkusIntegrationTest
public class QuarkusRestCatalogViewFileIT extends
PolarisRestCatalogViewFileIntegrationTest {
@BeforeEach
- public void setUpTempDir(@TempDir Path tempDir) throws Exception {
+ public void setUpTempDir(@TempDir(factory = CustomTempDirFactory.class) Path
tempDir)
+ throws Exception {
// see https://github.com/quarkusio/quarkus/issues/13261
Field field = ViewCatalogTests.class.getDeclaredField("tempDir");
field.setAccessible(true);
field.set(this, tempDir);
}
+
+ private static class CustomTempDirFactory implements TempDirFactory {
+ @Override
+ public Path createTempDirectory(
+ AnnotatedElementContext elementContext, ExtensionContext
extensionContext)
+ throws Exception {
+ Path basePath = Paths.get(BASE_LOCATION.replaceFirst("file://", ""));
Review Comment:
I see your point here. Let's check with @collado-mike here about what is the
correct behavior with WRITE_METADATA_LOCATION, because if the behavior for
WRITE_METADATA_LOCATION is wrong, then we can skip the test for now, and turn
on the test after the behavior is fixed. I see there are some other iceberg
test that uses the tempDir also, so kind if wired that only this test fails
https://github.com/apache/iceberg/blob/58b283e3533afce8b9884ac847a46eb40688353b/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java#L1518.
cc @sfc-gh-mcollado could you help take a look of this test failure, and see
what is the right way to proceed here?
If it is really just the problem with test, i am fine with both approach,
@dimas-b which one do you prefer? or do you have other suggestions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]