Skip to content

feat: Add Aspire dashboard module#1194

Merged
HofmeisterAn merged 13 commits into
testcontainers:developfrom
NikiforovAll:feature/aspire-dashboard
Jun 24, 2026
Merged

feat: Add Aspire dashboard module#1194
HofmeisterAn merged 13 commits into
testcontainers:developfrom
NikiforovAll:feature/aspire-dashboard

Conversation

@NikiforovAll

@NikiforovAll NikiforovAll commented Jun 11, 2024

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Aspire Dashboard support.

Why is it important?

As discussed in #1190, it would be great to have this Testcontainer.

Summary by CodeRabbit

  • New Features
    • Added Aspire Dashboard module with builder, container helper methods (dashboard + OTLP gRPC/HTTP addresses), and a dedicated configuration type.
  • Breaking Changes
    • Removed build-time options for anonymous access and unsecured transport; these are now fixed by default.
    • Updated the default Aspire Dashboard image and port mappings/constructors.
  • Documentation
    • Added Aspire Dashboard documentation, including configuration details and a C# example; updated site navigation.
  • Tests
    • Expanded integration coverage to verify dashboard availability and OTLP span ingestion over both gRPC and HTTP.

@netlify

netlify Bot commented Jun 11, 2024

Copy link
Copy Markdown

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 4bd053b
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/66eeaea6813eb9000847ba7d
😎 Deploy Preview https://deploy-preview-1194--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@HofmeisterAn HofmeisterAn added enhancement New feature or request module An official Testcontainers module labels Jun 13, 2024

@HofmeisterAn HofmeisterAn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR. Overall, it looks good and aligns well with our module approach. Thank you for following the repository standards. However, there are a few things we need to address before we can merge the PR. Nothing major. If you have any further questions, need help, or would like to discuss any topics, I am happy to help.

Comment thread src/Testcontainers.AspireDashboard/AspireDashboardConfiguration.cs Outdated
Comment thread src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs Outdated
Comment thread src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs Outdated
Comment thread src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs Outdated
@NikiforovAll

Copy link
Copy Markdown
Contributor Author

Sorry, long time no see. I plan to continue working on this one

@NikiforovAll

Copy link
Copy Markdown
Contributor Author

Thanks for your PR. Overall, it looks good and aligns well with our module approach. Thank you for following the repository standards. However, there are a few things we need to address before we can merge the PR. Nothing major. If you have any further questions, need help, or would like to discuss any topics, I am happy to help.

@HofmeisterAn please take a look. Thank you

@HofmeisterAn HofmeisterAn self-requested a review January 29, 2025 13:18
@HofmeisterAn HofmeisterAn force-pushed the develop branch 3 times, most recently from 4900ecd to 8fa5f1b Compare October 3, 2025 20:17
@HofmeisterAn HofmeisterAn requested a review from a team as a code owner June 24, 2026 07:21
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 7d01e03
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-dotnet/deploys/6a3bfc9d876bc70009df56f0
😎 Deploy Preview https://deploy-preview-1194--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds an Aspire Dashboard module with builder, configuration, container, connection-string support, solution wiring, test project, integration test, and docs. Also updates Azurite constructor documentation links.

Changes

Aspire Dashboard Module

Layer / File(s) Summary
Configuration, container, and provider
src/Testcontainers.AspireDashboard/AspireDashboardConfiguration.cs, src/Testcontainers.AspireDashboard/AspireDashboardContainer.cs, src/Testcontainers.AspireDashboard/AspireDashboardConnectionStringProvider.cs
Adds AspireDashboardConfiguration, AspireDashboardContainer, AspireDashboardConnectionStringProvider, and mapped-address helpers for the dashboard and OTLP endpoints.
Builder configuration and build flow
src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs
Updates image and port constants, adds image-selecting constructors, validates before build, binds dashboard and OTLP ports, hard-codes anonymous access, and merges configuration values through AspireDashboardConfiguration.
Project and solution wiring
Testcontainers.sln, src/Testcontainers.AspireDashboard/Testcontainers.AspireDashboard.csproj, src/Testcontainers.AspireDashboard/Usings.cs, src/Testcontainers.AspireDashboard/.editorconfig, tests/Testcontainers.AspireDashboard.Tests/Testcontainers.AspireDashboard.Tests.csproj, tests/Testcontainers.AspireDashboard.Tests/Usings.cs, tests/Testcontainers.AspireDashboard.Tests/.editorconfig
Adds the source and test projects, solution entries, build mappings, nested project placement, project references, target frameworks, global usings, and root editorconfig settings.
Integration test and module docs
tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs, tests/Testcontainers.AspireDashboard.Tests/Dockerfile, tests/Testcontainers.AspireDashboard.Tests/.runs-on, docs/modules/aspire-dashboard.md, mkdocs.yml
Adds the dashboard integration test and Dockerfile, sets the test runtime environment, creates the module documentation page, and inserts it into the mkdocs navigation.

