Skip to content

Add Lua test coverage reporting (luacov + CI integration) #24

@levleontiev

Description

@levleontiev

Summary

Add Lua source coverage measurement via luacov so we can track which branches in src/fairvisor/*.lua are exercised by unit and integration tests.

Motivation

Currently CI runs busted spec/unit/ spec/integration/ (497 tests) but does not measure coverage. Python e2e pytest-cov measures test infrastructure — not useful. The only meaningful coverage metric for fairvisor is Lua coverage from busted.

Acceptance Criteria

  • luacov installed in docker/Dockerfile.test
  • bin/ci/run_lua_tests.sh runs busted --coverage spec/unit/ spec/integration/ and generates luacov.report.out
  • CI job uploads coverage artifact
  • (stretch) Coverage badge in README.md via codecov.io or shields.io
  • Existing CI job coverage-report updated to use Lua coverage instead of Python e2e coverage (which measures test infrastructure, not business logic)

Implementation Notes

  • busted --coverage flag requires luarocks install luacov
  • For badge: luacov-cobertura converts luacov.stats.out → Cobertura XML → upload to codecov.io → badge URL
  • Alternative lighter approach: parse luacov.report.out in CI and post summary as step output

Out of scope

  • Python e2e coverage (removed from scope — those files are tests themselves)
  • Per-file coverage gating (just reporting for now)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions