Skip to content

Refine SurrealDB hosting test coverage - #1441

Merged
aaronpowell merged 3 commits into
mainfrom
aaronpowell-surrealdb-api-tests
Jun 29, 2026
Merged

Refine SurrealDB hosting test coverage#1441
aaronpowell merged 3 commits into
mainfrom
aaronpowell-surrealdb-api-tests

Conversation

@aaronpowell

Copy link
Copy Markdown
Member

Closes: N/A

Overview

Moves SurrealDB coverage into the hosting public API tests, removes the old functional test, and adds unit assertions for data mounts, health check registration, init-file wiring, and creation-script annotations.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

The init-file and creation-script checks are intentionally unit-level and assert the resource model rather than running the full container workflow.

Move SurrealDB coverage to hosting public API tests, remove the old functional test file, and tighten assertions around mounts, health checks, init files, and creation scripts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 07:39
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1441

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1441"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the SurrealDB hosting integration’s test suite by moving coverage from Docker-based functional tests to unit/public-API tests that validate the Aspire resource model (annotations, mounts, init-file wiring, and creation scripts).

Changes:

  • Added public API tests that assert health check annotation creation, container mount annotations, init-file container file wiring + env var, and creation-script annotations.
  • Removed the previous Docker-driven SurrealDbFunctionalTests suite.
  • Updated test/project wiring by removing a direct compile-include and adding InternalsVisibleTo for the tests.
Show a summary per file
File Description
tests/CommunityToolkit.Aspire.Hosting.SurrealDb.Tests/SurrealDbPublicApiTests.cs Adds unit/public-API assertions for health checks, mounts, init-file wiring, and creation-script annotations.
tests/CommunityToolkit.Aspire.Hosting.SurrealDb.Tests/SurrealDbFunctionalTests.cs Removes Docker-based functional tests in favor of model-level assertions.
tests/CommunityToolkit.Aspire.Hosting.SurrealDb.Tests/CommunityToolkit.Aspire.Hosting.SurrealDb.Tests.csproj Removes direct source inclusion now that internals are exposed to the test assembly.
src/CommunityToolkit.Aspire.Hosting.SurrealDb/CommunityToolkit.Aspire.Hosting.SurrealDb.csproj Adds InternalsVisibleTo for the test project to enable internal-model assertions.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread tests/CommunityToolkit.Aspire.Hosting.SurrealDb.Tests/SurrealDbPublicApiTests.cs Outdated
aaronpowell and others added 2 commits June 29, 2026 17:52
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.Hosting.SurrealDb 89% 74% 208
CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService 85% 62% 236
CommunityToolkit.Aspire.SurrealDb 56% 42% 40
Summary 86% (946 / 1103) 66% (278 / 424) 484

@aaronpowell

Copy link
Copy Markdown
Member Author

@Odonno turns out that you're not actually a member to be assigned review, even though you're the codeowner here 😅

Anyway, invited you and want to have a look over this

@aaronpowell
aaronpowell merged commit ce5ce6f into main Jun 29, 2026
14 checks passed
@aaronpowell
aaronpowell deleted the aaronpowell-surrealdb-api-tests branch June 29, 2026 22:37
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