Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kzys committed Nov 21, 2023
1 parent dd5c2fa commit d50b3b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion solver/llbsolver/vertex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ func TestRecomputeDigests(t *testing.T) {
require.Equal(t, newDigest, visited[oldDigest])
require.Equal(t, op1, all[newDigest])
assert.Equal(t, op2, all[updated])
require.Equal(t, newDigest, op2.Inputs[0].Digest)
require.Equal(t, newDigest, digest.Digest(op2.Inputs[0].Digest))
assert.NotEqual(t, op2Digest, updated)
}
5 changes: 3 additions & 2 deletions sourcepolicy/mutate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/moby/buildkit/solver/pb"
spb "github.com/moby/buildkit/sourcepolicy/pb"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)

func TestMutate(t *testing.T) {
Expand Down Expand Up @@ -126,15 +127,15 @@ func TestMutate(t *testing.T) {

ctx := context.Background()
for _, tc := range testCases {
op := *tc.op
op := tc.op
t.Run(op.String(), func(t *testing.T) {
src := op.GetSource()
mutated, err := mutate(ctx, src, tc.rule, &selectorCache{Selector: tc.rule.Selector}, src.GetIdentifier())
require.Equal(t, tc.expected, mutated)
if tc.expectedErr != "" {
require.Error(t, err, tc.expectedErr)
} else {
require.Equal(t, tc.expectedOp, &op)
require.True(t, proto.Equal(tc.expectedOp, op))
}
})
}
Expand Down

0 comments on commit d50b3b1

Please sign in to comment.