Skip to content

Commit e558401

Browse files
committed
test: add stability test for the generated ref
1 parent 689dc2e commit e558401

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

integration_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ const (
2323
integrationModelName = "hf-internal-testing/tiny-random-GPT2Model"
2424
integrationModelRevision = "d6694b0d8fe17978761c9305dc151780506b192e"
2525
integrationModel = integrationModelName + "@" + integrationModelRevision
26+
27+
// integrationExpectedRef pins the full packed ref
28+
// (rootHash_hashOffset_uuid) for integrationModel. If such a change is
29+
// intentional, update this constant and treat it as a breaking change for
30+
// every already-enrolled artifact hash.
31+
integrationExpectedRef = "17c6605f3becf63a63da37cc6958b2d18f8abc750f9f546b9f57133db40c4326_2142208_9701bf21-6de2-59a2-bdea-141aaae05fc3"
2632
)
2733

2834
// TestEMWPRoundTripIntegration downloads and packs a tiny public model as
@@ -61,6 +67,13 @@ func TestEMWPRoundTripIntegration(t *testing.T) {
6167
if want := modelwrap.UUIDv5URL(integrationModel + "-emwp-outer"); ref.UUID != want {
6268
t.Fatalf("EMWP PARTUUID = %s, want %s", ref.UUID, want)
6369
}
70+
// Check that the generated ref is still stable. If the ref changes, then
71+
// the new version should be considered a breaking change.
72+
if rawRef != integrationExpectedRef {
73+
t.Fatalf("packed ref = %s, want %s\n"+
74+
"The generated artifact changed. If a packer toolchain change was intentional, "+
75+
"update integrationExpectedRef; otherwise find what changed in the container image.", rawRef, integrationExpectedRef)
76+
}
6477

6578
emwpFile := filepath.Join(work, "output", integrationModelName, integrationModelRevision+".emwp")
6679

0 commit comments

Comments
 (0)