MCPcopy Create free account
hub / github.com/clouditor/clouditor / TestMain

Function TestMain

server/rest/rest_integration_test.go:59–91  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

57)
58
59func TestMain(m *testing.M) {
60 var (
61 err error
62 srv *grpc.Server
63 sock net.Listener
64 authPort uint16
65 )
66
67 clitest.AutoChdir()
68
69 _, authPort, err = testutil.StartAuthenticationServer()
70 if err != nil {
71 panic(err)
72 }
73
74 // Start at least an orchestrator service, so that we have something to forward
75 sock, srv, err = server.StartGRPCServer("127.0.0.1:0",
76 server.WithJWKS(testutil.JWKSURL(authPort)),
77 server.WithServices(orchestrator.NewService()),
78 )
79 if err != nil {
80 panic(err)
81 }
82
83 grpcPort = sock.Addr().(*net.TCPAddr).AddrPort().Port()
84
85 exit := m.Run()
86
87 sock.Close()
88 srv.Stop()
89
90 os.Exit(exit)
91}
92
93func TestREST(t *testing.T) {
94 go func() {

Callers

nothing calls this directly

Calls 7

AutoChdirFunction · 0.92
StartGRPCServerFunction · 0.92
WithJWKSFunction · 0.92
JWKSURLFunction · 0.92
WithServicesFunction · 0.92
NewServiceFunction · 0.92

Tested by

no test coverage detected