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

Function TestShouldSkipFirewallWorkflow

pkg/workflow/resolve_test.go:267–319  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

265}
266
267func TestShouldSkipFirewallWorkflow(t *testing.T) {
268 tests := []struct {
269 name string
270 workflowName string
271 featureValue string
272 shouldSkip bool
273 }{
274 {
275 name: "regular workflow without firewall feature",
276 workflowName: "weekly-research",
277 featureValue: "",
278 shouldSkip: false,
279 },
280 {
281 name: "firewall workflow without firewall feature",
282 workflowName: "dev.firewall",
283 featureValue: "",
284 shouldSkip: true,
285 },
286 {
287 name: "firewall workflow with firewall feature enabled",
288 workflowName: "dev.firewall",
289 featureValue: "firewall",
290 shouldSkip: false,
291 },
292 {
293 name: "firewall workflow with multiple features including firewall",
294 workflowName: "test.firewall.workflow",
295 featureValue: "feature1,firewall,feature2",
296 shouldSkip: false,
297 },
298 {
299 name: "regular workflow with firewall feature enabled",
300 workflowName: "daily-plan",
301 featureValue: "firewall",
302 shouldSkip: false,
303 },
304 }
305
306 for _, tt := range tests {
307 t.Run(tt.name, func(t *testing.T) {
308 // Set the environment variable
309 if tt.featureValue != "" {
310 t.Setenv("GH_AW_FEATURES", tt.featureValue)
311 }
312
313 result := shouldSkipFirewallWorkflow(tt.workflowName)
314 assert.Equal(t, tt.shouldSkip, result,
315 "shouldSkipFirewallWorkflow(%q) with GH_AW_FEATURES=%q should return %v",
316 tt.workflowName, tt.featureValue, tt.shouldSkip)
317 })
318 }
319}
320
321func TestFindWorkflowName(t *testing.T) {
322 workflowsDir := setupWorkflowDir(t)

Callers

nothing calls this directly

Calls 3

SetenvMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected