From 2de700733370b22797ff71667f68c119951c3194 Mon Sep 17 00:00:00 2001 From: Crash Over Burn Date: Wed, 15 Apr 2026 00:54:46 +0000 Subject: Add bisect_ppx test coverage infrastructure with CI workflow and test suites Integrate bisect_ppx for code coverage across the test suite: - Add bisect_ppx instrumentation to lib/dune and test/dune - Add bisect_ppx dependency to dune-project, nixtamal.opam, and nix/package/nixtamal.nix - Create bisect.yml configuration for HTML and text coverage reports - Add .github/workflows/coverage.yml for CI-based coverage reporting - Fix flake.nix devShell to include checkInputs for full development environment - Add coverage checks to flake.nix checks output New test suites for recently ported features: - test/test_upgrade.ml: Tests for schema upgrade command (backup, dry-run, version validation) - test/test_fossil.ml: Tests for Fossil VCS codec and lockfile roundtrips - test/test_lockfile.ml: Tests for lockfile auto-creation and serialization - test/test_main.ml: Register all new test suites Documentation updates: - AGENTS.md: Add contact info (website, XMPP MUC), note llm/ folder is gitignored - README.asciidoc: Add website link, mention Fossil VCS, schema versioning, upgrade command - .gitignore: Add _build/ and _coverage/ directories Covers testing for previously ported features: schema upgrade, Fossil VCS support, and lockfile auto-creation. --- flake.nix | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 115a9d1..e603e31 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,7 @@ # Development shell using the same approach as shell.nix devShell = pkgs.mkShell { - buildInputs = nixtamalPkg.buildInputs or []; + buildInputs = (nixtamalPkg.buildInputs or []) ++ (nixtamalPkg.checkInputs or []); nativeBuildInputs = nixtamalPkg.nativeBuildInputs or []; }; in @@ -47,6 +47,32 @@ checks = { # Basic check that the package builds nixtamal-build = nixtamalPkg; + + # Explicit test check + nixtamal-test = nixtamalPkg; + + # Coverage instrumentation sanity check + nixtamal-coverage = pkgs.runCommand "nixtamal-coverage-check" + { + nativeBuildInputs = (nixtamalPkg.nativeBuildInputs or [ ]) + ++ (nixtamalPkg.buildInputs or [ ]) + ++ (with pkgs.ocamlPackages; [ + bisect_ppx + dune_3 + ]); + } + '' + export HOME="$TMPDIR" + cp -r ${nixtamalPkg.src} source + chmod -R u+w source + cd source + + BISECT_ENABLE=YES dune runtest --instrument-with bisect_ppx --force + bisect-ppx-report summary --coverage-path _build/default/test > coverage-summary.txt + + mkdir -p "$out" + cp coverage-summary.txt "$out"/ + ''; }; # Library outputs for ecosystem integration @@ -78,4 +104,4 @@ default = self.apps.${system}.nixtamal; }; }); -} \ No newline at end of file +} -- cgit v1.2.3