(t *testing.T)
| 649 | } |
| 650 | |
| 651 | func TestCLINetworkRoundTripIntegration(t *testing.T) { |
| 652 | t.Parallel() |
| 653 | |
| 654 | h := newIntegrationHarness(t) |
| 655 | mustExecuteRoot(t, h.deps, "daemon", "start", "-o", "json") |
| 656 | defer func() { |
| 657 | _, _, _ = executeRootCommand(t, h.deps, "daemon", "stop", "-o", "json") |
| 658 | _ = h.runner.waitForExit() |
| 659 | }() |
| 660 | |
| 661 | newOut, _, err := executeRootCommand( |
| 662 | t, |
| 663 | h.deps, |
| 664 | "session", |
| 665 | "new", |
| 666 | "--agent", |
| 667 | "coder", |
| 668 | "--name", |
| 669 | "net-demo", |
| 670 | "--channel", |
| 671 | "builders", |
| 672 | "--cwd", |
| 673 | h.workspace, |
| 674 | "-o", |
| 675 | "json", |
| 676 | ) |
| 677 | if err != nil { |
| 678 | t.Fatalf("session new --channel error = %v", err) |
| 679 | } |
| 680 | var created SessionRecord |
| 681 | if err := json.Unmarshal([]byte(newOut), &created); err != nil { |
| 682 | t.Fatalf("json.Unmarshal(session new --channel) error = %v", err) |
| 683 | } |
| 684 | senderOut, _, err := executeRootCommand( |
| 685 | t, |
| 686 | h.deps, |
| 687 | "session", |
| 688 | "new", |
| 689 | "--agent", |
| 690 | "coder", |
| 691 | "--name", |
| 692 | "net-sender", |
| 693 | "--channel", |
| 694 | "builders", |
| 695 | "--cwd", |
| 696 | h.workspace, |
| 697 | "-o", |
| 698 | "json", |
| 699 | ) |
| 700 | if err != nil { |
| 701 | t.Fatalf("sender session new --channel error = %v", err) |
| 702 | } |
| 703 | var sender SessionRecord |
| 704 | if err := json.Unmarshal([]byte(senderOut), &sender); err != nil { |
| 705 | t.Fatalf("json.Unmarshal(sender session new --channel) error = %v", err) |
| 706 | } |
| 707 | |
| 708 | statusOut, _, err := executeRootCommand(t, h.deps, "network", "status", "-o", "json") |
nothing calls this directly
no test coverage detected