MCPcopy Index your code
hub / github.com/dagger/dagger / TestReleaseLibraryInModule

Method TestReleaseLibraryInModule

core/integration/module_go_test.go:1817–1846  ·  view source on GitHub ↗

Verify that we can use the released library in module. WARNING: this test can fail if we make a breaking change on the `telemetry` or `querybuilder` package and use that changes in the go generated files. If so, please disable that test until the release is done then re enable it.

(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

1815// `querybuilder` package and use that changes in the go generated files.
1816// If so, please disable that test until the release is done then re enable it.
1817func (GoSuite) TestReleaseLibraryInModule(ctx context.Context, t *testctx.T) {
1818 t.Skip("broken, see line 523 of core/sdk/go_sdk.go")
1819 versions := []string{"v0.19.10", "v0.19.5"}
1820
1821 for _, version := range versions {
1822 version := version
1823
1824 t.Run(fmt.Sprintf("use version %s", version), func(ctx context.Context, t *testctx.T) {
1825 c := connect(ctx, t)
1826
1827 devEngineSvc := devEngineContainerAsService(devEngineContainer(c, func(c *dagger.Container) *dagger.Container {
1828 return c.
1829 WithEnvVariable("_EXPERIMENTAL_DAGGER_VERSION", version)
1830 }))
1831
1832 modCtr := engineClientContainer(ctx, t, c, devEngineSvc).
1833 WithEnvVariable("_EXPERIMENTAL_DAGGER_VERSION", version).
1834 WithWorkdir("/work").
1835 With(daggerNonNestedExec("init", "--sdk=go", "--name=test", "--source=."))
1836
1837 goMod, err := modCtr.File("go.mod").Contents(ctx)
1838 require.NoError(t, err)
1839 require.Contains(t, goMod, fmt.Sprintf("dagger.io/dagger %s", version))
1840
1841 out, err := modCtr.With(daggerNonNestedExec("call", "container-echo", "--string-arg", "hello", "stdout")).Stdout(ctx)
1842 require.NoError(t, err)
1843 require.Equal(t, out, "hello\n")
1844 })
1845 }
1846}
1847
1848func (GoSuite) TestNameCase(ctx context.Context, t *testctx.T) {
1849 c := connect(ctx, t)

Callers

nothing calls this directly

Calls 14

devEngineContainerFunction · 0.85
engineClientContainerFunction · 0.85
daggerNonNestedExecFunction · 0.85
connectFunction · 0.70
RunMethod · 0.65
FileMethod · 0.65
ContainsMethod · 0.65
EqualMethod · 0.65
WithEnvVariableMethod · 0.45
WithMethod · 0.45
WithWorkdirMethod · 0.45

Tested by

no test coverage detected