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

Function startModuleResolveGitServiceWithRepo

core/integration/lockfile_test.go:598–623  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T, c *dagger.Client)

Source from the content-addressed store, hash-verified

596}
597
598func startModuleResolveGitServiceWithRepo(ctx context.Context, t *testctx.T, c *dagger.Client) (*dagger.Service, string, string) {
599 t.Helper()
600
601 content := c.Directory().
602 WithNewFile("dagger.json", `{"name":"lockmod","engineVersion":"latest"}`).
603 WithNewFile("README.md", "first revision")
604
605 gitDir := c.Container().
606 From(alpineImage).
607 WithExec([]string{"apk", "add", "git"}).
608 WithDirectory("/root/srv", makeGitDir(c, content, "main")).
609 WithExec([]string{"git", "config", "-f", "/root/srv/repo.git/config", "http.receivepack", "true"}).
610 Directory("/root/srv")
611
612 hostname := identity.NewID() + ".test"
613 gitDaemon, repoBaseURL := gitSmartHTTPServiceDirAuth(ctx, t, c, hostname, gitDir, "", nil)
614 repoURL := repoBaseURL + "/repo.git"
615 gitDaemon, err := gitDaemon.Start(ctx)
616 require.NoError(t, err)
617 t.Cleanup(func() {
618 _, err := gitDaemon.Stop(ctx)
619 require.NoError(t, err)
620 })
621
622 return gitDaemon, repoURL, repoURL + "@main"
623}
624
625func moduleSourceCommitQuery(source string) string {
626 return fmt.Sprintf(`{

Calls 12

NewIDFunction · 0.92
makeGitDirFunction · 0.85
CleanupMethod · 0.80
DirectoryMethod · 0.65
StartMethod · 0.65
WithNewFileMethod · 0.45
WithExecMethod · 0.45
WithDirectoryMethod · 0.45
FromMethod · 0.45
ContainerMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected