Repository navigation
[avenger] Fix stale work-queue integration fixtures #67585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,7 +92,8 @@ func TestWorkQueueDispatchCredentialActualCompilation(t *testing.T) { | |
| } else { | ||
| require.Equal(t, -1, mint) | ||
| } | ||
| require.NotContains(t, string(content), "GH_AW_WORK_QUEUE_POLICY:") | ||
| require.Contains(t, string(content), "GH_AW_WORK_QUEUE_POLICY:") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/diagnosing-bugs] Good fix — this flips the assertion to match current production behavior where @copilot please address this. |
||
| require.Contains(t, string(content), `\"authorization\":\"aw\"`) | ||
| }) | ||
| } | ||
| } | ||
|
|
@@ -195,7 +196,9 @@ Compile each work-queue workflow phase. | |
| func TestWorkQueueNamedProfileCompilation(t *testing.T) { | ||
| dir := testutil.TempDir(t, "work-queue-named-profile-") | ||
| path := filepath.Join(dir, "worker.md") | ||
| // Keep coverage of legacy explicit profiles without repository-level scheduling. | ||
| require.NoError(t, os.WriteFile(path, []byte(`--- | ||
| strict: false | ||
| on: workflow_dispatch | ||
| engine: claude | ||
| tools: | ||
|
|
@@ -221,6 +224,7 @@ safe-outputs: | |
| Use the explicitly approved profile without an implicit fallback worker. | ||
| `), 0o600)) | ||
| compiler := NewCompiler(WithVersion("integration")) | ||
| compiler.gitRoot = dir | ||
| compiler.SetApprove(true) | ||
| require.NoError(t, compiler.CompileWorkflow(path)) | ||
| content, err := os.ReadFile(filepath.Join(dir, "worker.lock.yml")) | ||
|
|
@@ -569,7 +573,8 @@ Read the queue and dispatch an available Work identity. | |
| require.Contains(t, string(compiled), `work_queue_workflows`) | ||
| require.Contains(t, string(compiled), `work_queue`) | ||
| require.NotContains(t, string(compiled), "WORK_QUEUE_HMAC_SECRET") | ||
| require.NotContains(t, string(compiled), "GH_AW_WORK_QUEUE_POLICY:") | ||
| require.Contains(t, string(compiled), "GH_AW_WORK_QUEUE_POLICY:") | ||
| require.Contains(t, string(compiled), `\"authorization\":\"aw\"`) | ||
| inputs, err := extractWorkflowDispatchInputs(filepath.Join(workflowsDir, "dispatcher.lock.yml")) | ||
| require.NoError(t, err) | ||
| require.NotContains(t, inputs, WorkQueueClaimInputName) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/diagnosing-bugs] Correct root-cause fix — verified
work_queue_native.cjs:135andwork_queue_provisioning.cjs:86already useposix.basename(destination.workflow)for dispatch calls, so this mock assertion was simply stale, not a workaround. Nice catch aligning the fixture with actual adapter behavior.💡 Optional hardening
Consider adding one more case where
WORKFLOWcontains a nested path (e.g.shared/worker.lock.yml) to explicitly assert the basename-stripping behavior is intentional rather than incidental (sinceWORKFLOWis currently a flat.github/workflows/worker.lock.yml, basename happens to equal the filename and wouldn't fail even withoutposix.basenameon the production side in simple cases).@copilot please address this.