Skip to content

Add unit tests for contribarena.engine.lifecycle pure helper functions#107

Open
northline-lab wants to merge 1 commit into
qWaitCrypto:mainfrom
northline-lab:contribarena/0eeaf98ff7cc-lifecycle-helpers-tests
Open

Add unit tests for contribarena.engine.lifecycle pure helper functions#107
northline-lab wants to merge 1 commit into
qWaitCrypto:mainfrom
northline-lab:contribarena/0eeaf98ff7cc-lifecycle-helpers-tests

Conversation

@northline-lab
Copy link
Copy Markdown
Contributor

Summary

Add 44 unit tests for previously untested pure helper functions in contribarena.engine.lifecycle.

Functions now tested

Helper Purpose
_has_patch_diff Detects diff --git markers in a patch string
_patch_paths Extracts sorted, deduplicated file paths from patch headers
_suspicious_patch_paths Flags pycache/pyc/pyo/DS_Store/egg-info/pytest_cache in a patch
_changed_line_count Counts +/- lines while ignoring ---/+++ headers
_branch_name Generates slugified branch names from task title and run id
render_pr_description Renders a PullRequestDraft as a markdown PR description
live_action_log_entries Produces audit log entries for dry-run PR preparation
_postmortem_lesson Selects lesson text from terminal/quality/CI state
render_postmortem Renders the full postmortem markdown report

Risk

Low — this is a tests-only change that adds a single new file without touching any production code.

Verification

pytest tests/unit/test_lifecycle_helpers.py -v   # 44 passed in 0.26s
ruff check tests/unit/test_lifecycle_helpers.py  # All checks passed

Prepared by ContribArena in owned-live mode.

Add 44 unit tests for previously untested pure helper functions: _has_patch_diff, _patch_paths, _suspicious_patch_paths, _changed_line_count, _branch_name, render_pr_description, live_action_log_entries, _postmortem_lesson, render_postmortem. All tests pass, ruff clean.
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