Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(testing): Implement EXPECT_SPAN_EVENTS_LIKE (#717)
Adds a new feature (`EXPECT_SPAN_EVENTS_LIKE`) for the `integration_runner` which allows testing for the existence of a set of spans in the actual spans created. It differs from `EXPECT_SPAN_EVENTS` in that it is not necessary to list ALL expected spans. For tests involving PHP frameworks the number of generated spans can be in the hundreds so it is not practical to use `EXPECT_SPAN_EVENTS` and thus `EXPECT_SPAN_EVENTS_LIKE` was added. Here is an example: ``` /*EXPECT_SPAN_EVENTS_LIKE [ [ { "category": "generic", "type": "Span", "guid": "??", "traceId": "??", "transactionId": "??", "name": "WebTransaction\/Action\/dispatch", "timestamp": "??", "duration": "??", "priority": "??", "sampled": true, "nr.entryPoint": true, "transaction.name": "WebTransaction\/Action\/dispatch" }, {}, { "response.headers.contentType": "text\/html", "http.statusCode": 200, "response.statusCode": 200, "httpResponseCode": "200", "request.uri": "\/dispatch", "request.method": "GET", "request.headers.host": "127.0.0.1" } ], [ { "category": "generic", "type": "Span", "guid": "??", "traceId": "??", "transactionId": "??", "name": "Custom\/App\\Http\\Controllers\\JobOne::dispatch", "timestamp": "??", "duration": "??", "priority": "??", "sampled": true, "parentId": "??" }, {}, { "code.lineno": "??", "code.namespace": "App\\Http\\Controllers\\JobOne", "code.filepath": "??", "code.function": "dispatch" } ] ] */ ``` --------- Co-authored-by: Michal Nowacki <[email protected]>
- Loading branch information