dimas-b commented on code in PR #987:
URL: https://github.com/apache/polaris/pull/987#discussion_r1955569572


##########
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java:
##########
@@ -118,25 +118,26 @@ public class PolarisApplicationIntegrationTest {
   private static ClientCredentials clientCredentials;
   private static ClientPrincipal admin;
   private static String authToken;
+  private static URI baseLocation;
 
   private String principalRoleName;
   private String internalCatalogName;
 
   @BeforeAll
-  public static void setup(PolarisApiEndpoints apiEndpoints, ClientPrincipal 
adminCredentials)
-      throws IOException {
+  public static void setup(
+      PolarisApiEndpoints apiEndpoints, ClientPrincipal adminCredentials, 
@TempDir Path tempDir) {
     endpoints = apiEndpoints;
     client = polarisClient(endpoints);
     realm = endpoints.realmId();
     admin = adminCredentials;
     clientCredentials = adminCredentials.credentials();
     authToken = client.obtainToken(clientCredentials);
-
-    testDir = Path.of("build/test_data/iceberg/" + realm);
-    FileUtils.deleteQuietly(testDir.toFile());
-    Files.createDirectories(testDir);
-
     managementApi = client.managementApi(clientCredentials);
+    baseLocation =
+        Optional.ofNullable(System.getenv("INTEGRATION_TEST_TEMP_DIR"))
+            .map(URI::create)
+            .orElse(tempDir.toUri())
+            .resolve(realm + "/");

Review Comment:
   This may have unexpected behaviour... IIRC `s3://bucket/a/b` 
`.resolve("realm/")` will yield `s3://bucket/a/realm/`... Did you mean that?
   
   It might be best to do a simple string append and then call 
`URI.normalize()`.
   
   Also, some valid S3 locations do not pass `URI` validation checks cf. 
https://github.com/projectnessie/nessie/issues/8328 .... so in the end I think 
it might be best to stick with string concat until Polaris gets tooling for 
dealing with S3 locations that are not proper URIs :sweat_smile:  



-- 
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]

Reply via email to