Add integration test workflow against deployed dev#18
Merged
Conversation
Two workflow_dispatch tests in a new Integration.Tests xunit project: - HappyPathTests.SeededItem_PublishesEndToEnd: publishes a message with the SharePointMock's seeded welcome.txt tuple, polls the Log Analytics workspace for `AppEvents` where Name=DocumentPublished and EventId matches the message id, asserts the SharePoint dimensions are present. - DeadLetterPathTests.UnknownItem_404s_AndEventuallyDeadLetters: publishes with a unique non-seeded itemId, polls for DocumentPublishingDeadLettered with that EventId, asserts the DeadLetterReason is recorded. PipelineFixture wraps SB sender + LogsQueryClient (both DefaultAzureCredential) plus a global ActivityListener so trace context propagates onto the message. New `.github/workflows/integration.yml` runs on workflow_dispatch only. Resolves the SB namespace and LAWS workspace ID via `az`, then hands them to the test runner via env vars. Configurable poll timeouts via workflow inputs (default 360s / 600s). Infra: bootstrap only granted the GHA SP Owner on the RG, which doesn't include data-plane actions. Adds `gha_runtime_roles.tf` granting "Azure Service Bus Data Sender" on the topic and "Log Analytics Reader" on the workspace, using an azuread data source on the SP's client_id (default to the known bootstrap-created app). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
New
Integration.Testsxunit project +integration.ymlworkflow that runs end-to-end assertions against the live dev pipeline.welcome.txttuple, polls the Log Analytics workspace forAppEventswhereName=="DocumentPublished"andProperties.EventIdmatches the message id, asserts the SharePoint dimensions are present.itemId, polls forDocumentPublishingDeadLetteredwith thatEventId, asserts aDeadLetterReasonis recorded.ServiceBusSender+LogsQueryClient(bothDefaultAzureCredential) plus a globalActivityListenerso trace context propagates onto the message.Workflow is
workflow_dispatchonly, resolves SB namespace + LAWS workspace ID viaaz, hands them to the runner via env vars. Configurable poll timeouts via inputs (default 360s happy, 600s dead-letter).Infra change: bootstrap only granted the GHA SP
Owneron the RG. That doesn't include data-plane actions for SB or LAWS. Newgha_runtime_roles.tfgrantsAzure Service Bus Data Senderon the topic andLog Analytics Readeron the workspace, using anazureaddata source on the SP'sclient_id(default to the known bootstrap-created app, overridable).Test plan
dotnet build— clean.dotnet format --verify-no-changes— clean.tofu fmt -check -recursive infra/— clean.dotnet test tests/Function.Tests— 13/13 still pass (Integration.Tests is filtered out byCategory=Integration).infraworkflow applies the new role assignments (needapplyeither via push-to-main or workflow_dispatch).integrationworkflow on main — both tests should go green within the default timeouts.Closes backlog item "Integration tests against deployed dev".
🤖 Generated with Claude Code