MCPcopy Create free account
hub / github.com/github/gh-aw / TestCleanFirewallDirsStepOrdering

Function TestCleanFirewallDirsStepOrdering

pkg/workflow/threat_detection_test.go:1825–1851  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1823}
1824
1825func TestCleanFirewallDirsStepOrdering(t *testing.T) {
1826 compiler := NewCompiler()
1827
1828 data := &WorkflowData{
1829 SafeOutputs: &SafeOutputsConfig{
1830 ThreatDetection: &ThreatDetectionConfig{},
1831 },
1832 }
1833
1834 steps := compiler.buildDetectionJobSteps(data)
1835 stepsString := strings.Join(steps, "")
1836
1837 cleanIdx := strings.Index(stepsString, "Clean stale firewall files from agent artifact")
1838 guardIdx := strings.Index(stepsString, "Check if detection needed")
1839
1840 if cleanIdx < 0 {
1841 t.Fatal("Expected 'Clean stale firewall files from agent artifact' step")
1842 }
1843 if guardIdx < 0 {
1844 t.Fatal("Expected 'Check if detection needed' step")
1845 }
1846
1847 // The cleanup step must come before the detection guard
1848 if cleanIdx > guardIdx {
1849 t.Error("Cleanup firewall dirs step should appear before detection guard step")
1850 }
1851}
1852
1853func TestBuildDetectionJobStepsCodexExternalDetectorIncludesContainerDownload(t *testing.T) {
1854 // Regression test: when engine=codex and gh-aw-detection feature is enabled (external

Callers

nothing calls this directly

Calls 3

NewCompilerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected