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

Method TestVariables

core/integration/container_test.go:843–874  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

841}
842
843func (ContainerSuite) TestVariables(ctx context.Context, t *testctx.T) {
844 res, err := testutil.Query[struct {
845 Container struct {
846 From struct {
847 EnvVariables []core.EnvVariable
848 WithExec struct {
849 Stdout string
850 }
851 }
852 }
853 }](t,
854 `{
855 container {
856 from(address: "golang:1.18.2-alpine") {
857 envVariables {
858 name
859 value
860 }
861 withExec(args: ["env"]) {
862 stdout
863 }
864 }
865 }
866 }`, nil)
867 require.NoError(t, err)
868 require.Equal(t, []core.EnvVariable{
869 {Name: "PATH", Value: "/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},
870 {Name: "GOLANG_VERSION", Value: "1.18.2"},
871 {Name: "GOPATH", Value: "/go"},
872 }, res.Container.From.EnvVariables)
873 require.Contains(t, res.Container.From.WithExec.Stdout, "GOPATH=/go\n")
874}
875
876func (ContainerSuite) TestVariable(ctx context.Context, t *testctx.T) {
877 c := connect(ctx, t)

Callers

nothing calls this directly

Calls 3

QueryFunction · 0.92
EqualMethod · 0.65
ContainsMethod · 0.65

Tested by

no test coverage detected