Skip to content

Add Prometheus AlertManager alert provider with full test coverage#592

Open
bosmanx wants to merge 1 commit intojantman:developfrom
bosmanx:alertmanager-tests
Open

Add Prometheus AlertManager alert provider with full test coverage#592
bosmanx wants to merge 1 commit intojantman:developfrom
bosmanx:alertmanager-tests

Conversation

@bosmanx
Copy link
Copy Markdown

@bosmanx bosmanx commented Nov 5, 2025

Summary

This PR adds comprehensive test coverage to complete PR #515 by @varuzam.

The original PR #515 implements the AlertManager alert provider with support for:

  • Single and multiple AlertManager endpoints
  • Environment variable and parameter-based configuration
  • Basic authentication
  • Alert sending with configurable duration

This PR adds the missing unit tests (16 comprehensive tests) to allow the feature to be merged.

Minor fix: endpoints parameter was incorrectly required in __init__ - now properly optional when using environment variables.

Pull Request Checklist

  • All pull requests should be against the develop branch, not master.
  • All pull requests must include the Contributor License Agreement (see below).
  • Whether or not your PR includes unit tests:
    • Please make sure you have run the exact code contained in the PR locally, and it functions as desired.
    • Please make sure the TravisCI build passes or, if not, you've corrected any obvious problems identified by the tests.
  • Code should conform to the Development Guidelines:
    • pep8 compliant with some exceptions (see pytest.ini)
    • 100% test coverage with pytest (with valid tests) - 16 tests covering all AlertManager functionality
    • Complete, correctly-formatted documentation for all classes, functions and methods.
    • documentation has been rebuilt with tox -e docs (requires Python 3.9, will be handled by CI)
    • Connections to the AWS services - N/A (AlertManager is an alert provider, not AWS service)
    • All modules should have (and use) module-level loggers.
    • Commit messages should be meaningful, and reference the Issue number
    • Git history is fully intact; please do not squash or rewrite history.

Contributor License Agreement

By submitting this work for inclusion in awslimitchecker, I agree to the following terms:

  • The contribution included in this request (and any subsequent revisions or versions of it)
    is being made under the same license as the awslimitchecker project (the Affero GPL v3,
    or any subsequent version of that license if adopted by awslimitchecker).
  • My contribution may perpetually be included in and distributed with awslimitchecker; submitting
    this pull request grants a perpetual, global, unlimited license for it to be used and distributed
    under the terms of awslimitchecker's license.
  • I have the legal power and rights to agree to these terms.

- Add AlertManager class supporting single/multiple endpoints
- Support environment variables and parameters for configuration
- Add basic authentication support
- Implement 16 comprehensive tests covering all functionality
- Fix optional endpoints parameter (was incorrectly required)

Based on PR jantman#515 by varuzam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant