agentClientCommand creates a subcommand that creates an agent client and stores it in the provided clientRef. Used to test the properties of the client with various root command flags.
(clientRef **agentsdk.Client)
| 427 | // agentClientCommand creates a subcommand that creates an agent client and stores it in the provided clientRef. Used to |
| 428 | // test the properties of the client with various root command flags. |
| 429 | func agentClientCommand(clientRef **agentsdk.Client) *serpent.Command { |
| 430 | agentAuth := &cli.AgentAuth{} |
| 431 | cmd := &serpent.Command{ |
| 432 | Use: "agent-client", |
| 433 | Short: `Creates and agent client for testing.`, |
| 434 | Handler: func(inv *serpent.Invocation) error { |
| 435 | client, err := agentAuth.CreateClient() |
| 436 | if err != nil { |
| 437 | return xerrors.Errorf("create agent client: %w", err) |
| 438 | } |
| 439 | *clientRef = client |
| 440 | return nil |
| 441 | }, |
| 442 | } |
| 443 | agentAuth.AttachOptions(cmd, false) |
| 444 | return cmd |
| 445 | } |
| 446 | |
| 447 | func TestWrapTransportWithUserAgentHeader(t *testing.T) { |
| 448 | t.Parallel() |
no test coverage detected