MCPcopy Index your code
hub / github.com/dagger/dagger / TestGitSourceArgRef

Function TestGitSourceArgRef

cmd/dagger/shell_test.go:19–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestGitSourceArgRef(t *testing.T) {
20 // These are valid ModuleSource cloneRef URLs and versions, taken from
21 // core/schema/modulesource_test.go.
22 //
23 // When producing a path for a Directory or File argument we need to produce a
24 // different kind of URL (buildkit convention), which is then passed through
25 // to the default CLI flag. The flag checks if it's a git URL by passing it
26 // through `parseGitURL`, so we check if that validation will succeed.
27 cases := []gitSourceContext{
28 {Root: "github.com/shykes/daggerverse", Path: "ci"},
29 {Root: "github.com/shykes/daggerverse.git", Path: "ci", Version: "version"},
30 {Root: "gitlab.com/testguigui1/dagger-public-sub/mywork", Path: "depth1/depth2"},
31 {Root: "bitbucket.org/test-travail/test", Path: "depth1"},
32 {Root: "ssh://git@github.com/shykes/daggerverse"},
33 {Root: "github.com:shykes/daggerverse.git", Path: "ci", Version: "version"},
34 {Root: "dev.azure.com/daggere2e/public/_git/dagger-test-modules", Path: "cool-sdk"},
35 {Root: "ssh://git@ssh.dev.azure.com/v3/daggere2e/public/dagger-test-modules", Path: "cool-sdk"},
36 }
37 for _, c := range cases {
38 url := c.ArgRef("")
39 t.Run(url, func(t *testing.T) {
40 t.Parallel()
41 _, err := gitutil.ParseURL(url)
42 require.NoError(t, err)
43 })
44 }
45}
46
47func (DaggerCMDSuite) TestLLMFileSyncing(ctx context.Context, t *testctx.T) {
48 if _, err := os.Stat("/dagger.env"); os.IsNotExist(err) {

Callers

nothing calls this directly

Calls 3

ParseURLFunction · 0.92
ArgRefMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected