(t *testing.T)
| 1823 | } |
| 1824 | |
| 1825 | func 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 | |
| 1853 | func TestBuildDetectionJobStepsCodexExternalDetectorIncludesContainerDownload(t *testing.T) { |
| 1854 | // Regression test: when engine=codex and gh-aw-detection feature is enabled (external |
nothing calls this directly
no test coverage detected