Skip to content

test(ext-agents): guard tier selectors against false-green#9115

Open
glharper wants to merge 2 commits into
mainfrom
glharper/ext-agents-tier-selector-8778
Open

test(ext-agents): guard tier selectors against false-green#9115
glharper wants to merge 2 commits into
mainfrom
glharper/ext-agents-tier-selector-8778

Conversation

@glharper

Copy link
Copy Markdown
Member

Summary

The ext-azure-ai-agents-test workflow selects Tier 0 and Tier 1 functional tests with go test -run <regex>. Go exits successfully when a regex matches no tests, so renaming or adding a Test_AIAgent_ test without updating the tier selectors could silently produce a false-green CI run.

Fix

  • Centralize the Tier 0 and Tier 1 regexes as job-level environment variables so validation and execution use the same selectors.
  • Anchor both regexes to exact top-level test names.
  • Add a Validate tier test selectors step that uses go test -list to discover tests and fails when:
    • no Test_AIAgent_ tests are discovered;
    • either tier matches zero tests;
    • a test is assigned to both tiers; or
    • any discovered test is not assigned to exactly one tier.
  • Normalize carriage returns so the check is deterministic when reproduced from Windows Bash as well as on the Ubuntu runner.

The current inventory is validated as 4 Tier 0 tests and 5 Tier 1 tests. The actual test steps reuse the validated regex variables.

Validation

  • Ran the exact selector guard locally: it discovered all 9 tests and accepted the current 4/5 split.
  • Removed Test_AIAgent_Doctor_Help from the Tier 0 selector in a local negative-control run; the guard failed and identified the uncovered test.
  • git diff --check passes.

Fixes #8778

Centralize the Tier 0 and Tier 1 go test patterns, then validate that each selector matches tests, no test belongs to both tiers, and every Test_AIAgent_ test is assigned exactly once. This makes renamed or newly added tests fail CI instead of being silently skipped by go test -run.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 6eccd2f8-19dc-4da9-abf7-12eb690cf50c
Copilot AI review requested due to automatic review settings July 13, 2026 14:52
@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds CI validation to prevent false-green Azure AI Agents tier test runs.

Changes:

  • Centralizes and anchors Tier 0/1 selectors.
  • Verifies all nine tests belong to exactly one tier.
  • Reuses validated selectors during test execution.

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One non-blocking suggestion on the new validation step, inline. The guard logic itself checks out: I ran it against the current package and the two tier regexes select exactly the 4 Tier 0 and 5 Tier 1 tests with full coverage and no overlap.

azd x publish
azd extension install azure.ai.agents --source local --force --no-prompt

- name: Validate tier test selectors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This guard only needs Go and the test sources to compile. go test -list against ./test/functional/ai_agents/ runs fine with just checkout + setup-go (the package only imports test/azdcli and test/recording, no built extension is needed). As placed, it runs after the inspector and agents build/publish steps, so a bad selector won't surface until several minutes of extension builds have already run. Moving this step up to right after setup-go would fail fast on selector drift before the expensive build work. Non-blocking.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in a1f99f3. The selector validation now runs immediately after actions/setup-go, before building azd, the inspector dependency, or the agents extension, so selector drift fails fast. Re-ran the guard locally: it still validates the current 4 Tier 0 / 5 Tier 1 split.

@JeffreyCA JeffreyCA added the ext-agents azure.ai.agents extension label Jul 13, 2026
Move the selector guard directly after setup-go so regex drift fails before building azd, the inspector dependency, or the agents extension.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 6eccd2f8-19dc-4da9-abf7-12eb690cf50c
Copilot AI review requested due to automatic review settings July 13, 2026 23:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ext-azure-ai-agents CI: guard against -run regex false-green

4 participants