(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func prepare(t *testing.T) (func(args ...string) icmd.Cmd, *configfile.ConfigFile, func()) { |
| 16 | t.Helper() |
| 17 | cfg := fs.NewDir(t, "plugin-test", |
| 18 | fs.WithFile("config.json", fmt.Sprintf(`{"cliPluginsExtraDirs": [%q]}`, os.Getenv("DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS"))), |
| 19 | ) |
| 20 | run := func(args ...string) icmd.Cmd { |
| 21 | return icmd.Command("docker", append([]string{"--config", cfg.Path()}, args...)...) |
| 22 | } |
| 23 | cleanup := func() { |
| 24 | cfg.Remove() |
| 25 | } |
| 26 | cfgfile, err := config.Load(cfg.Path()) |
| 27 | assert.NilError(t, err) |
| 28 | |
| 29 | return run, cfgfile, cleanup |
| 30 | } |
no test coverage detected
searching dependent graphs…