Skip to content

test: raise non-generated Lua coverage to ≥90% (issue #45)#46

Merged
levleontiev merged 3 commits intomainfrom
feature/issue-45-coverage-90-fresh
Mar 16, 2026
Merged

test: raise non-generated Lua coverage to ≥90% (issue #45)#46
levleontiev merged 3 commits intomainfrom
feature/issue-45-coverage-90-fresh

Conversation

@levleontiev
Copy link
Contributor

Summary

  • Adds targeted unit coverage across 10 spec files; zero runtime code changes
  • Raises non_generated coverage from ~87.6% → 91.62%
  • All per-module coverage now ≥ 90%

Coverage delta (key modules)

Module Before After
decision_api.lua 75.43% 91.12%
bundle_loader.lua 86.73% 90.42%
cost_budget.lua 89.15% ≥90%
cost_extractor.lua 89.74% ≥90%
overall non-generated ~87.6% 91.62%

Approach

All new tests use targeted direct coverage: describe blocks appended after the existing Gherkin runner call. For decision_api_spec and bundle_loader_spec, internal helper functions are reached via debug.getupvalue — a standard LuaJIT testing pattern that avoids exposing internals in the production API.

Test plan

  • busted spec/unit/ → 631 successes / 0 failures / 0 errors
  • busted spec/integration/ → 65 successes / 0 failures / 0 errors
  • pytest tests/e2e -v → 44 passed
  • bin/ci/run_lua_coverage.sh → 696 successes, non-generated coverage: 91.62%

Closes #45

🤖 Generated with Claude Code

@levleontiev levleontiev merged commit c1b8741 into main Mar 16, 2026
8 checks passed
@levleontiev levleontiev deleted the feature/issue-45-coverage-90-fresh branch March 16, 2026 16:36
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.

test: increase non-generated Lua test coverage to 90%

2 participants