Skip to content

Task 1/6: Integration test suite foundation (strategy, project, mock harness, CI)#128

Merged
elahmed-microsoft merged 5 commits into
mainfrom
users/elahmed/integration-test-suite
Jun 23, 2026
Merged

Task 1/6: Integration test suite foundation (strategy, project, mock harness, CI)#128
elahmed-microsoft merged 5 commits into
mainfrom
users/elahmed/integration-test-suite

Conversation

@elahmed-microsoft

@elahmed-microsoft elahmed-microsoft commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

First task (1/6) of the PackageUploader Integration Test Suite & Azure DevOps Pipeline deliverable. This establishes the foundation for an end-to-end integration test suite that validates PackageUploader's interactions with the Partner Center Ingestion API (and, later, XFUS).

This PR delivers the strategy decisions (tiered, mock-only first; PR-blocking in GitHub Actions; fake-token auth; committed fixtures + synthetic packages), a new PackageUploader.IntegrationTest project, the mock-tier test harness and fixtures, a smoke test, and the CI wiring that runs unit and integration tests as separate PR-blocking steps.

Out of scope (later tasks 2–6)

Full mock-server behaviors and per-operation E2E flow tests, XFUS upload-path interception, the Azure DevOps pipeline, and any live-sandbox execution.

Create a dedicated MSTest.Sdk integration test project separated from the unit test projects, referencing ClientApi and Application, and register it in the solution. No tests added yet; utilities/fixtures and smoke test follow in later phases.
Add the mock-tier harness: MockHttpMessageHandler (scripted responses + request recording), PackageUploaderTestHost (real DI graph with the Ingestion network handler and token provider replaced by test doubles), FakeAccessTokenProvider, IntegrationTestBase ([TestCategory(Integration)]), and SyntheticPackageFile for upload-path tests.
…se 3)

Add a smoke test validating the mock harness, and split the GitHub Actions test run into unit (TestCategory!=Integration) and integration (TestCategory=Integration) steps. Both gate every PR; --ignore-exit-code 8 absorbs Microsoft.Testing.Platform's zero-match-per-project exit code.
- MockHttpMessageHandler: return 400 (not 501) for unmatched requests so the Ingestion Polly policy does not retry a missing stub; guard the recorded-request list with a lock for concurrent SendAsync.
- PackageUploaderTestHost: resolve the scoped IPackageUploaderService from an explicit DI scope with ValidateScopes enabled, instead of the root provider.
- SyntheticPackageFile: widen best-effort Dispose catch beyond IOException.
- SmokeTest: use TestContext.CancellationToken.
- CI: add --minimum-expected-tests 1 so a mistyped/renamed category fails instead of silently passing with zero tests.
@elahmed-microsoft elahmed-microsoft changed the title probe Task 1/6: Integration test suite foundation (strategy, project, mock harness, CI) Jun 22, 2026
@elahmed-microsoft elahmed-microsoft marked this pull request as ready for review June 22, 2026 22:14
@elahmed-microsoft elahmed-microsoft merged commit 87e74bb into main Jun 23, 2026
7 checks passed
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.

2 participants