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

Method TestWithoutVariable

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

Source from the content-addressed store, hash-verified

912}
913
914func (ContainerSuite) TestWithoutVariable(ctx context.Context, t *testctx.T) {
915 res, err := testutil.Query[struct {
916 Container struct {
917 From struct {
918 WithoutEnvVariable struct {
919 EnvVariables []core.EnvVariable
920 WithExec struct {
921 Stdout string
922 }
923 }
924 }
925 }
926 }](t,
927 `{
928 container {
929 from(address: "golang:1.18.2-alpine") {
930 withoutEnvVariable(name: "GOLANG_VERSION") {
931 envVariables {
932 name
933 value
934 }
935 withExec(args: ["env"]) {
936 stdout
937 }
938 }
939 }
940 }
941 }`, nil)
942 require.NoError(t, err)
943 require.Equal(t, res.Container.From.WithoutEnvVariable.EnvVariables, []core.EnvVariable{
944 {Name: "PATH", Value: "/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},
945 {Name: "GOPATH", Value: "/go"},
946 })
947 require.NotContains(t, res.Container.From.WithoutEnvVariable.WithExec.Stdout, "GOLANG_VERSION")
948}
949
950func (ContainerSuite) TestEnvVariablesReplace(ctx context.Context, t *testctx.T) {
951 res, err := testutil.Query[struct {

Callers

nothing calls this directly

Calls 2

QueryFunction · 0.92
EqualMethod · 0.65

Tested by

no test coverage detected