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

Method TestPassingID

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

Source from the content-addressed store, hash-verified

565}
566
567func (ShellSuite) TestPassingID(ctx context.Context, t *testctx.T) {
568 c := connect(ctx, t)
569
570 source := `package main
571
572import "context"
573
574type Test struct{}
575
576func (m *Test) DirectoryID(ctx context.Context) (string, error) {
577 id, err := dag.Directory().WithNewFile("foo", "bar").ID(ctx)
578 return string(id), err
579}
580`
581 script := "node $(directory-id) | file foo | contents"
582
583 out, err := modInit(t, c, "go", source).
584 With(daggerShell(script)).
585 Stdout(ctx)
586
587 require.NoError(t, err)
588 require.Equal(t, "bar", out)
589}
590
591func (ShellSuite) TestInterfaceReturnConcreteFunction(ctx context.Context, t *testctx.T) {
592 c := connect(ctx, t)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected