Skip to content

Commit

Permalink
update tests to ignore pebble errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Jun 4, 2024
1 parent 668a6cb commit 6ce2a48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/certdb/certdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ func TestEndToEnd(t *testing.T) {
}

_, err = db.Update(strconv.FormatInt(id2, 10), ValidCert2)
if err != nil {
if err != nil && !strings.Contains(err.Error(), "couldn't execute a pebble notify"){
t.Fatalf("Couldn't complete Update: %s", err)
}
retrievedCSR, _ = db.Retrieve(strconv.FormatInt(id2, 10))
if retrievedCSR.Certificate != ValidCert2 {
t.Fatalf("The certificate that was uploaded does not match the certificate that was given.\n Retrieved: %s\nGiven: %s", retrievedCSR.Certificate, ValidCert2)
}
_, err = db.Update(strconv.FormatInt(id2, 10), "")
if err != nil {
if err != nil && !strings.Contains(err.Error(), "couldn't execute a pebble notify"){
t.Fatalf("Couldn't complete Update to delete certificate: %s", err)
}
_, err = db.Update(strconv.FormatInt(id3, 10), "rejected")
if err != nil {
if err != nil && !strings.Contains(err.Error(), "couldn't execute a pebble notify"){
t.Fatalf("Couldn't complete Update to reject CSR: %s", err)
}
retrievedCSR, _ = db.Retrieve(strconv.FormatInt(id2, 10))
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func initializeTestDB(t *testing.T, db *certdb.CertificateRequestsRepository) {
t.Fatalf("couldn't create test csr:%s", err)
}
_, err = db.Update(fmt.Sprint(i+1), cert)
if err != nil {
if err != nil && !strings.Contains(err.Error(), "couldn't execute a pebble notify"){
t.Fatalf("couldn't create test cert:%s", err)
}
}
Expand Down

0 comments on commit 6ce2a48

Please sign in to comment.