(ctx context.Context, t *testctx.T, c *dagger.Client)
| 596 | } |
| 597 | |
| 598 | func 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 | |
| 625 | func moduleSourceCommitQuery(source string) string { |
| 626 | return fmt.Sprintf(`{ |
no test coverage detected