Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions pkg/workflow/blocked_domains_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Test workflow with blocked domains.

lockYAML := string(lockContent)

// Verify --block-domains flag is present
if !strings.Contains(lockYAML, "--block-domains") {
t.Error("Compiled workflow should contain '--block-domains' flag")
// Verify blockDomains key is present in the config JSON
if !strings.Contains(lockYAML, `"blockDomains"`) {
t.Error("Compiled workflow should contain 'blockDomains' key in config JSON")
}

// Verify blocked domains are in the command
Expand All @@ -79,9 +79,9 @@ Test workflow with blocked domains.
t.Error("Compiled workflow should contain blocked domain 'tracker.example.com'")
}

// Verify standard AWF flags are still present
if !strings.Contains(lockYAML, "--allow-domains") {
t.Error("Compiled workflow should still contain '--allow-domains' flag")
// Verify allowDomains key is present in the config JSON
if !strings.Contains(lockYAML, `"allowDomains"`) {
t.Error("Compiled workflow should still contain 'allowDomains' key in config JSON")
}

if !strings.Contains(lockYAML, "--log-level") {
Expand Down Expand Up @@ -140,9 +140,9 @@ Test workflow with blocked ecosystem.

lockYAML := string(lockContent)

// Verify --block-domains flag is present
if !strings.Contains(lockYAML, "--block-domains") {
t.Error("Compiled workflow should contain '--block-domains' flag")
// Verify blockDomains key is present in the config JSON
if !strings.Contains(lockYAML, `"blockDomains"`) {
t.Error("Compiled workflow should contain 'blockDomains' key in config JSON")
}

// Verify at least one Python ecosystem domain is blocked
Expand Down Expand Up @@ -208,14 +208,14 @@ Test workflow without blocked domains.

lockYAML := string(lockContent)

// Verify --block-domains flag is NOT present
if strings.Contains(lockYAML, "--block-domains") {
t.Error("Compiled workflow should NOT contain '--block-domains' flag when no domains are blocked")
// Verify blockDomains key is NOT present in the config JSON
if strings.Contains(lockYAML, `"blockDomains"`) {
t.Error("Compiled workflow should NOT contain 'blockDomains' key in config JSON when no domains are blocked")
}
Comment on lines +211 to 214
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test now asserts that the compiled lock file does not contain the blockDomains JSON key, but the subtest name still says “does not have block-domains flag”. Renaming the t.Run(...) description to match the new JSON-config-based behavior will make failures easier to interpret.

Copilot uses AI. Check for mistakes.

// Verify --allow-domains is still present
if !strings.Contains(lockYAML, "--allow-domains") {
t.Error("Compiled workflow should still contain '--allow-domains' flag")
// Verify allowDomains key is still present
if !strings.Contains(lockYAML, `"allowDomains"`) {
t.Error("Compiled workflow should still contain 'allowDomains' key in config JSON")
}
})

Expand Down Expand Up @@ -269,9 +269,9 @@ Test Claude workflow with blocked domains.

lockYAML := string(lockContent)

// Verify --block-domains flag is present
if !strings.Contains(lockYAML, "--block-domains") {
t.Error("Compiled Claude workflow should contain '--block-domains' flag")
// Verify blockDomains key is present in the config JSON
if !strings.Contains(lockYAML, `"blockDomains"`) {
t.Error("Compiled Claude workflow should contain 'blockDomains' key in config JSON")
}

// Verify blocked domain is in the command
Expand Down Expand Up @@ -330,9 +330,9 @@ Test Codex workflow with blocked domains.

lockYAML := string(lockContent)

// Verify --block-domains flag is present
if !strings.Contains(lockYAML, "--block-domains") {
t.Error("Compiled Codex workflow should contain '--block-domains' flag")
// Verify blockDomains key is present in the config JSON
if !strings.Contains(lockYAML, `"blockDomains"`) {
t.Error("Compiled Codex workflow should contain 'blockDomains' key in config JSON")
}

// Verify blocked domain is in the command
Expand Down
12 changes: 6 additions & 6 deletions pkg/workflow/domains_protocol_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ Test protocol-specific domains in safe-outputs.
}
}

// If checking AWF args, verify --allow-domains flag is present
// If checking AWF args, verify allowDomains key is present in the config JSON
if tt.checkAWFArgs {
if !strings.Contains(lockYAML, "--allow-domains") {
t.Error("Expected --allow-domains flag in compiled workflow")
if !strings.Contains(lockYAML, `"allowDomains"`) {
t.Error("Expected 'allowDomains' key in config JSON of compiled workflow")
Comment on lines +139 to +142
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment still refers to checking “AWF args”, but the assertion is now validating the presence of a JSON config key in the compiled lock content. Consider rewording this comment (and the related expectedDomains field comment earlier in the file) to avoid implying the legacy --allow-domains CLI flags are being checked here.

Copilot uses AI. Check for mistakes.
}
}

Expand Down Expand Up @@ -301,8 +301,8 @@ Test backward compatibility with domains without protocols.
}
}

// Verify --allow-domains flag is present
if !strings.Contains(lockYAML, "--allow-domains") {
t.Error("Expected --allow-domains flag in compiled workflow")
// Verify allowDomains key is present in the config JSON
if !strings.Contains(lockYAML, `"allowDomains"`) {
t.Error("Expected 'allowDomains' key in config JSON of compiled workflow")
}
}
Loading