Categorize managed-identity E2E tests and exclude them from the PR build#3923
Merged
Conversation
The `AcquireTokenManagedIdentity` E2E test acquires a token for a user-assigned
managed identity via IMDS, so it requires an MI assigned to the build host. It
passes on the official OneBranch pipeline (VM-based agents that have the MI) but
fails on Microsoft-hosted agents (no MI, IMDS returns "Identity not found").
Following the MSAL approach of categorizing MI tests and running them only where
an MI is available:
- Add a shared `TestCategories.ManagedIdentity` ("MI_E2E") constant and tag the
`AcquireTokenManagedIdentity` class with `[Trait("Category", "MI_E2E")]`.
- Parameterize `template-run-unit-tests.yaml` with `e2eTestFilterCriteria`
(default empty, so the release build and any other consumer are unaffected).
- The PR build (azure-pipelines.yml) passes `Category!=MI_E2E` to exclude the MI
tests, which run on Microsoft-hosted agents.
The official OneBranch pipeline uses its own inline VSTest steps and is not
affected, so it continues to run the MI tests on VM-based agents.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
do we have a pipeline to showcase these MI tests run? |
Empty commit to kick off the newly added ADO PR pipeline trigger. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
I should have opened it as a draft, sorry! Presently I'm working through the E2E tests on the repo, and checking which ones need a special runner pool |
4gust
approved these changes
Jul 6, 2026
This was referenced Jul 10, 2026
Closed
Closed
Merged
Closed
This was referenced Jul 15, 2026
Closed
Closed
Open
Open
Closed
Closed
Open
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.
Adds a filter for the ADO PR pipeline to NOT run the E2E tests requiring the Managed Identity.
For these tests, we will either: