tests(local-ports): Enable dynamic port allocation for Prometheus and management server during integration tests
Replaces the previously hardcoded ports with dynamically assigned ports in the Kayenta integration tests. This ensures that tests can run reliably without port conflicts, especially in parallel or shared environments.
Below are the details of the changes:
-
EmbeddedPrometheusBootstrapConfiguration` now dynamically allocates and registers Prometheus container ports without using hardcoded ports.
-
Removed dependency on predefined
server.portandmanagement.server.portvalues for integration tests. -
Management server port is dynamically obtained during runtime and exposed for Prometheus to scrape metrics.
-
Prometheus container’s mapped port is dynamically registered into the environment (
embedded.prometheus.port) at runtime. -
Fixed
ManagementTestto use the dynamically registered Prometheus port (embedded.prometheus.port). -
Added logic in
BaseIntegrationTestto updatedynamicEndpointtoPrometheusRemoteService