Skip to content

test(alerts): add unit tests for AlertDeriver.get_threshold(_async) - #313

Open
acailic wants to merge 1 commit into
mainfrom
issue-311-alert-deriver-tests
Open

test(alerts): add unit tests for AlertDeriver.get_threshold(_async)#313
acailic wants to merge 1 commit into
mainfrom
issue-311-alert-deriver-tests

Conversation

@acailic

@acailic acailic commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/alerts/test_alert_deriver_base.py covering AlertDeriver.get_threshold and get_threshold_async in collector/alerts/base.py, previously at 0% coverage on lines 44-50 and 68-74.
  • Covers: no policy getter, sync policy enabled/disabled/None, and async policy getter for both sync (returns default immediately, documented limitation) and async (awaits, returns threshold) call paths.

Fixes #311

Test plan

  • ruff check — passes on new file and collector/alerts/base.py
  • pytest -q -m 'not e2e' — 3116 passed, 34 skipped (all pre-existing)
  • New test file: 9/9 passed

🤖 Generated with Amplifier

Covers the sync/async policy-getter branches in collector/alerts/base.py
(lines 44-50, 68-74), which had zero direct test coverage: no policy
getter, sync policy enabled/disabled/None, and async policy getter
handling for both the sync and async threshold methods.

Fixes #311

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.

test: add unit tests for AlertDeriver.get_threshold/get_threshold_async (27% coverage)

1 participant