MCPcopy Index your code
hub / github.com/riverqueue/river / runCommand

Function runCommand

cmd/river/rivercli/river_cli_test.go:656–662  ·  view source on GitHub ↗

runCommand runs a CLI command while doing some additional niceties like validating options.

(ctx context.Context, t *testing.T, cmd TCommand, opts TOpts)

Source from the content-addressed store, hash-verified

654// runCommand runs a CLI command while doing some additional niceties like
655// validating options.
656func runCommand[TCommand Command[TOpts], TOpts CommandOpts](ctx context.Context, t *testing.T, cmd TCommand, opts TOpts) (bool, error) {
657 t.Helper()
658
659 require.NoError(t, opts.Validate())
660
661 return cmd.Run(ctx, opts)
662}
663
664func withCommandBase[TCommand Command[TOpts], TOpts CommandOpts](t *testing.T, cmd TCommand) (TCommand, *bytes.Buffer) {
665 t.Helper()

Callers 3

TestMigrateGetFunction · 0.85
TestMigrateListFunction · 0.85
TestVersionFunction · 0.85

Calls 3

HelperMethod · 0.65
ValidateMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…