(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func TestHelperProcess(t *testing.T) { |
| 28 | if os.Getenv("GH_WANT_HELPER_PROCESS") != "1" { |
| 29 | return |
| 30 | } |
| 31 | if err := func(args []string) error { |
| 32 | // Dispatch tests use this marker argument to inspect the environment gh handed to |
| 33 | // the extension, rather than echoing the arguments back. |
| 34 | if len(args) > 0 && args[len(args)-1] == "print-env" { |
| 35 | fmt.Fprintf(os.Stdout, "GH_EXTENSION=%s\n", os.Getenv("GH_EXTENSION")) |
| 36 | fmt.Fprintf(os.Stdout, "GH_HELPER_INHERITED=%s\n", os.Getenv("GH_HELPER_INHERITED")) |
| 37 | return nil |
| 38 | } |
| 39 | fmt.Fprintf(os.Stdout, "%v\n", args) |
| 40 | return nil |
| 41 | }(os.Args[3:]); err != nil { |
| 42 | fmt.Fprintln(os.Stderr, err) |
| 43 | os.Exit(1) |
| 44 | } |
| 45 | os.Exit(0) |
| 46 | } |
| 47 | |
| 48 | func newTestManager(dataDir, updateDir string, client *http.Client, gitClient gitClient, ios *iostreams.IOStreams, extraEnv ...string) *Manager { |
| 49 | return &Manager{ |
nothing calls this directly
no outgoing calls
no test coverage detected