{{ message }}
Repository navigation
Conversation
The connect setup, guided setup, operator, start-wait and profile layer tests ran against connectSetupServer, a mock that answered most reads to any bearer and modeled each scenario as a field. They now run against internal/connector/fakebasecamp, and connectSetupServer is deleted. Each old knob is now a fact of the world or a fault: project membership decides what the agent lists and reads, a boss on the agent's profile, people readable only by some, a client secret rotated by a connection on another computer, a token repointed at another agent, and injected faults for refused project reads, a failed mint, a profile with no id and a rate-limited token endpoint. The fake gains Tickets(), every stream ticket it issued, so the tests that a command never echoes a ticket check the tickets actually handed out.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approved
The migration preserves the tested scenarios while improving realism, consistency, and credential-leak coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Migrates connect setup tests to the shared fake Basecamp without changing CLI behavior.
Changes:
- Replaces the bespoke setup server with realistic world state and faults.
- Adds thread-safe tracking of issued stream tickets.
- Strengthens credential and ticket leak assertions.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
robzolkos
force-pushed
the
connect-e2e/setup-on-fake
branch
from
October 2, 2026 18:23
4619ba7 to
01f042c
Compare
Member
This branch has not been deployed
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.

PR 1 of a stack of 8 that tests
basecamp connectend to end. It is stacked on #822 (the fake Basecamp) and changes no behaviour of the CLI.Why
The connect setup tests ran against
connectSetupServer, a mock that answered most reads to any bearer and modeled each scenario as a field (refuseAgentReads,agentAsUser,boss,agentProjects,refuseSecret,rateLimitMints, ...). It drifted from Basecamp in small ways: project reads ignored membership, the project list was a separate field from what the agent could read, and the client secret never rotated. One fake for every connect test means a scenario is set up the way Basecamp would be, and the later e2e PRs run against the same one.What
connect_setup_test.go,connect_setup_guided_test.go,connect_operator_test.go,connect_start_wait_test.goandprofile_layers_test.gonow run againstinternal/connector/fakebasecamp.connectSetupServeris deleted.Each old knob is now a fact of the world or a fault:
agentProjects-> the agent's project membership (agentOnProjects). The list and the reads agree now.boss->BossIDon the agent (ownedByTheOperator).refusePeopleand the "Colleague" ->ReadableByon the person (readableOnlyBy).agentAsUser->Agent: false;grantScope->Connection.Scope.agentID = 777andagentID++-> the client and its tokens repointed at another Agent (repointAgent).refuseSecret-> the secret rotated by a connection on another computer (connectedElsewhere). The fake then refuses it withinvalid_client, and the reconnect rotates in a secret it accepts. No fault and no toggle are needed.refuseAgentReads-> 403 on project and project people reads, for Agents only.mintFailure-> a 422 fault on the stream ticket;agentID = 0-> a 200 fault with a profile that has no id.duringMint->Before(RouteStreamTicket, ...);rateLimitMints->TokenRateLimited(3600);mintsandintakeCount->Count(...).One addition to the fake:
Server.Tickets()returns every stream ticket it issued. The tests check that a command never prints a ticket, so they need the real ticket values, and tickets are not part of theWorld. It has its own test infakebasecamp.Assertions. Every assertion is kept. Some are stronger now:
TestGuidedConnectSetupLeavesARefusedCredentialThePersonKeepsnow also checks that the refusal was explained and that the reconnect question was asked. Before, it passed even with a credential that was not refused.assert, notrequire.Tests
bin/cigreen.go test -race -count=10(1100 runs, no failures, no races).ReadableByhas no effect, the tests that depend on them fail.Summary by cubic
Migrates the
connect setuptests from the customconnectSetupServermock to the shared fake Basecamp, with no CLI behavior changes.Refactor
Tickets(), listing every stream ticket it issued, so no-echo assertions compare against real tickets.Written for commit 01f042c. Summary will update on new commits.