executeRootIntegration runs a command through the full command tree and handleRootError, returning the exit code matching real CLI behavior.
(t *testing.T, f *cmdutil.Factory, rootCmd *cobra.Command, args []string)
| 54 | // executeRootIntegration runs a command through the full command tree and |
| 55 | // handleRootError, returning the exit code matching real CLI behavior. |
| 56 | func executeRootIntegration(t *testing.T, f *cmdutil.Factory, rootCmd *cobra.Command, args []string) int { |
| 57 | t.Helper() |
| 58 | rootCmd.SetArgs(args) |
| 59 | if err := rootCmd.Execute(); err != nil { |
| 60 | return handleRootError(f, err) |
| 61 | } |
| 62 | return 0 |
| 63 | } |
| 64 | |
| 65 | // typedErrorEnvelope mirrors the typed wire shape produced by |
| 66 | // WriteTypedErrorEnvelope: the inner error marshals an errs.Problem |
no test coverage detected