(ctx context.Context, t *testctx.T)
| 874 | } |
| 875 | |
| 876 | func (ContainerSuite) TestVariable(ctx context.Context, t *testctx.T) { |
| 877 | c := connect(ctx, t) |
| 878 | res, err := testutil.QueryWithClient[struct { |
| 879 | Container struct { |
| 880 | From struct { |
| 881 | EnvVariable *string |
| 882 | } |
| 883 | } |
| 884 | }](c, t, |
| 885 | `{ |
| 886 | container { |
| 887 | from(address: "golang:1.18.2-alpine") { |
| 888 | envVariable(name: "GOLANG_VERSION") |
| 889 | } |
| 890 | } |
| 891 | }`, nil) |
| 892 | require.NoError(t, err) |
| 893 | require.NotNil(t, res.Container.From.EnvVariable) |
| 894 | require.Equal(t, "1.18.2", *res.Container.From.EnvVariable) |
| 895 | |
| 896 | res, err = testutil.QueryWithClient[struct { |
| 897 | Container struct { |
| 898 | From struct { |
| 899 | EnvVariable *string |
| 900 | } |
| 901 | } |
| 902 | }](c, t, |
| 903 | `{ |
| 904 | container { |
| 905 | from(address: "golang:1.18.2-alpine") { |
| 906 | envVariable(name: "UNKNOWN") |
| 907 | } |
| 908 | } |
| 909 | }`, nil) |
| 910 | require.NoError(t, err) |
| 911 | require.Nil(t, res.Container.From.EnvVariable) |
| 912 | } |
| 913 | |
| 914 | func (ContainerSuite) TestWithoutVariable(ctx context.Context, t *testctx.T) { |
| 915 | res, err := testutil.Query[struct { |
nothing calls this directly
no test coverage detected