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

Function assertGitLockEntry

core/integration/lockfile_test.go:530–553  ·  view source on GitHub ↗
(t *testctx.T, lockBytes []byte, operation string, expectedInputs []any, expectedPolicy workspace.LockPolicy)

Source from the content-addressed store, hash-verified

528}
529
530func assertGitLockEntry(t *testctx.T, lockBytes []byte, operation string, expectedInputs []any, expectedPolicy workspace.LockPolicy) {
531 t.Helper()
532 parsed, err := lockfile.Parse(lockBytes)
533 require.NoError(t, err)
534
535 var found bool
536 for _, entry := range parsed.Entries() {
537 if entry.Namespace != "" || entry.Operation != operation {
538 continue
539 }
540 if !equalLockInputs(entry.Inputs, expectedInputs) {
541 continue
542 }
543
544 found = true
545 require.Equal(t, string(expectedPolicy), entry.Policy)
546
547 value, ok := entry.Value.(string)
548 require.True(t, ok)
549 require.True(t, len(value) == 40 || strings.HasPrefix(value, "sha256:"))
550 }
551
552 require.True(t, found, "expected %s entry in lockfile", operation)
553}
554
555func assertModuleResolveLockEntry(t *testctx.T, lockBytes []byte, source string, expectedPolicy workspace.LockPolicy) {
556 t.Helper()

Calls 4

ParseFunction · 0.92
equalLockInputsFunction · 0.85
EqualMethod · 0.65
EntriesMethod · 0.45

Tested by

no test coverage detected