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

Method TestContextGitRemote

core/integration/module_test.go:5204–5246  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

5202}
5203
5204func (ModuleSuite) TestContextGitRemote(ctx context.Context, t *testctx.T) {
5205 // pretty much exactly the same test as above, but calling a remote git repo instead
5206
5207 c := connect(ctx, t)
5208
5209 modGen := goGitBase(t, c)
5210
5211 remoteModule := "github.com/dagger/dagger-test-modules"
5212 remoteRef := "context-git"
5213 g := c.Git(remoteModule).Ref(remoteRef)
5214 commit, err := g.Commit(ctx)
5215 require.NoError(t, err)
5216 fullref, err := g.Ref(ctx)
5217 require.NoError(t, err)
5218
5219 modPath := "github.com/dagger/dagger-test-modules/context-git@" + remoteRef
5220
5221 t.Run("repo local", func(ctx context.Context, t *testctx.T) {
5222 out, err := modGen.With(daggerCallAt(modPath, "test-repo-local")).Stdout(ctx)
5223 require.NoError(t, err)
5224 require.Equal(t, fullref+"@"+commit, out)
5225 })
5226
5227 t.Run("repo remote", func(ctx context.Context, t *testctx.T) {
5228 out, err := modGen.With(daggerCallAt(modPath, "test-repo-remote")).Stdout(ctx)
5229 require.NoError(t, err)
5230 // dagger/dagger v0.18.2 => 0b46ea3c49b5d67509f67747742e5d8b24be9ef7
5231 require.Equal(t, "refs/tags/v0.18.2@0b46ea3c49b5d67509f67747742e5d8b24be9ef7", out)
5232 })
5233
5234 t.Run("ref local", func(ctx context.Context, t *testctx.T) {
5235 out, err := modGen.With(daggerCallAt(modPath, "test-ref-local")).Stdout(ctx)
5236 require.NoError(t, err)
5237 require.Equal(t, fullref+"@"+commit, out)
5238 })
5239
5240 t.Run("ref remote", func(ctx context.Context, t *testctx.T) {
5241 out, err := modGen.With(daggerCallAt(modPath, "test-ref-remote")).Stdout(ctx)
5242 require.NoError(t, err)
5243 // dagger/dagger v0.18.3 => 6f7af26f18061c6f575eda774f44aa7d314af4ce
5244 require.Equal(t, "refs/tags/v0.18.3@6f7af26f18061c6f575eda774f44aa7d314af4ce", out)
5245 })
5246}
5247
5248func (ModuleSuite) TestContextGitRemoteDep(ctx context.Context, t *testctx.T) {
5249 // pretty much exactly the same test as above, but calling a remote git repo via a pinned dependency

Callers

nothing calls this directly

Calls 10

goGitBaseFunction · 0.85
daggerCallAtFunction · 0.85
connectFunction · 0.70
CommitMethod · 0.65
RunMethod · 0.65
EqualMethod · 0.65
RefMethod · 0.45
GitMethod · 0.45
StdoutMethod · 0.45
WithMethod · 0.45

Tested by

no test coverage detected