test: add coverage for missing finished_at key in pipeline data #10
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-dora-exporter!10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/failure-detection-nits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add test coverage for when a pipeline dict has no
finished_atkey at all (not just zero -- completely missing). The collector already handles this gracefully via.get("finished_at", 0), but no test verified the behavior.Changes
tests/test_woodpecker_failure.py: Addedtest_failure_with_missing_finished_at_ignored-- constructs a pipeline dict withoutfinished_atkey, verifies no KeyError is raised and the failure timestamp gauge stays at 0.Test Plan
python -m pytest tests/ -v)Related
🤖 Generated with Claude Code
PR #10 Review
DOMAIN REVIEW
Stack: Python / pytest / prometheus_client / asyncio
Scope: 1 file changed (
tests/test_woodpecker_failure.py), +34/-16New test (
test_failure_with_missing_finished_at_ignored):finished_atkey at all (not zero, not None -- absent)test_failure_with_zero_finished_at_ignoredtestRuff reformatting (remaining hunks):
.labels(repo=..., tier=...)calls collapsed to single lines (within line length)assertline wrapped into parenthesized formBLOCKERS
None.
NITS
None. The test is well-structured and the ruff reformatting is consistent.
SOP COMPLIANCE
test: add coverage for missing finished_at key in pipeline data)PROCESS OBSERVATIONS
VERDICT: APPROVED