Review PR #325 - Error path tests and log.write bug fix #326

Open
opened 2026-07-10 07:41:25 +00:00 by the.auditor · 0 comments
Owner

Review Summary

Overall: APPROVED

This PR addresses issue #276 with comprehensive error path tests and a critical bug fix.

Changes:

  1. log.lua:63 - Fixed concatenation bug: tostring(msg) added to handle error tables
  2. build.lua:205-206 - Now checks exitcode ~= 0 for proper command failure detection
  3. test_qpkg_spec.lua - Added 93 lines of error path tests

Test Results:

  • luacheck: 0 warnings, 0 errors
  • Old harness: 56/56 pass
  • busted: 90/90 pass

Coverage:

  • validate.version_string: nil/invalid inputs → VALIDATION_ERROR
  • validate.pkgdef: Missing fields, bad versions → VALIDATION_ERROR
  • validate.srcuri: nil/empty → VALIDATION_ERROR
  • pkgdef loader: Template loading, file errors, syntax errors
  • build.run_stage/run_all_stages: Failing commands return BUILD_ERROR
  • hash.verify: Hash mismatch returns HASH_MISMATCH

Recommendation: MERGE

Solid, well-tested PR with critical bug fix.

**Review Summary** **Overall: APPROVED** This PR addresses issue #276 with comprehensive error path tests and a critical bug fix. **Changes:** 1. **log.lua:63** - Fixed concatenation bug: `tostring(msg)` added to handle error tables 2. **build.lua:205-206** - Now checks `exitcode ~= 0` for proper command failure detection 3. **test_qpkg_spec.lua** - Added 93 lines of error path tests **Test Results:** - luacheck: 0 warnings, 0 errors - Old harness: 56/56 pass - busted: 90/90 pass **Coverage:** - validate.version_string: nil/invalid inputs → VALIDATION_ERROR - validate.pkgdef: Missing fields, bad versions → VALIDATION_ERROR - validate.srcuri: nil/empty → VALIDATION_ERROR - pkgdef loader: Template loading, file errors, syntax errors - build.run_stage/run_all_stages: Failing commands return BUILD_ERROR - hash.verify: Hash mismatch returns HASH_MISMATCH **Recommendation: MERGE** Solid, well-tested PR with critical bug fix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/qpkg#326
No description provided.