Skip to content

Fix CI, add 147 tests, clean up code duplication#173

Merged
GangGreenTemperTatum merged 2 commits intomainfrom
overhaul/ci-tests-cleanup
Feb 24, 2026
Merged

Fix CI, add 147 tests, clean up code duplication#173
GangGreenTemperTatum merged 2 commits intomainfrom
overhaul/ci-tests-cleanup

Conversation

@GangGreenTemperTatum
Copy link
Collaborator

@GangGreenTemperTatum GangGreenTemperTatum commented Feb 24, 2026

Summary

  • Fix CI: Regenerate poetry.lock to resolve out-of-sync dependency issue; disable python version updates in Renovate config
  • Code cleanup: Extract duplicated utils (sizeof_fmt, delta_fmt, count_package_prefixes) into dyana/utils.py; extract SECURITY_EVENTS into dyana/constants.py; replace module-level docker.from_env() with lazy _get_client() to prevent import-time crashes without Docker; guard Loader import with TYPE_CHECKING; fix unhashable dict bug in view_security_events; remove dead commented-out code
  • Test coverage: Add 155 tests across 9 test files (up from 5 tests in 1 file) covering CLI, utils, docker, view, view_legacy, tracee, loader, settings, and base/dyana modules
  • Pre-commit: Add .pre-commit-config.yaml with ruff linter/formatter and pre-commit-hooks

Test plan

  • CI passes on all 3 Python versions (3.10, 3.11, 3.12)
  • ruff check dyana — lint clean
  • mypy --ignore-missing-imports --no-error-summary dyana — type check clean
  • pytest dyana -v — all 155 tests pass
  • CLI tested: --help, trace --help, summary --help, summary with modern/legacy traces
  • Import chain verified: view.py, view_legacy.py, docker.py, loader.py, tracee.py all import without Docker daemon

🤖 Generated with Claude Code

@dreadnode-renovate-bot dreadnode-renovate-bot bot added area/pre-commit Changes made to pre-commit hooks area/github Changes made to GitHub Actions labels Feb 24, 2026
- Regenerate poetry.lock to fix CI sync issue
- Disable python version updates in Renovate config
- Extract shared utils (sizeof_fmt, delta_fmt, count_package_prefixes) into dyana/utils.py
- Extract SECURITY_EVENTS constant into dyana/constants.py
- Replace module-level docker.from_env() with lazy _get_client() to prevent
  import-time crashes in CI (no Docker daemon required at import time)
- Guard Loader import in view.py with TYPE_CHECKING to break unnecessary import chain
- Fix unhashable dict bug in view_security_events (set comprehension → list)
- Remove dead commented-out code from tracee.py, loader.py, pip/main.py
- Add comprehensive test suite: 155 tests across 9 test files covering cli,
  utils, docker, view, view_legacy, tracee, loader, settings, and base/dyana
- Add .pre-commit-config.yaml with ruff and pre-commit-hooks
- Expand settings_test.py with 12 additional edge case tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rich/Typer emits ANSI color codes in CI, causing string assertions
on --help output to fail. Strip them before matching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GangGreenTemperTatum GangGreenTemperTatum merged commit d6b6d09 into main Feb 24, 2026
4 checks passed
@GangGreenTemperTatum GangGreenTemperTatum deleted the overhaul/ci-tests-cleanup branch February 24, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/github Changes made to GitHub Actions area/pre-commit Changes made to pre-commit hooks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant