Skip to content

Categorize managed-identity E2E tests and exclude them from the PR build#3923

Merged
iarekk merged 2 commits into
masterfrom
iarekk/mi-tests-category-filter
Jul 6, 2026
Merged

Categorize managed-identity E2E tests and exclude them from the PR build#3923
iarekk merged 2 commits into
masterfrom
iarekk/mi-tests-category-filter

Conversation

@iarekk

@iarekk iarekk commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Adds a filter for the ADO PR pipeline to NOT run the E2E tests requiring the Managed Identity.

For these tests, we will either:

  1. Run them on a separate VM pool with MI provided
  2. Update the tests/setup to simulate MI on the azure-pipelines pool.

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>
@iarekk
iarekk requested a review from a team as a code owner July 3, 2026 15:26
@gladjohn

gladjohn commented Jul 3, 2026

Copy link
Copy Markdown
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>
@iarekk

iarekk commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

do we have a pipeline to showcase these MI tests run?

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

@iarekk
iarekk merged commit d963e30 into master Jul 6, 2026
4 checks passed
@iarekk
iarekk deleted the iarekk/mi-tests-category-filter branch July 6, 2026 15:03
This was referenced Jul 10, 2026
This was referenced Jul 15, 2026
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.

3 participants