From aaf23c64c33b2e49a31cfb7bda0a5b71141289d6 Mon Sep 17 00:00:00 2001 From: Santiago Date: Sat, 6 Jul 2024 18:39:45 +0200 Subject: [PATCH] Alerting: Allow remote Alertmanager integration tests to fail (#88664) * Alerting: Allow remote Alertmanager integration tests to fail * format drone * rebase from main * the wait-for container needs canFail more than the acutal integration-tests container --------- Co-authored-by: Charandas Batra --- .drone.yml | 5 ++++- scripts/drone/steps/lib.star | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index b916487e018..ffaeb2f0592 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1137,6 +1137,7 @@ steps: environment: AM_TENANT_ID: test AM_URL: http://mimir_backend:8080 + failure: ignore image: golang:1.22.4-alpine name: remote-alertmanager-integration-tests trigger: @@ -2642,6 +2643,7 @@ steps: environment: AM_TENANT_ID: test AM_URL: http://mimir_backend:8080 + failure: ignore image: golang:1.22.4-alpine name: remote-alertmanager-integration-tests trigger: @@ -4534,6 +4536,7 @@ steps: environment: AM_TENANT_ID: test AM_URL: http://mimir_backend:8080 + failure: ignore image: golang:1.22.4-alpine name: remote-alertmanager-integration-tests trigger: @@ -5178,6 +5181,6 @@ kind: secret name: gcr_credentials --- kind: signature -hmac: c4a656d676b1228248f6948ac0347aea1d67016429aa24351d0a5c3e2d7dc617 +hmac: e296b5401c0632dc2549a2c3d0594a58c459f5d185376e9f1728ce75c1d8ff3c ... diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 6c7b29f80cb..2e74681eb7a 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -218,8 +218,8 @@ def validate_openapi_spec_step(): ], } -def dockerize_step(name, hostname, port): - return { +def dockerize_step(name, hostname, port, canFail = False): + step = { "name": name, "image": images["dockerize"], "commands": [ @@ -227,6 +227,11 @@ def dockerize_step(name, hostname, port): ], } + if canFail: + step["failure"] = "ignore" + + return step + def build_storybook_step(ver_mode): return { "name": "build-storybook", @@ -959,7 +964,7 @@ def publish_images_step(ver_mode, docker_repo, trigger = None): return step -def integration_tests_steps(name, cmds, hostname = None, port = None, environment = None): +def integration_tests_steps(name, cmds, hostname = None, port = None, environment = None, canFail = False): """Integration test steps Args: @@ -968,6 +973,7 @@ def integration_tests_steps(name, cmds, hostname = None, port = None, environmen hostname: the hostname where the remote server is available. port: the port where the remote server is available. environment: Any extra environment variables needed to run the integration tests. + canFail: controls whether the step can fail. Returns: A list of drone steps. If a hostname / port were provided, then a step to wait for the remove server to be @@ -988,6 +994,9 @@ def integration_tests_steps(name, cmds, hostname = None, port = None, environmen ] + cmds, } + if canFail: + step["failure"] = "ignore" + if environment: step["environment"] = environment @@ -1064,7 +1073,7 @@ def remote_alertmanager_integration_tests_steps(): "AM_URL": "http://mimir_backend:8080", } - return integration_tests_steps("remote-alertmanager", cmds, "mimir_backend", "8080", environment = environment) + return integration_tests_steps("remote-alertmanager", cmds, "mimir_backend", "8080", environment = environment, canFail = True) def memcached_integration_tests_steps(): cmds = [