Skip to content

[TST-380] test: credentials, integrations and the MCP catalog run against the real server - #424

Merged
Blind-Striker merged 1 commit into
masterfrom
test/tst-380-local-flows
Oct 17, 2026
Merged

Blind-Striker merged 1 commit into
masterfrom
test/tst-380-local-flows

Conversation

@Blind-Striker

@Blind-Striker Blind-Striker commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

📝 Description

What does this PR do?
It adds nine real-server tests for the local credential, integration and MCP catalog operations, the last of #380's sweep. They run on the existing simulated-drive fixture, with no new fixture, provider, support type or dependency.

ID Operation Test
C01 RemoveCredentialAsync CredentialsClientLiveTests.RemoveCredentialAsync_Should_Remove_The_Owned_Row_When_It_Exists
C02 CreateCredentialAsync CredentialsClientLiveTests.CreateCredentialAsync_Should_Persist_The_Row_When_The_Id_Is_Unused
C03 ActivateCredentialAsync CredentialsClientLiveTests.ActivateCredentialAsync_Should_Select_The_Older_Row_When_A_Newer_Row_Is_Active
C04 ListCredentialsAsync CredentialsClientLiveTests.ListCredentialsAsync_Should_Return_The_Owned_Metadata_When_A_Row_Was_Created
C05 UpdateCredentialAsync CredentialsClientLiveTests.UpdateCredentialAsync_Should_Replace_The_Label_When_A_Row_Exists
I01 ConnectWithKeyAsync IntegrationClientLiveTests.ConnectWithKeyAsync_Should_Store_A_Connection_When_The_Seeded_Key_Method_Is_Used
I02 IntegrationClient.GetAsync IntegrationClientLiveTests.GetAsync_Should_Return_The_Seeded_Integration_When_Its_Id_Is_Requested
I03 ListIntegrationsAsync IntegrationsClientLiveTests.ListIntegrationsAsync_Should_Include_The_Seeded_Provider_When_Plugins_Are_Activated
M01 ListMcpServersAsync McpServersClientLiveTests.ListMcpServersAsync_Should_Report_The_Disabled_Entry_When_It_Was_Added_At_Runtime

Secrets. Credential values are inert sentinels the tests create. No test prints, compares, serializes or dumps a value, a response body or RawBody. Every list is filtered to the test's own IDs or labels, with no global counts and no host or environment credential touched.

Ownership. Each credential, connection and MCP entry has its cleanup registered before it is created, so a lost response still cleans up. M01's MCP entry is typed, disabled, OAuth-off, and points at an inert .invalid URL, so no connection is attempted.

With this PR, #380's sweep is complete: PRs 1–4 cover every reachable operation the issue named, and the out-list with reasons is on the issue.

Part of #380 (PR 4 of 4).

🔄 Type of Change

  • 🧪 Test improvements

🎯 Protocol & API Surface

  • No change to the public API surface
  • Nothing under external/, spec/ or src/ was touched

🧪 Testing

Each test is shown to catch the missing or wrong operation. It is green, then red at its oracle, then green again; the mutations are not committed.

Test Mutation Failure
C01 Success without removing the owned ID remains
C02 Valid success fabricated without inserting the owned ID is missing
C03 Success without activating the older row stays inactive
C04 Empty successful list the owned ID is missing
C05 Success without updating the label stays the initial one
I01 Success without connecting owned rows: expected 1, found 0
I02 Sent to /api/integration/opencode expected sim, received opencode
I03 Empty successful catalog sim is missing
M01 Empty successful catalog the owned MCP name is missing, before any event wait

Every failure is an assertion, never a hang guard or timeout. M01 checks the list before it waits for the status event, so a no-op cannot stall it.

Review. A fresh read-only review found no defects. Its one note was a null-forgiving request.Id! without a stated invariant (slop-review R7). The test helper now returns the ID it assigned, so the operator is gone. The resulting arrange copy between C02 and C04 moved into a private method in the class; the Contains(id) oracle each mutant failed on is unchanged.

Merge-queue ejection, and the fix. The first merge group failed the clone gate. #423 (PR 3, merged just before) and this PR each carried the same owned-MCP removal helper:

  • ExperimentalClientLiveTests:185-193
  • McpServersClientLiveTests:59-68

Each PR was clone-free on its own. Two slices now use the disabled-MCP registration and its owned removal, so per testing-style.md they live in the root Support/. The new helper Support/DisabledMcpServer.cs holds both, and the two classes call it instead of private copies. The helper's removal still tolerates only the exact already-missing refusal. The fix is rebased onto #423's merge, 3cbb8c14.

✅ Completion Gate

Local check (quality-gates.md) on the first head, base cff6057f, idle host. Every step's own exit code was read:

  • slopwatch: zero findings
  • dotnet build --configuration Release: 0 warnings, 0 errors
  • dotnet format whitespace / dotnet format style --severity warn: no changes
  • verify-clones: passed, 0 new (tests 5.68%, under the 6% ceiling); no baseline change
  • OpenCode.Sdk.Tools.Tests (all but NativeAot): 1995, 0 failed
  • OpenCode.Sdk.Tests (all but ServiceElection/NativeAot): 8317, 0 failed

After review, a narrow re-check ran on that head. The head 65db67ae changes only CredentialsClientLiveTests.cs (the R7 fix and its private method). On it:

  • the SDK test project builds on all target frameworks with 0 warnings;
  • both format checks report no changes;
  • verify-clones reports 0 new;
  • CredentialsClientLiveTests passes 15, 0 failed;
  • the RepositoryGates guards pass 93, 0 failed.

Final head b66bc866 (rebased onto 3cbb8c14, with the shared helper):

  • dotnet build --configuration Release: 0 warnings, 0 errors
  • dotnet format style and whitespace: no changes
  • slopwatch: zero findings
  • verify-clones: passed, 0 new (tests 5.66%)
  • OpenCode.Sdk.Tools.Tests (all but NativeAot): 1995, 0 failed
  • OpenCode.Sdk.Tests (all but ServiceElection/NativeAot): 8344, 0 failed

The host runs Bun 1.4.3, a maintainer-named off-pin host (OPENCODE_SDK_TESTS_BUN_MISMATCH=allow); the pin is 1.4.2.

✅ Code Quality Checklist

  • No new suppression
  • No tests skipped, weakened, or deleted to make the suite pass

@Blind-Striker
Blind-Striker added this pull request to the merge queue Oct 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2026
…eal server

Part of #380 (PR 4 of 4). Nine live tests on the simulated-drive fixture. Each fails at its oracle when its operation is made a no-op that returns a valid success shape, or sent to the wrong route.
@Blind-Striker
Blind-Striker force-pushed the test/tst-380-local-flows branch from 65db67a to b66bc86 Compare October 17, 2026 06:52
@Blind-Striker
Blind-Striker added this pull request to the merge queue Oct 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2026
@Blind-Striker
Blind-Striker added this pull request to the merge queue Oct 17, 2026
Merged via the queue into master with commit 04f1899 Oct 17, 2026
12 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.

1 participant