Enforce //go:build !integration on untagged unit test files#34798
Merged
Conversation
Co-authored-by: gh-aw-bot <[email protected]>
Copilot
AI
changed the title
[WIP] Add mandatory //go:build tag to test files
Enforce May 25, 2026
//go:build !integration on untagged unit test files
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enforces the repository’s test build-tag policy by adding //go:build !integration to previously-untagged *_test.go files, making unit-test selection deterministic when running with build tags.
Changes:
- Added
//go:build !integration(with required blank line) to 13 existing unit test files across multiple packages. - Standardized test file headers to comply with the build-tag policy in
AGENTS.md.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/test_helpers_shared_test.go | Adds unit-test build tag (but this file appears to be a shared helper used by integration tests too). |
| pkg/workflow/github_context_prompt_test.go | Adds unit-test build tag header. |
| pkg/workflow/docker_cli_proxy_test.go | Adds unit-test build tag header. |
| pkg/workflow/compiler_test_helpers_test.go | Adds unit-test build tag (but helpers are referenced by integration-tagged tests). |
| pkg/syncutil/onceloader_test.go | Adds unit-test build tag header. |
| pkg/parser/import_bfs_test.go | Adds unit-test build tag header. |
| pkg/errorutil/errors_test.go | Adds unit-test build tag header. |
| pkg/constants/permissions_policy_test.go | Adds unit-test build tag header. |
| pkg/cli/test_helpers_git_test.go | Adds unit-test build tag (but helper is referenced by integration-tagged tests). |
| pkg/cli/status_dependency_tree_test.go | Adds unit-test build tag header. |
| pkg/cli/mcp_inspect_tree_test.go | Adds unit-test build tag header. |
| pkg/cli/compile_workflow_processor_test.go | Adds unit-test build tag header. |
| pkg/cli/codemod_activation_outputs_test.go | Adds unit-test build tag header. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 13/13 changed files
- Comments generated: 3
| @@ -1,3 +1,5 @@ | |||
| //go:build !integration | |||
| @@ -1,3 +1,5 @@ | |||
| //go:build !integration | |||
| @@ -1,3 +1,5 @@ | |||
| //go:build !integration | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repository policy requires every
*_test.gofile to declare a build constraint; several production unit tests were missing this, causing inconsistent inclusion when running with build tags. This PR adds the required unit-test tag to all affected files.What changed
//go:build !integrationat file top (with required blank line beforepackage) for 13 untagged production test files across:pkg/clipkg/constantspkg/errorutilpkg/parserpkg/syncutilpkg/workflowWhy this matters
Change pattern (applied uniformly)