spinnaker icon indicating copy to clipboard operation
spinnaker copied to clipboard

tests(local-ports): Enable dynamic port allocation for Prometheus and management server during integration tests

Open rahul-chekuri opened this issue 10 months ago • 0 comments

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.port and management.server.port values 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 ManagementTest to use the dynamically registered Prometheus port (embedded.prometheus.port).

  • Added logic in BaseIntegrationTest to update dynamicEndpoint to PrometheusRemoteService

rahul-chekuri avatar Apr 25 '25 05:04 rahul-chekuri