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

Method TestRelativePaths

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

Source from the content-addressed store, hash-verified

2752}
2753
2754func (ContainerSuite) TestRelativePaths(ctx context.Context, t *testctx.T) {
2755 c := connect(ctx, t)
2756
2757 dirRes, err := testutil.QueryWithClient[struct {
2758 Directory struct {
2759 WithNewFile struct {
2760 ID core.DirectoryID
2761 }
2762 }
2763 }](c, t,
2764 `{
2765 directory {
2766 withNewFile(path: "some-file", contents: "some-content") {
2767 id
2768 }
2769 }
2770 }`, nil)
2771 require.NoError(t, err)
2772
2773 id := dirRes.Directory.WithNewFile.ID
2774
2775 cacheID := newCache(t)
2776 writeRes, err := testutil.QueryWithClient[struct {
2777 Container struct {
2778 From struct {
2779 WithExec struct {
2780 WithWorkdir struct {
2781 WithWorkdir struct {
2782 Workdir string
2783 WithMountedDirectory struct {
2784 WithMountedTemp struct {
2785 WithMountedCache struct {
2786 Mounts []string
2787 WithExec struct {
2788 Directory struct {
2789 ID core.DirectoryID
2790 }
2791 }
2792 WithoutMount struct {
2793 Mounts []string
2794 }
2795 }
2796 }
2797 }
2798 }
2799 }
2800 }
2801 }
2802 }
2803 }](c, t,
2804 `query Test($id: ID!, $cache: ID!) {
2805 container {
2806 from(address: "`+alpineImage+`") {
2807 withExec(args: ["mkdir", "-p", "/mnt/sub"]) {
2808 withWorkdir(path: "/mnt") {
2809 withWorkdir(path: "sub") {
2810 workdir
2811 withMountedDirectory(path: "dir", source: $id) {

Callers

nothing calls this directly

Calls 4

QueryWithClientFunction · 0.92
connectFunction · 0.70
newCacheFunction · 0.70
EqualMethod · 0.65

Tested by

no test coverage detected