Skip to content

Refactor agent tests to integration style via main(root="/")#42

Merged
elcamlost merged 1 commit into
mainfrom
ir-refactor-tests
Mar 29, 2026
Merged

Refactor agent tests to integration style via main(root="/")#42
elcamlost merged 1 commit into
mainfrom
ir-refactor-tests

Conversation

@elcamlost
Copy link
Copy Markdown
Owner

Wrap all module-level agent logic in main(root="/") so the script is importable without side effects. Propagate root to discover_fpm and parse_includes for filesystem isolation. Replace unit tests with integration tests that call main() directly against a fake /proc tree and patched sockets, giving full coverage without subprocess tricks.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@elcamlost elcamlost force-pushed the ir-refactor-tests branch 2 times, most recently from 7f57c45 to 5638a48 Compare March 29, 2026 18:12
Wrap all module-level agent logic in main(root="/") so the script is
importable without side effects. Propagate root to discover_fpm and
parse_includes for filesystem isolation. Replace unit tests with
integration tests that call main() directly against a fake /proc tree
and patched sockets, giving full coverage without subprocess tricks.

Also I've used this change as an opportunity to refactor agent internals.
Now the contract is we have main function that prints metrics and the internals
can be easily adjust and the logic is covered by the tests.
@elcamlost elcamlost merged commit 1781d5d into main Mar 29, 2026
6 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.

1 participant