Skip to content

Commit e0853da

Browse files
authored
fix: fix harness tests with intoto v0.0.2 (sigstore#1052)
Signed-off-by: Asra Ali <asraa@google.com>
1 parent e7dc6c5 commit e0853da

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/harness_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ func compareAttestation(t *testing.T, logIndex int, got string) {
246246

247247
// Make sure we can get and verify all entries
248248
// For attestations, make sure we can see the attestation
249+
// Older versions of the CLI may not be able to parse the retrieved entry.
249250
func TestHarnessGetAllEntriesLogIndex(t *testing.T) {
251+
if rekorCLIIncompatible() {
252+
t.Skipf("Skipping getting entries by UUID, old rekor-cli version %s is incompatible with server version %s", os.Getenv("CLI_VERSION"), os.Getenv("SERVER_VERSION"))
253+
}
254+
250255
treeSize := activeTreeSize(t)
251256
if treeSize == 0 {
252257
t.Fatal("There are 0 entries in the log, there should be at least 2")
@@ -331,11 +336,15 @@ func activeTreeSize(t *testing.T) int {
331336

332337
// Check if we have a new server version and an old CLI version
333338
// since the new server returns an EntryID but the old CLI version expects a UUID
339+
// Also, new rekor server allows upload of intoto v0.0.2, and old rekor cli versions
340+
// don't understand how to parse these entries.
341+
// TODO: use semver comparisons.
334342
func rekorCLIIncompatible() bool {
335343
if sv := os.Getenv("SERVER_VERSION"); sv != "v0.10.0" && sv != "v0.11.0" {
336344
if cv := os.Getenv("CLI_VERSION"); cv == "v0.10.0" || cv == "v0.11.0" {
337345
return true
338346
}
339347
}
348+
340349
return false
341350
}

0 commit comments

Comments
 (0)