Skip to content

Instantly share code, notes, and snippets.

@evnsio
Last active July 12, 2019 14:26
Show Gist options
  • Save evnsio/6fc5a0c2c642e7b45d19a0a20cbb9622 to your computer and use it in GitHub Desktop.
Save evnsio/6fc5a0c2c642e7b45d19a0a20cbb9622 to your computer and use it in GitHub Desktop.
import pytest
import os
TEST_CASES = [
("alertname=SomeAlert", "some-alert-receiver"),
("owner=platform severity=warning", "slack-platform-alerts"),
("owner=platform severity=critical", "pagerduty-platform-team"),
("severity=info", "slack-monitoring"),
("severity=warning", "slack-monitoring,pd-platform-warning"),
("severity=critical", "slack-monitoring,pd-platform-critical"),
]
@pytest.mark.parametrize("labels,receivers", TEST_CASES)
def test_routing(labels, receivers):
cmd = f"amtool config routes test --config.file=./am-config.yaml --verify.receivers={receivers} {labels}"
exit_code = os.system(cmd)
assert exit_code == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment