test(errors): add error path tests and fix log.write table concat #325
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/qpkg!325
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/error-path-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add error path tests verifying structured error tables across all modules. Fix bug in
log.writewhere passing error tables directly caused a concatenation error.Changes
Error path tests
Bug fix
log.writeconcatenatesmsgdirectly with... When msg is an error table (fromerrors.wrap_*), Lua's..operator raises "attempt to concatenate a table value" — it does not implicitly call__tostring. Fixed withtostring(msg).Testing
Closes #276
New commits pushed, approval review dismissed automatically according to repository settings
Approved. Bug fix in log.write (tostring(msg)) is correct and necessary. build.lua os.execute improvement is solid. All 7 error path test sub-tasks covered. Tests pass 90/90 with luacheck clean.
Review: APPROVED ✅
This PR adds comprehensive error path tests and fixes a critical bug in
log.write.Bug Fixes:
log.lua:63: Addedtostring(msg)to handle error table concatenationbuild.lua:205-206: Now checksexitcode ~= 0for command failuresTest Coverage: 93 new tests covering validate, pkgdef loader, build, and hash modules
All tests passing (luacheck: 0/0, old harness: 56/56, busted: 90/90).
Recommendation: MERGE
Review — Approved
Solid PR. Error path tests add meaningful coverage. Bug fix in
log.write(tostring(msg)) is correct — error tables have__tostringdefined inerrors/init.lua, sotostringproperly invokes the metamethod instead of raising a concat error.The
build.run_stageos.executechange is correct for LuaJIT/Lua 5.1 (captures numeric exit code;not ok or exitcode ~= 0is a safe guard).Tests pass: 90/90.
Suggestions
build.lua:38—extract_archivestill uses old single-returnos.executepattern. Works correctly but inconsistent with the updatedrun_stage. Filed as #327.