Skip to content
Draft
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
feat(tests): Defaults to "null" for expected errors
If neither EXPECT_TRACED_ERRORS or EXPECT_ERROR_EVENTS defined then
default to "null" for both.  This will guarantee there is an explicit expectation for
an error if it expected for a test or else it will fail.
  • Loading branch information
mfulb committed Jan 25, 2024
commit 1a473943796fc76c31657978f9cf8919cb38a3ea
6 changes: 6 additions & 0 deletions src/newrelic/integration/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ func (t *Test) Compare(harvest *newrelic.Harvest) {
// check for any "expected spans like"
t.compareSpanEventsLike(harvest)

// if expected error events and traced errors are undefined - default to "null"
if nil == t.errorEvents && nil == t.tracedErrors {
t.errorEvents = []byte("null")
t.tracedErrors = []byte("null")
}

// check remaining payloads
t.comparePayload(t.analyticEvents, harvest.TxnEvents, false)
t.comparePayload(t.customEvents, harvest.CustomEvents, false)
Expand Down