Azurite Builder Docs

Layer / File(s) Summary
Constructor doc links
src/Testcontainers.Azurite/AzuriteBuilder.cs
Updates the two constructor XML documentation URLs for the Azurite image tags reference.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant AspireDashboardBuilder
  participant AspireDashboardContainer
  participant HttpClient
  Caller->>AspireDashboardBuilder: new AspireDashboardBuilder(image)
  Caller->>AspireDashboardBuilder: Build()
  AspireDashboardBuilder->>AspireDashboardContainer: new AspireDashboardContainer(configuration)
  Caller->>AspireDashboardContainer: GetDashboardAddress()
  HttpClient->>AspireDashboardContainer: GET /
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • HofmeisterAn

Possibly related PRs

Poem

🐇 A dashboard hopped into view,
With ports and docs and tests made new.
The rabbit blinks, “HTTP 200!”
Then twirls past Azurite links too.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The PR description covers what changed and why, with only optional sections like testing and related issues missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding the Aspire Dashboard module.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs (1)

12-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add XML doc comments to the public constants.

These constants are part of the [PublicAPI] surface and are referenced by consumers (e.g. the test's WithPortBinding). Documenting them keeps the public API consistent with the rest of the type and avoids missing-doc warnings if XML docs are enforced.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs` around lines 12
- 17, The public constants in AspireDashboardBuilder are missing XML
documentation, which leaves the [PublicAPI] surface inconsistent. Add XML doc
comments for AspireDashboardImage, AspireDashboardFrontendPort, and
AspireDashboardOtlpPort in AspireDashboardBuilder so the public API is
documented consistently and avoids missing-doc warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/modules/aspire-dashboard.md`:
- Around line 8-20: The Aspire Dashboard sample in the documentation is
inconsistent with the guidance: it demonstrates an HTTP/unsecured transport
scenario but calls AllowUnsecuredTransport with false, and it also claims port
customization without showing a different port. Update the example around
AspireDashboardBuilder and AspireDashboardContainerTest so the transport setting
matches the HTTP usage and the WithPortBinding call clearly demonstrates
changing the port to a non-default value.

In `@src/Testcontainers.AspireDashboard/AspireDashboardContainer.cs`:
- Around line 16-33: Move the dashboard and OTLP URL logging out of the
AspireDashboardContainer constructor/setup path and into the Started event
handler so GetMappedPublicPort is only called after the container is running.
Update the Started callback in AspireDashboardContainer to log both URLs there,
following the pattern used by CouchbaseContainer, and remove the premature
logging before startup.

In `@tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs`:
- Around line 8-11: The AspireDashboardContainerTest setup is hard-coding the
host port in the WithPortBinding call, which can cause collisions and flaky
runs. Update the container configuration in AspireDashboardContainerTest to use
a random host-port binding instead of the fixed
AspireDashboardBuilder.AspireDashboardFrontendPort value, and rely on the
container API to read the mapped port when the test needs it.

In
`@tests/Testcontainers.AspireDashboard.Tests/Testcontainers.AspireDashboard.Tests.csproj`:
- Line 12: Remove the unused ArangoDBNetStandard package reference from the
Testcontainers.AspireDashboard.Tests project file, since this test project does
not use any ArangoDB APIs. Update the
Testcontainers.AspireDashboard.Tests.csproj by deleting the unnecessary
PackageReference entry and keep the rest of the test dependencies unchanged.

---

Nitpick comments:
In `@src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs`:
- Around line 12-17: The public constants in AspireDashboardBuilder are missing
XML documentation, which leaves the [PublicAPI] surface inconsistent. Add XML
doc comments for AspireDashboardImage, AspireDashboardFrontendPort, and
AspireDashboardOtlpPort in AspireDashboardBuilder so the public API is
documented consistently and avoids missing-doc warnings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 620ded7b-8268-48f1-8321-4f55e85c5ea1

📥 Commits

Reviewing files that changed from the base of the PR and between 0ba7b9c and 8986712.

📒 Files selected for processing (13)
  • Testcontainers.sln
  • docs/modules/aspire-dashboard.md
  • mkdocs.yml
  • src/Testcontainers.AspireDashboard/.editorconfig
  • src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs
  • src/Testcontainers.AspireDashboard/AspireDashboardConfiguration.cs
  • src/Testcontainers.AspireDashboard/AspireDashboardContainer.cs
  • src/Testcontainers.AspireDashboard/Testcontainers.AspireDashboard.csproj
  • src/Testcontainers.AspireDashboard/Usings.cs
  • tests/Testcontainers.AspireDashboard.Tests/.editorconfig
  • tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs
  • tests/Testcontainers.AspireDashboard.Tests/Testcontainers.AspireDashboard.Tests.csproj
  • tests/Testcontainers.AspireDashboard.Tests/Usings.cs

Comment thread docs/modules/aspire-dashboard.md Outdated
Comment thread src/Testcontainers.AspireDashboard/AspireDashboardContainer.cs Outdated
Comment thread tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs`:
- Around line 29-35: The XML docs on AspireDashboardBuilder still show an
Azurite example in the <param name="image"> documentation, which is misleading
for this dashboard builder. Update the example in the AspireDashboardBuilder
documentation to reference a valid Aspire Dashboard image instead of the copied
Azurite image, and keep the surrounding remarks about the Docker image tag
source intact.
- Around line 12-14: The public Aspire Dashboard OTLP constants and helpers
currently use the misspelled “Oltp” naming, so rename them to “Otlp” throughout
the API before release. Update the constants in AspireDashboardBuilder and any
mirrored public helper names in AspireDashboardContainer so the public surface
consistently exposes the correct OTLP spelling. Ensure all references and usages
are renamed together to avoid leaving any typo in the API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 091107aa-5893-445d-9424-8483442dcbbe

📥 Commits

Reviewing files that changed from the base of the PR and between 8986712 and 079d2dd.

📒 Files selected for processing (9)
  • src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs
  • src/Testcontainers.AspireDashboard/AspireDashboardConfiguration.cs
  • src/Testcontainers.AspireDashboard/AspireDashboardContainer.cs
  • src/Testcontainers.AspireDashboard/Testcontainers.AspireDashboard.csproj
  • src/Testcontainers.AspireDashboard/Usings.cs
  • src/Testcontainers.Azurite/AzuriteBuilder.cs
  • tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs
  • tests/Testcontainers.AspireDashboard.Tests/Dockerfile
  • tests/Testcontainers.AspireDashboard.Tests/Testcontainers.AspireDashboard.Tests.csproj
✅ Files skipped from review due to trivial changes (2)
  • src/Testcontainers.AspireDashboard/Usings.cs
  • src/Testcontainers.Azurite/AzuriteBuilder.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs

Comment thread src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs Outdated
Comment thread src/Testcontainers.AspireDashboard/AspireDashboardBuilder.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs (1)

87-89: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Brittle substring assertions on serialized JSON.

"\"totalCount\":1" depends on the dashboard serializing without whitespace; a formatting change would break this test for non-functional reasons. Consider parsing the JSON and asserting on typed values instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs`
around lines 87 - 89, The test currently relies on brittle substring checks
against serialized JSON, so it can fail on harmless formatting changes. Update
the assertions in AspireDashboardContainerTest to parse spansJson as JSON and
verify the typed values, using the existing _serviceName and _spanName checks
along with the totalCount field from the parsed object instead of matching the
raw string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs`:
- Around line 83-89: The span assertion in AspireDashboardContainerTest is
racing the dashboard’s asynchronous ingestion/indexing, so the immediate GET to
/api/telemetry/spans can return before the span is visible. Update the test flow
around the tracer provider disposal and the spans query to poll for the expected
span with a short timeout and retry interval until totalCount reflects the
ingested span, then keep the existing assertions on _serviceName and _spanName.

---

Nitpick comments:
In `@tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs`:
- Around line 87-89: The test currently relies on brittle substring checks
against serialized JSON, so it can fail on harmless formatting changes. Update
the assertions in AspireDashboardContainerTest to parse spansJson as JSON and
verify the typed values, using the existing _serviceName and _spanName checks
along with the totalCount field from the parsed object instead of matching the
raw string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 331ae40f-6270-45f1-804d-3e47fbfa7aa9

📥 Commits

Reviewing files that changed from the base of the PR and between 005ece8 and 02c5931.

📒 Files selected for processing (5)
  • Directory.Packages.props
  • mkdocs.yml
  • tests/Testcontainers.AspireDashboard.Tests/AspireDashboardContainerTest.cs
  • tests/Testcontainers.AspireDashboard.Tests/Testcontainers.AspireDashboard.Tests.csproj
  • tests/Testcontainers.AspireDashboard.Tests/Usings.cs
✅ Files skipped from review due to trivial changes (2)
  • tests/Testcontainers.AspireDashboard.Tests/Usings.cs
  • Directory.Packages.props
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/Testcontainers.AspireDashboard.Tests/Testcontainers.AspireDashboard.Tests.csproj

@HofmeisterAn HofmeisterAn changed the title feat: Add Aspire Dashboard module #1190 feat: Add Aspire dashboard module Jun 24, 2026
HofmeisterAn
HofmeisterAn previously approved these changes Jun 24, 2026
Comment thread docs/modules/aspire-dashboard.md Outdated
@HofmeisterAn HofmeisterAn merged commit 9bbf81b into testcontainers:develop Jun 24, 2026
82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request module An official Testcontainers module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants