-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[7.x] Introduce approvaltest module (#4112) #4162
Conversation
* Introduce new approvaltest module We move tests/approvals and tests/scripts/approvals.go intoa new module, github.com/elastic/apm-server/approvaltest. This new module will be used by both apm-server (integration tests) and the systemtest module. We also reduce the API surface area to two functions: ApproveJSON, and ApproveEventDocs. The ApproveJSON function can be used for approving arbitrary JSON-encoded values, while ApproveEventDocs is specifically intended for approving JSON-encoded Elasticsearch event documents. To enable the API reduction, we introduce beatertest.EncodeEventDoc(s), which encode events using the libbeat Elasticsearch output. In some tests we previously used the libbeat JSON codec directly, which led to @metadata being included in diffs. The output removes @metadata, hence it no longer features in our approval diffs. * Update approved files - Since we now use the Elasticsearch output, rather than directly using the libbeat JSON codec, `@metadata` is no longer part of the diff, and `@timestamp` is encoded slightly differently. - For dynamic fields like `profile.id`, we now replace the value with a known string ("dynamic") rather than ignoring the field. * .ci/docker/golang-mage: support multiple modules
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
Copy in approvaltest/go.mod (and systemtest/go.mod for good measure) to fix `go mod download` at the top level. Also run `go mod download` for the sub-modules, to speed up repeat runs of docker-system-tests.
Backports the following commits to 7.x: