elastic / elastic/apm-server

test: use google/go-cmp consistently when comparing APMEvent slices

Open
#10,597 0 comments 0 reactions 0 assignees View on GitHub
8.9-candidate enhancement
Dominant language
Go
Stars
1.3k
Forks
543
Avg merge
1d 18h
Merged PRs (30d)
109

Description

Whenever we are comparing batches or event slices we should use go-cmp for nicer and more readable output.

See an example in https://github.com/elastic/apm-server/pull/10592

`assert.ElementsMatch` will print the whole slice, often complainig about extra elements without performing a diff of the two slices.
Use `cmp.Diff` so that we can see what is wrong and why the tests are failing

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.