MCPcopy Index your code
hub / github.com/coder/coder / NewWithCommand

Function NewWithCommand

cli/clitest/clitest.go:73–82  ·  view source on GitHub ↗
(
	t testing.TB, cmd *serpent.Command, args ...string,
)

Source from the content-addressed store, hash-verified

71}
72
73func NewWithCommand(
74 t testing.TB, cmd *serpent.Command, args ...string,
75) (*serpent.Invocation, config.Root) {
76 configDir := config.Root(t.TempDir())
77 // Keyring usage is disabled here when --global-config is set because many existing
78 // tests expect the session token to be stored on disk and is not properly instrumented
79 // for parallel testing against the actual operating system keyring.
80 invArgs := append([]string{"--global-config", string(configDir)}, args...)
81 return setupInvocation(t, cmd, invArgs...), configDir
82}
83
84func setupInvocation(t testing.TB, cmd *serpent.Command, args ...string,
85) *serpent.Invocation {

Callers 9

createAgentWithFlagsFunction · 0.92
TestErrorExamplesFunction · 0.92
TestServer_SingleFunction · 0.92
newCLIFunction · 0.92
NewFunction · 0.85
NewWithClockFunction · 0.85
TestCommandHelpFunction · 0.85

Calls 3

RootTypeAlias · 0.92
setupInvocationFunction · 0.85
TempDirMethod · 0.65

Tested by 7

createAgentWithFlagsFunction · 0.74
TestErrorExamplesFunction · 0.74
TestServer_SingleFunction · 0.74
newCLIFunction · 0.74
TestCommandHelpFunction · 0.68