Skip to content

Add integration test workflow against deployed dev#18

Merged
christopherhouse merged 1 commit into
mainfrom
feat/integration-tests
May 29, 2026
Merged

Add integration test workflow against deployed dev#18
christopherhouse merged 1 commit into
mainfrom
feat/integration-tests

Conversation

@christopherhouse
Copy link
Copy Markdown
Owner

Summary

New Integration.Tests xunit project + integration.yml workflow that runs end-to-end assertions against the live dev pipeline.

  • HappyPathTests — publishes a message with the SharePointMock's seeded welcome.txt tuple, polls the Log Analytics workspace for AppEvents where Name=="DocumentPublished" and Properties.EventId matches the message id, asserts the SharePoint dimensions are present.
  • DeadLetterPathTests — publishes with a unique non-seeded itemId, polls for DocumentPublishingDeadLettered with that EventId, asserts a DeadLetterReason is recorded.
  • PipelineFixture — shared ServiceBusSender + LogsQueryClient (both DefaultAzureCredential) plus a global ActivityListener so trace context propagates onto the message.

Workflow is workflow_dispatch only, resolves SB namespace + LAWS workspace ID via az, 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 Owner on the RG. That doesn't include data-plane actions for SB or LAWS. New gha_runtime_roles.tf grants 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, 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 by Category=Integration).
  • On merge: infra workflow applies the new role assignments (need apply either via push-to-main or workflow_dispatch).
  • Then: dispatch the new integration workflow on main — both tests should go green within the default timeouts.

Closes backlog item "Integration tests against deployed dev".

🤖 Generated with Claude Code

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>
@christopherhouse christopherhouse merged commit 2111c5a into main May 29, 2026
10 checks passed
@christopherhouse christopherhouse deleted the feat/integration-tests branch May 29, 2026 15:12
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.

1 participant