danielcweeks commented on code in PR #11093:
URL: https://github.com/apache/iceberg/pull/11093#discussion_r1841393266


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java:
##########
@@ -59,20 +87,29 @@ protected static Object[][] parameters() {
   }
 
   @BeforeAll
-  public static void createWarehouse() throws IOException {
+  public static void setUpAll() throws IOException {
     TestBaseWithCatalog.warehouse = File.createTempFile("warehouse", null);
     assertThat(warehouse.delete()).isTrue();
+    restCatalog = REST_SERVER_EXTENSION.client();

Review Comment:
   I feel like we're almost there, but we're still doing too much here that 
should be one in the extension.
   
   We should make this test base implement either the `BeforeAllCallback` or 
the `BeforeEachCallback` which allows for using the extension store:
   
   ```java
     @Override
     public void beforeAll(ExtensionContext extensionContext) {
       restCatalog = (RESTCatalog) 
extensionContext.getStore(ExtensionContext.Namespace.create("rest")).get("rest-catalog");
     }
   ``` 
   
   This will actually get called before the `@BeforeAll` annotation, so we can 
capture what we need to from the context store and configure for the rest of 
the tests.



-- 
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-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to