Skip to content

Conversation

@code-asher
Copy link
Member

// setupWorkspaceForAgent creates a workspace setup exactly like main SSH tests
// nolint:gocritic // This is in a test package and does not end up in the build
func setupWorkspaceForAgent(t *testing.T) (*codersdk.Client, database.WorkspaceTable, string) {
func setupWorkspaceForAgent(t *testing.T, opts *coderdtest.Options) (*codersdk.Client, database.WorkspaceTable, string) {
Copy link
Member

Choose a reason for hiding this comment

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

This is a super minor nit: We could have left this function and its signature unchanged, added a new setupWorkspaceForAgentWithOptions, and made this function call the new one internally with nil options.

That way, all other code remains untouched, resulting in an even smaller diff.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had the same thought but, I felt like I was trading diff size for dev experience. Because this is basically is a convenience wrapper around coderdtest.NewWithDatabase, having a similar signature makes it consistent and predictable, and easier to add options in the future (no need to discover that a WithOptions version exists).

I do wish I could merge this in a separate commit though, without having to open a second PR.

@code-asher code-asher force-pushed the asher/mcp-port-forwarding branch from f1e7942 to 02c889e Compare September 21, 2025 22:29
@code-asher code-asher merged commit 7f56212 into main Sep 21, 2025
46 of 48 checks passed
@code-asher code-asher deleted the asher/mcp-port-forwarding branch September 21, 2025 23:12
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: Port forwarding

3 participants