You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "dimas-b (via GitHub)" <gi...@apache.org> on 2025/05/28 14:12:25 UTC

Re: [PR] Unblock test `createViewWithCustomMetadataLocation` [polaris]

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


##########
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java:
##########
@@ -175,15 +184,83 @@ protected boolean overridesRequestedLocation() {
     return true;
   }
 
-  /** TODO: Unblock this test, see: https://github.com/apache/polaris/issues/1273 */
   @Override
   @Test
-  @Disabled(
-      """
-      Disabled because the behavior is not applicable to Polaris.
-      To unblock, update this to expect an exception and add a Polaris-specific test.
-      """)
   public void createViewWithCustomMetadataLocation() {
-    super.createViewWithCustomMetadataLocation();
+    Assertions.assertThatThrownBy(super::createViewWithCustomMetadataLocation)
+        .isInstanceOf(ForbiddenException.class)
+        .hasMessageContaining("Forbidden: Invalid locations");

Review Comment:
   This change and the following test method LGTM because they assert existing Polaris behaviour.



##########
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java:
##########
@@ -175,15 +184,83 @@ protected boolean overridesRequestedLocation() {
     return true;
   }
 
-  /** TODO: Unblock this test, see: https://github.com/apache/polaris/issues/1273 */
   @Override
   @Test
-  @Disabled(
-      """
-      Disabled because the behavior is not applicable to Polaris.
-      To unblock, update this to expect an exception and add a Polaris-specific test.
-      """)
   public void createViewWithCustomMetadataLocation() {
-    super.createViewWithCustomMetadataLocation();
+    Assertions.assertThatThrownBy(super::createViewWithCustomMetadataLocation)
+        .isInstanceOf(ForbiddenException.class)
+        .hasMessageContaining("Forbidden: Invalid locations");
+  }
+
+  @Test
+  public void createViewWithCustomMetadataLocationUsingPolaris(@TempDir Path tempDir) {
+    TableIdentifier identifier = TableIdentifier.of("ns", "view");
+
+    String location = Paths.get(tempDir.toUri().toString()).toString();
+    String customLocation = Paths.get(tempDir.toUri().toString(), "custom-location").toString();
+    String customLocation2 = Paths.get(tempDir.toUri().toString(), "custom-location2").toString();
+    String customLocationChild =
+        Paths.get(tempDir.toUri().toString(), "custom-location/child").toString();
+
+    if (requiresNamespaceCreate()) {

Review Comment:
   Is this not always `true` in Polaris?



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org