Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/targethasher/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func Test_RemoveAttrs(t *testing.T) {
assert.NoError(t, err)
assert.False(t, target.External)
assert.Equal(t, regularTarget.GetRule().GetAttribute(), target.Attributes)
assert.Equal(t, []byte{0x69, 0x8b, 0x5, 0x75, 0x55, 0x80, 0x66, 0x5d, 0x7e, 0xbc, 0x75, 0x4, 0x8e, 0x62, 0x48, 0xb0, 0x82, 0x9c, 0x87, 0x82}, target.HashWithoutDeps)
assert.Equal(t, []byte{0x24, 0xa2, 0x3a, 0x8, 0x9e, 0x19, 0x34, 0x6e, 0xf3, 0x62, 0x9a, 0x8f, 0xca, 0x5e, 0x54, 0xc, 0xf2, 0xdd, 0x9d, 0x8d}, target.HashWithoutDeps)

externalTarget := &buildpb.Target{
Type: buildpb.Target_RULE.Enum(),
Expand All @@ -341,7 +341,7 @@ func Test_RemoveAttrs(t *testing.T) {
external, err := toTarget(externalTarget)
assert.NoError(t, err)
assert.True(t, external.External)
assert.Equal(t, []byte{0xbb, 0xee, 0x72, 0xbb, 0xda, 0x44, 0xa0, 0xb5, 0x27, 0x9f, 0x9c, 0xde, 0xda, 0xb3, 0xc9, 0x46, 0xbe, 0x7e, 0x14, 0x92}, external.HashWithoutDeps)
assert.Equal(t, []byte{0xfd, 0xc5, 0xc7, 0x60, 0x80, 0x27, 0xc9, 0xee, 0x59, 0x2d, 0x8e, 0xb, 0x67, 0x3f, 0xae, 0xab, 0xc4, 0x8b, 0x4f, 0xe3}, external.HashWithoutDeps)

// add sha256 attribute, hash should change
externalTarget.Rule.Attribute = append(externalTarget.Rule.Attribute, &buildpb.Attribute{
Expand All @@ -351,7 +351,7 @@ func Test_RemoveAttrs(t *testing.T) {
external, err = toTarget(externalTarget)
assert.NoError(t, err)
assert.True(t, external.External)
assert.Equal(t, []byte{0x7c, 0xde, 0x91, 0xc2, 0x94, 0x1a, 0x22, 0xf3, 0xb2, 0x18, 0x7c, 0x21, 0xbf, 0x32, 0x17, 0xc0, 0xa3, 0xf0, 0xc, 0x77}, external.HashWithoutDeps)
assert.Equal(t, []byte{0x6c, 0xeb, 0xec, 0x11, 0x74, 0x82, 0xae, 0x48, 0x6c, 0xff, 0x4f, 0x3c, 0xb1, 0xd2, 0xcf, 0x79, 0xf0, 0xe0, 0xee, 0xfc}, external.HashWithoutDeps)
}

func validateResultIsStable(t *testing.T, baseResult, result Result) {
Expand Down
Loading
Loading