(t *testing.T)
| 160 | } |
| 161 | |
| 162 | func TestAwfVersionInAwInfo(t *testing.T) { |
| 163 | tests := []struct { |
| 164 | name string |
| 165 | firewallEnabled bool |
| 166 | firewallVersion string |
| 167 | agentVersion string |
| 168 | expectedAwfVersion string |
| 169 | description string |
| 170 | }{ |
| 171 | { |
| 172 | name: "Firewall enabled with explicit version", |
| 173 | firewallEnabled: true, |
| 174 | firewallVersion: "v1.0.0", |
| 175 | expectedAwfVersion: "v1.0.0", |
| 176 | description: "Should use explicit firewall version", |
| 177 | }, |
| 178 | { |
| 179 | name: "Firewall enabled with default version", |
| 180 | firewallEnabled: true, |
| 181 | firewallVersion: "", |
| 182 | expectedAwfVersion: string(constants.DefaultFirewallVersion), |
| 183 | description: "Should use default firewall version when not specified", |
| 184 | }, |
| 185 | { |
| 186 | name: "Firewall disabled", |
| 187 | firewallEnabled: false, |
| 188 | firewallVersion: "", |
| 189 | agentVersion: "", |
| 190 | expectedAwfVersion: "", |
| 191 | description: "Should have empty awf_version when firewall is disabled", |
| 192 | }, |
| 193 | { |
| 194 | name: "sandbox.agent.version overrides firewall version", |
| 195 | firewallEnabled: true, |
| 196 | firewallVersion: "", |
| 197 | agentVersion: "v0.30.1", |
| 198 | expectedAwfVersion: "v0.30.1", |
| 199 | description: "Should prefer sandbox.agent.version override", |
| 200 | }, |
| 201 | } |
| 202 | |
| 203 | for _, tt := range tests { |
| 204 | t.Run(tt.name, func(t *testing.T) { |
| 205 | compiler := NewCompiler(WithVersion("1.0.0")) |
| 206 | registry := GetGlobalEngineRegistry() |
| 207 | engine, err := registry.GetEngine("copilot") |
| 208 | if err != nil { |
| 209 | t.Fatalf("Failed to get copilot engine: %v", err) |
| 210 | } |
| 211 | |
| 212 | workflowData := &WorkflowData{ |
| 213 | Name: "Test Workflow", |
| 214 | } |
| 215 | |
| 216 | if tt.firewallEnabled { |
| 217 | workflowData.NetworkPermissions = &NetworkPermissions{ |
| 218 | Firewall: &FirewallConfig{ |
| 219 | Enabled: true, |
nothing calls this directly
no test coverage detected