You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "adutra (via GitHub)" <gi...@apache.org> on 2026/06/16 13:23:26 UTC

[PR] Remove PolarisIntegrationTestFixture [polaris]

adutra opened a new pull request, #4792:
URL: https://github.com/apache/polaris/pull/4792

   This change removes `PolarisIntegrationTestFixture` and `PolarisIntegrationTestHelper`. This functionality was outdated and is now largely covered by the more robust `PolarisIntegrationTestExtension`.
   
   This change also simplifies the two tests that were using that fixture class: `RateLimiterFilterTest` and `MetricsTestBase` (+ subclasses).
   
   It also removes two usages of `TestRealmContextResolver` in tests.
   
   <!--
   ๐Ÿ“ Describe what changes you're proposing, especially breaking or user-facing changes. 
   ๐Ÿ“– See https://github.com/apache/polaris/blob/main/CONTRIBUTING.md for more.
   -->
   
   ## Checklist
   - [ ] ๐Ÿ›ก๏ธ Don't disclose security issues! (contact security@apache.org)
   - [ ] ๐Ÿ”— Clearly explained why the changes are needed, or linked related issues: Fixes #
   - [ ] ๐Ÿงช Added/updated tests with good coverage, or manually tested (and explained how)
   - [ ] ๐Ÿ’ก Added comments for complex logic
   - [ ] ๐Ÿงพ Updated `CHANGELOG.md` (if needed)
   - [ ] ๐Ÿ“š Updated documentation in `site/content/in-dev/unreleased` (if needed)
   


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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3421111140


##########
runtime/service/src/test/java/org/apache/polaris/service/test/TestMetricsUtil.java:
##########
@@ -36,23 +37,25 @@
 /** Utils for working with metrics in tests */
 public class TestMetricsUtil {
 
-  public static Map<String, MetricFamily> fetchMetrics(Client client, URI baseManagementUri) {
-    Response response = client.target(baseManagementUri.resolve("q/metrics")).request().get();
-    if (response.getStatus() == Status.MOVED_PERMANENTLY.getStatusCode()) {
-      response = client.target(response.getLocation()).request().get();
+  public static Map<String, MetricFamily> fetchMetrics(URI baseManagementUri) {
+    try (Client client = ClientBuilder.newBuilder().build()) {
+      Response response = client.target(baseManagementUri.resolve("q/metrics")).request().get();
+      if (response.getStatus() == Status.MOVED_PERMANENTLY.getStatusCode()) {
+        response = client.target(response.getLocation()).request().get();
+      }

Review Comment:
   `fetchMetrics` doesn't close the `Response` (and also overwrites it on redirects), which can leak HTTP connections during Awaitility polling and make tests flaky. Use try-with-resources for the initial and redirected responses and parse the body in a helper method.



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3428619874


##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   @andrew4699 used to be involved in that code... but not active anymore... I think a notice to `dev` would be nice in case people still rely on that class downstream.



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3427126352


##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   It's only used in the same 2 classes: `MetricsTestBase` and `RateLimiterFilterTest`. I'm not sure we need a dev discussion for that, wdyt?



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3443705461


##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   Looking at #4841 I agree that the removal of `TestEnvironmentExtension` is a pretty isolated change and does not require a `dev` discussion :+1: 



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3422736003


##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   ... and `TestEnvironmentExtension` too, I assume?



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra merged PR #4792:
URL: https://github.com/apache/polaris/pull/4792


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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3422394323


##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   Note: I intend to remove `TestEnvironment` as well in a follow-up task.



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3422740748


##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   I'd say let's have a `dev` discussion on that removal as some downstream projects user to depend on that code... I'm not sure it is still relevant, though :thinking: 
   
   +1 to remove from my POV.



##########
runtime/service/src/test/java/org/apache/polaris/service/metrics/MetricsTestBase.java:
##########
@@ -28,42 +27,59 @@
 import java.time.Duration;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
-import org.apache.polaris.service.test.PolarisIntegrationTestFixture;
-import org.apache.polaris.service.test.PolarisIntegrationTestHelper;
+import org.apache.polaris.service.it.env.ClientPrincipal;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+import org.apache.polaris.service.it.env.PolarisClient;
+import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
+import org.apache.polaris.service.ratelimiter.MockRateLimiter;
 import org.apache.polaris.service.test.TestEnvironment;
 import org.apache.polaris.service.test.TestEnvironmentExtension;
 import org.apache.polaris.service.test.TestMetricsUtil;
 import org.awaitility.Awaitility;
 import org.hawkular.agent.prometheus.types.MetricFamily;
 import org.hawkular.agent.prometheus.types.Summary;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 @ExtendWith(TestEnvironmentExtension.class)
+@ExtendWith(PolarisIntegrationTestExtension.class)
 public abstract class MetricsTestBase {
 
   private static final int ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();
-  private static final String ENDPOINT = "api/management/v1/principals";
   private static final String API_METRIC_NAME = "polaris_principals_getPrincipal_seconds";
   private static final String HTTP_METRIC_NAME = "http_server_requests_seconds";
 
-  @Inject PolarisIntegrationTestHelper helper;
   @Inject MeterRegistry registry;
   @Inject MetricsConfiguration metricsConfiguration;
 
   private TestEnvironment testEnv;
-  private PolarisIntegrationTestFixture fixture;
+  private PolarisApiEndpoints endpoints;
+  private PolarisClient client;
+  private ClientPrincipal principal;
+  private String adminToken;
 
   @BeforeAll
-  public void createFixture(TestEnvironment testEnv, TestInfo testInfo) {
+  public void setUp(
+      TestEnvironment testEnv, PolarisApiEndpoints endpoints, ClientPrincipal principal) {

Review Comment:
   I'd say let's have a `dev` discussion on that removal as some downstream projects used to depend on that code... I'm not sure it is still relevant, though :thinking: 
   
   +1 to remove from my POV.



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


Re: [PR] Remove PolarisIntegrationTestFixture [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3421136925


##########
runtime/service/src/test/java/org/apache/polaris/service/test/TestMetricsUtil.java:
##########
@@ -36,23 +37,25 @@
 /** Utils for working with metrics in tests */
 public class TestMetricsUtil {
 
-  public static Map<String, MetricFamily> fetchMetrics(Client client, URI baseManagementUri) {
-    Response response = client.target(baseManagementUri.resolve("q/metrics")).request().get();
-    if (response.getStatus() == Status.MOVED_PERMANENTLY.getStatusCode()) {
-      response = client.target(response.getLocation()).request().get();
+  public static Map<String, MetricFamily> fetchMetrics(URI baseManagementUri) {
+    try (Client client = ClientBuilder.newBuilder().build()) {
+      Response response = client.target(baseManagementUri.resolve("q/metrics")).request().get();
+      if (response.getStatus() == Status.MOVED_PERMANENTLY.getStatusCode()) {
+        response = client.target(response.getLocation()).request().get();
+      }

Review Comment:
   Fixed.



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