Skip to content

Enforce //go:build !integration on untagged unit test files#34798

Merged
pelikhan merged 2 commits into
mainfrom
copilot/add-go-build-tag-to-tests
May 26, 2026
Merged

Enforce //go:build !integration on untagged unit test files#34798
pelikhan merged 2 commits into
mainfrom
copilot/add-go-build-tag-to-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

Repository policy requires every *_test.go file 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

    • Added //go:build !integration at file top (with required blank line before package) for 13 untagged production test files across:
      • pkg/cli
      • pkg/constants
      • pkg/errorutil
      • pkg/parser
      • pkg/syncutil
      • pkg/workflow
  • Why this matters

    • Makes unit-test selection deterministic under tag-filtered runs.
    • Brings these tests into compliance with AGENTS.md build-tag policy.
  • Change pattern (applied uniformly)

    //go:build !integration
    
    package workflow

Copilot AI changed the title [WIP] Add mandatory //go:build tag to test files Enforce //go:build !integration on untagged unit test files May 25, 2026
Copilot AI requested a review from gh-aw-bot May 25, 2026 23:46
@pelikhan pelikhan marked this pull request as ready for review May 26, 2026 00:25
Copilot AI review requested due to automatic review settings May 26, 2026 00:25
@pelikhan pelikhan merged commit 2528358 into main May 26, 2026
@pelikhan pelikhan deleted the copilot/add-go-build-tag-to-tests branch May 26, 2026 00:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] [quick-win] Add mandatory //go:build tag to 13 test files (AGENTS.md policy violation)

4 participants