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 <charandas.batra@grafana.com>
This commit is contained in:
Santiago 2024-07-06 18:39:45 +02:00 committed by GitHub
parent e061f2886f
commit aaf23c64c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 5 deletions

View File

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

View File

@ -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 = [