MCPcopy Create free account
hub / github.com/dagger/dagger / TestDefaultToModule

Method TestDefaultToModule

core/integration/module_shell_test.go:109–129  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

107}
108
109func (ShellSuite) TestDefaultToModule(ctx context.Context, t *testctx.T) {
110 c := connect(ctx, t)
111
112 out, err := modInit(t, c, "go", `package main
113
114import (
115 "dagger/test/internal/dagger"
116)
117
118type Test struct{}
119
120func (m *Test) Container() *dagger.Container {
121 return dag.Container(). From("`+alpineImage+`")
122}
123`,
124 ).
125 With(daggerShell("container | with-exec cat /etc/os-release | stdout")).
126 Stdout(ctx)
127 require.NoError(t, err)
128 require.Contains(t, out, "Alpine Linux")
129}
130
131func (ShellSuite) TestModuleLookup(ctx context.Context, t *testctx.T) {
132 c := connect(ctx, t)

Callers

nothing calls this directly

Calls 6

modInitFunction · 0.85
daggerShellFunction · 0.85
connectFunction · 0.70
ContainsMethod · 0.65
StdoutMethod · 0.45
WithMethod · 0.45

Tested by

no test coverage detected