Skip to content

refactor(main): extract run() for testability#54

Merged
feloy merged 1 commit into
mainfrom
main-refactor
Jun 2, 2026
Merged

refactor(main): extract run() for testability#54
feloy merged 1 commit into
mainfrom
main-refactor

Conversation

@feloy

@feloy feloy commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

main() contained the full build pipeline with process::exit on every error, making it impossible to call from tests. This extracts run() with a Result return type and injectable runner and workspace base, then adds four tests covering the orchestration path.

Also changes build_policy() to return Result instead of calling process::exit internally.

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.87879% with 12 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@8763dd1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/main.rs 87.36% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #54   +/-   ##
=======================================
  Coverage        ?   87.32%           
=======================================
  Files           ?       16           
  Lines           ?     2257           
  Branches        ?        0           
=======================================
  Hits            ?     1971           
  Misses          ?      286           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

main() contained the full build pipeline with process::exit on every
error, making it impossible to call from tests. This extracts run()
with a Result return type and injectable runner and workspace base,
then adds four tests covering the orchestration path.

Also changes build_policy() to return Result instead of calling
process::exit internally.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@feloy feloy merged commit 5d0236f into main Jun 2, 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