From 1ace5378fc202a527f840848ceac5b4c6690546f Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Mon, 25 Aug 2025 12:31:19 +0100 Subject: [PATCH 1/2] ci: support for running OCI images from main or betas Images in pivotalrabbitmq/rabbitmq built nightly from main disable the management metrics collector. This breaks many tests because we rely on management UI metrics for assertions. This commit introduces a dedicated config file to ensure that management metrics are collected. --- .ci/ubuntu/cluster/rmq/21-enable-management-collector.conf | 3 +++ .ci/ubuntu/cluster/rmq/Dockerfile | 1 + .ci/ubuntu/one-node/21-enable-management-collector.conf | 3 +++ .ci/ubuntu/one-node/gha-setup.sh | 1 + Tests/Management/ManagementTests.cs | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .ci/ubuntu/cluster/rmq/21-enable-management-collector.conf create mode 100644 .ci/ubuntu/one-node/21-enable-management-collector.conf diff --git a/.ci/ubuntu/cluster/rmq/21-enable-management-collector.conf b/.ci/ubuntu/cluster/rmq/21-enable-management-collector.conf new file mode 100644 index 0000000..913a49a --- /dev/null +++ b/.ci/ubuntu/cluster/rmq/21-enable-management-collector.conf @@ -0,0 +1,3 @@ +# This file might be required to test with images built from main. +# Images in pivotalrabbitmq/rabbitmq disable the metrics collector by default. +management_agent.disable_metrics_collector = false \ No newline at end of file diff --git a/.ci/ubuntu/cluster/rmq/Dockerfile b/.ci/ubuntu/cluster/rmq/Dockerfile index 6ddf950..a52e7f6 100644 --- a/.ci/ubuntu/cluster/rmq/Dockerfile +++ b/.ci/ubuntu/cluster/rmq/Dockerfile @@ -12,5 +12,6 @@ COPY --chown=rabbitmq:rabbitmq --chmod=0644 enabled_plugins /etc/rabbitmq/enable COPY --chown=rabbitmq:rabbitmq rabbitmq-env.conf /etc/rabbitmq/rabbitmq-env.conf COPY --chown=rabbitmq:rabbitmq rabbitmq.conf /etc/rabbitmq/rabbitmq.conf COPY --chown=rabbitmq:rabbitmq advanced.config /etc/rabbitmq/advanced.config +COPY --chown=rabbitmq:rabbitmq 21-enable-management-collector.conf /etc/rabbitmq/conf.d/21-enable-management-collector.conf EXPOSE 4369 5671 5672 15672 15692 25672 35672-35682 diff --git a/.ci/ubuntu/one-node/21-enable-management-collector.conf b/.ci/ubuntu/one-node/21-enable-management-collector.conf new file mode 100644 index 0000000..913a49a --- /dev/null +++ b/.ci/ubuntu/one-node/21-enable-management-collector.conf @@ -0,0 +1,3 @@ +# This file might be required to test with images built from main. +# Images in pivotalrabbitmq/rabbitmq disable the metrics collector by default. +management_agent.disable_metrics_collector = false \ No newline at end of file diff --git a/.ci/ubuntu/one-node/gha-setup.sh b/.ci/ubuntu/one-node/gha-setup.sh index 77e9cee..a4c7efa 100755 --- a/.ci/ubuntu/one-node/gha-setup.sh +++ b/.ci/ubuntu/one-node/gha-setup.sh @@ -90,6 +90,7 @@ function start_rabbitmq --volume "$GITHUB_WORKSPACE/.ci/ubuntu/one-node/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro" \ --volume "$GITHUB_WORKSPACE/.ci/certs:/etc/rabbitmq/certs:ro" \ --volume "$GITHUB_WORKSPACE/.ci/ubuntu/one-node/advanced.config:/etc/rabbitmq/advanced.config:ro" \ + --volume "$GITHUB_WORKSPACE/.ci/ubuntu/one-node/21-enable-management-collector.conf:/etc/rabbitmq/conf.d/21-enable-management-collector.conf:ro" \ --volume "$GITHUB_WORKSPACE/.ci/ubuntu/log:/var/log/rabbitmq" \ "$rabbitmq_image" } diff --git a/Tests/Management/ManagementTests.cs b/Tests/Management/ManagementTests.cs index 3d0a3a4..b590183 100644 --- a/Tests/Management/ManagementTests.cs +++ b/Tests/Management/ManagementTests.cs @@ -453,6 +453,6 @@ public async Task PurgeQueueShouldReturnErrorForStream() await queueSpec.DeclareAsync(); await PublishAsync(queueSpec, 19); await WaitUntilQueueMessageCount(_queueName, 19); - await Assert.ThrowsAsync(() => queueSpec.PurgeAsync()); + await Assert.ThrowsAsync(queueSpec.PurgeAsync); } } From 7c9607af91dfb4f3c924e26b95f0faccfae69f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aitor=20P=C3=A9rez=20Cedres?= <1515757+Zerpet@users.noreply.github.com> Date: Wed, 27 Aug 2025 10:43:19 +0100 Subject: [PATCH 2/2] Use more precise language in comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .ci/ubuntu/one-node/21-enable-management-collector.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/ubuntu/one-node/21-enable-management-collector.conf b/.ci/ubuntu/one-node/21-enable-management-collector.conf index 913a49a..26710ae 100644 --- a/.ci/ubuntu/one-node/21-enable-management-collector.conf +++ b/.ci/ubuntu/one-node/21-enable-management-collector.conf @@ -1,3 +1,3 @@ -# This file might be required to test with images built from main. +# This file is required to test with images built from main. # Images in pivotalrabbitmq/rabbitmq disable the metrics collector by default. management_agent.disable_metrics_collector = false \ No newline at end of file