MCPcopy
hub / github.com/kopia/kopia / NewInProcRunner

Function NewInProcRunner

tests/testenv/cli_inproc_runner.go:66–82  ·  view source on GitHub ↗

NewInProcRunner returns a runner that executes CLI subcommands in the current process using cli.RunSubcommand().

(t *testing.T)

Source from the content-addressed store, hash-verified

64
65// NewInProcRunner returns a runner that executes CLI subcommands in the current process using cli.RunSubcommand().
66func NewInProcRunner(t *testing.T) *CLIInProcRunner {
67 t.Helper()
68
69 if os.Getenv("KOPIA_EXE") != "" && os.Getenv("KOPIA_RUN_ALL_INTEGRATION_TESTS") == "" {
70 t.Skip("not running test since it's also included in the unit tests")
71 }
72
73 return &CLIInProcRunner{
74 CustomizeApp: func(a *cli.App, kp *kingpin.Application) {
75 a.AddStorageProvider(cli.StorageProvider{
76 Name: "in-memory",
77 Description: "in-memory storage backend",
78 NewFlags: func() cli.StorageFlags { return &storageInMemoryFlags{} },
79 })
80 },
81 }
82}
83
84var _ CLIRunner = (*CLIInProcRunner)(nil)

Calls 2

HelperMethod · 0.80
AddStorageProviderMethod · 0.80