Skip to content

test: add rows_read accounting and silent-failure regression tests#44

Merged
Coding-Dev-Tools merged 4 commits into
masterfrom
improve/datamorph-20260630
Jul 3, 2026
Merged

test: add rows_read accounting and silent-failure regression tests#44
Coding-Dev-Tools merged 4 commits into
masterfrom
improve/datamorph-20260630

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Summary

Add regression tests for ConversionResult.rows_read accounting and silent-failure detection.

Changes

  • tests/test_rows_read_accounting.py: Tests that convert() properly populates rows_read and that conversions which read rows but wrote none are not reported as success.

Testing

CI will run test/coverage/security jobs on this branch.

- Add protobuf>=7.34.1 as core dependency (was optional 'full' extra)
- Update pytest to >=9.1.0 (was 9.0.3)
- Update ruff to >=0.15.20 (was 0.4.0)
- Remove 'full' extra since protobuf is now core

All 130 tests pass and ruff checks pass.
Regression coverage for the bug where convert() declared rows_read on
ConversionResult but never populated it (always 0), and where a
conversion that read rows yet wrote none was reported as success.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🤖 Automated Code Review

✅ Ruff Lint — No issues

⚠️ Ruff Format — Formatting needed

Would reformat: conftest.py
Would reformat: src/datamorph/cli.py
Would reformat: src/datamorph/converters.py
Would reformat: tests/test_cli_error_paths.py
Would reformat: tests/test_converters.py
Would reformat: tests/test_edge_cases.py
Would reformat: tests/test_validate.py
7 files would be reformatted, 3 files already formatted

✅ Secret Detection — Clean

✅ Large Files — Within limits

📊 Diff Stats — 2 file(s) changed

 src/datamorph/converters.py        |  26 +++++++-
 tests/test_rows_read_accounting.py | 126 +++++++++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 2 deletions(-)

Verdict: ⚠️ Warnings — Lint/format issues found. Recommend fixing before merge.

Automated by Coding-Dev-Tools/.github reusable workflow.

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner Author

[Blocked — failing tests] The 4 new tests in tests/test_rows_read_accounting.py fail against the current converter — result.rows_read is 0 where the tests expect the input row count (assert 0 == 2), and the silent-failure detection test doesn't trip. These are valuable regression tests for the silent-failure class, but they need the accompanying rows_read accounting implemented in the conversion path first. Ran locally: 4 failed, 131 passed. Not merging until the implementation lands and the suite is green.

cowork-bot added 2 commits July 3, 2026 19:43
… in convert()

Wraps the source stream in a counter so ConversionResult.rows_read reflects rows
actually pulled (accurate even on partial reads via finally), and flags the
silent-failure case (rows read but none written, no exception) as an error.
Makes the 4 regression tests in test_rows_read_accounting.py pass.
@Coding-Dev-Tools Coding-Dev-Tools merged commit feed3f0 into master Jul 3, 2026
@Coding-Dev-Tools Coding-Dev-Tools deleted the improve/datamorph-20260630 branch July 3, 2026 23:43
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