feat: extract coverage-gate action from Cue for reuse across projects
- Move coveragegate tool from cue/tools to vociferate/coverage-gate - Create composite action with JSON metrics output for CI - Update tool to export passes/total_coverage/packages_checked/packages_failed - Support per-package threshold policy via JSON configuration - Change module path to git.hrafn.xyz/aether/vociferate/coverage-gate
This commit is contained in:
26
coverage-gate/integration_test.go
Normal file
26
coverage-gate/integration_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRun_ExitCodeOnInvalidProfile(t *testing.T) {
|
||||
t.Parallel()
|
||||
tmp := t.TempDir()
|
||||
policyPath := filepath.Join(tmp, "policy.json")
|
||||
if err := os.WriteFile(policyPath, []byte(`{"minimum_statement_coverage":80,"critical_packages":[]}`), 0600); err != nil {
|
||||
t.Fatalf("write policy: %v", err)
|
||||
}
|
||||
|
||||
exit := run(
|
||||
[]string{"--profile", filepath.Join(tmp, "missing.out"), "--policy", policyPath, "--src-root", "."},
|
||||
os.Stdout,
|
||||
os.Stderr,
|
||||
func(_ string) ([]string, error) { return []string{"git.hrafn.xyz/aether/cue/service/llm"}, nil },
|
||||
)
|
||||
if exit != 1 {
|
||||
t.Fatalf("expected exit 1 for missing profile, got %d", exit)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user