MCPcopy Create free account
hub / github.com/compozy/agh / TestCLINetworkRoundTripIntegration

Function TestCLINetworkRoundTripIntegration

internal/cli/cli_integration_test.go:651–915  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

649}
650
651func 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")

Callers

nothing calls this directly

Calls 11

newIntegrationHarnessFunction · 0.85
mustExecuteRootFunction · 0.85
executeRootCommandFunction · 0.85
blockSessionMethod · 0.80
ContainsMethod · 0.80
waitForExitMethod · 0.45
waitForBlockedMethod · 0.45
ErrorMethod · 0.45
AddMethod · 0.45
NowMethod · 0.45
releaseBlockedMethod · 0.45

Tested by

no test coverage detected