MCPcopy
hub / github.com/yusing/godoxy / addRoute

Function addRoute

internal/entrypoint/entrypoint_test.go:20–44  ·  view source on GitHub ↗
(t *testing.T, alias string)

Source from the content-addressed store, hash-verified

18const testHTTPRouteListenPort = 18080
19
20func addRoute(t *testing.T, alias string) {
21 t.Helper()
22
23 ep := entrypoint.FromCtx(task.GetTestTask(t).Context())
24 require.NotNil(t, ep)
25
26 startedRoute, err := route.NewStartedTestRoute(t, &route.Route{
27 Alias: alias,
28 Scheme: routeTypes.SchemeHTTP,
29 Port: route.Port{
30 Listening: testHTTPRouteListenPort,
31 Proxy: 8080,
32 },
33 HealthCheck: types.HealthCheckConfig{
34 Disable: true,
35 },
36 })
37 if err != nil {
38 t.Fatal(err)
39 }
40
41 route, ok := ep.HTTPRoutes().Get(startedRoute.Key())
42 require.True(t, ok, "route not found")
43 require.NotNil(t, route)
44}
45
46func run(t *testing.T, ep *Entrypoint, match []string, noMatch []string) {
47 t.Helper()

Callers 13

TestFindRouteAnyDomainFunction · 0.85
TestFindRouteByDomainsFunction · 0.85
TestFindRouteWithPortFunction · 0.85
TestHealthInfoQueriesFunction · 0.85
TestRoutesByProviderFunction · 0.85
TestNumRoutesFunction · 0.85
TestIterRoutesFunction · 0.85
TestGetRouteFunction · 0.85

Calls 5

NewStartedTestRouteFunction · 0.92
ContextMethod · 0.65
GetMethod · 0.65
HTTPRoutesMethod · 0.65
KeyMethod · 0.65

Tested by

no test coverage detected