Files
nexarch/workflow/internal/pflichttestgate/gate_test.go
T
patrickandClaude Sonnet 5.5 df9581cf45
DB-Integrationstests / db-tests (pull_request) Canceled after 0s
CI / Core-Modul (Build/Vet/Test) (push) Successful in 38s
CI / DMS Security-Test-Gate (AC5, Merge-Gate) (push) Successful in 3s
CI / Connect Security-Test-Gate (QA-01 AC4, Merge-Gate) (push) Successful in 2s
CI / DMS-Modul Supply-Chain-Scan (govulncheck) (push) Failing after 12s
CI / Web-Barrierefreiheitspruefung (axe, Tastatur, Reflow, Textabstaende) (push) Failing after 29s
CI / Core-Modul (Build/Vet/Test) (pull_request) Successful in 39s
CI / DMS Security-Test-Gate (AC5, Merge-Gate) (pull_request) Successful in 2s
CI / Web-Barrierefreiheitspruefung (axe, Tastatur, Reflow, Textabstaende) (pull_request) Canceled after 0s
CI / Web (dms-browser) (push) Failing after 52s
CI / Web (pdf-viewer) (push) Failing after 37s
CI / Web (shl) (push) Failing after 8s
CI / Web (dms-browser) (pull_request) Failing after 55s
CI / Web (pdf-viewer) (pull_request) Failing after 39s
CI / Web (shl) (pull_request) Failing after 7s
CI / Connect Security-Test-Gate (QA-01 AC4, Merge-Gate) (pull_request) Successful in 2s
CI / DMS-Modul Supply-Chain-Scan (govulncheck) (pull_request) Failing after 14s
common Pflichttest-Gate / pflichttest-gate (pull_request) Successful in 19m7s
Supply-Chain-Scan (Go) / govulncheck (push) Failing after 1m1s
Core-Schnittstellen-Vertragstests / contract-tests (pull_request) Successful in 18m45s
Supply-Chain-Scan (npm) / npm-audit (pull_request) Failing after 1m13s
Core-Pflichttest-Gate / pflichttest-gate (pull_request) Successful in 18m28s
Supply-Chain-Scan (Go) / govulncheck (pull_request) Failing after 38s
RBAC-Rollenhierarchie-Pflichtgate / rbac-policy-invariant (pull_request) Successful in 18m16s
Workflow-Pflichttest-Gate / pflichttest-gate (pull_request) Successful in 18m10s
CI / DMS-Modul (Lint/Build/Test/Coverage/Artefakt) (push) Failing after 4s
CI / DMS-Modul (Lint/Build/Test/Coverage/Artefakt) (pull_request) Failing after 3s
workflow, connect: bearerauth aus common/bearerauth
Die beiden gleichen Kopien entfallen; common v0.2.2. Das Testpflicht-Muster
fuer bearerauth wandert vom workflow-Gate in das common-Gate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 23:41:06 +01:00

48 lines
1.6 KiB
Go

// Negativtest des Gates selbst (QA-01 Pruefung 1): ein Diff mit
// geaenderter workflow/internal/moduleadapter/moduleadapter.go ohne begleitende
// Testdatei muss als Verstoss erkannt werden.
package pflichttestgate
import "testing"
func TestCheckDiff_FlagsSensitiveChangeWithoutTest(t *testing.T) {
violations := CheckDiff([]string{"workflow/internal/moduleadapter/moduleadapter.go"})
if len(violations) != 1 {
t.Fatalf("erwartet genau 1 verstoss, habe %d: %+v", len(violations), violations)
}
if violations[0].Package != "workflow/internal/moduleadapter" {
t.Fatalf("falsches package gemeldet: %+v", violations[0])
}
}
func TestCheckDiff_PassesWhenTestFileAccompanies(t *testing.T) {
violations := CheckDiff([]string{
"workflow/internal/moduleadapter/moduleadapter.go",
"workflow/internal/moduleadapter/moduleadapter_test.go",
})
if len(violations) != 0 {
t.Fatalf("erwartet keine verstoesse, habe: %+v", violations)
}
}
func TestCheckDiff_IgnoresNonSensitivePaths(t *testing.T) {
violations := CheckDiff([]string{"workflow/internal/caseobj/caseobj.go"})
if len(violations) != 0 {
t.Fatalf("erwartet keine verstoesse fuer nicht-sensiblen pfad, habe: %+v", violations)
}
}
func TestCheckDiff_CoversAllSensitivePackages(t *testing.T) {
files := []string{
"workflow/internal/moduleadapter/x.go",
"workflow/internal/backchannel/x.go",
"workflow/internal/backchannelapi/x.go",
"workflow/internal/dualcheck/x.go",
"workflow/internal/delegation/x.go",
}
violations := CheckDiff(files)
if len(violations) != len(files) {
t.Fatalf("erwartet %d verstoesse (je package einer), habe %d: %+v", len(files), len(violations), violations)
}
}