Skip to content

test(alerts): cover alert lifecycle and rendering - #70

Merged
mabd-dev merged 2 commits into
mabd-dev:mainfrom
frittlechasm:test/alerts-coverage
Sep 6, 2026
Merged

test(alerts): cover alert lifecycle and rendering#70
mabd-dev merged 2 commits into
mabd-dev:mainfrom
frittlechasm:test/alerts-coverage

Conversation

@frittlechasm

@frittlechasm frittlechasm commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Adds test coverage for the TUI alerts package as part of #63.

Changes Made

  • Added tests for alert creation, queuing, expiration, and timer handling
  • Added tests for alert positioning, visibility, colors, icons, and rendered content
  • Added clearly documented coverage-only tests for simple and defensive code paths

Testing

  • Tested locally with example workflows
  • Added new tests (if applicable)
  • Tested with different filters, output, etc...

Commands run:

go test -race -cover ./internal/render/tui/alerts/

Checklist

  • I have starred the repository
  • My code follows the project's code style
  • I have updated the documentation (README, cli-flags, etc...)
  • My changes generate no new warnings
  • I have tested my changes in a real workflow
  • All tests pass locally

Greptile Summary

Adds comprehensive package-level tests for TUI alert behavior without changing production code.

  • Covers queueing, expiration, timer scheduling, and ignored messages.
  • Verifies alert positioning, overflow visibility, theme updates, colors, icons, and rendered content.
  • The alert tests completed successfully across repeated normal and race-enabled runs, with full statement coverage.

Confidence Score: 5/5

Safe to merge; the added tests behave reliably under repeated execution and race detection.

No actionable issues were identified. Repeated alert-package test runs, race-enabled runs, and atomic coverage validation all completed successfully.

Files Needing Attention: None.

T-Rex T-Rex Logs

What T-Rex did

  • Validated the pre-PR baseline by running trex-artifacts/validate-alert-tests.sh and confirming the baseline commit 2512196^ had no alert-test files and exited successfully.
  • Ran the alert-package tests 100 times and executed race-detection 25 times; all runs passed, no data races were reported, and per-test output for added lifecycle, layout, rendering, theme, and timer checks was retained.
  • Executed atomic race coverage and confirmed all alert-package statements were covered.

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "test(alerts): organize coverage around b..." | Re-trigger Greptile

Context used:

@mabd-dev
mabd-dev merged commit 87c873d into mabd-dev:main Sep 6, 2026
4 checks passed
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.

2 participants