tracetest
tracetest copied to clipboard
feat: attribute referencing and expression support
This PR allows users to specify assertions using variables from the selected span and to use basic arithmetic expressions with it.
Examples:
testDefinition:
selector: span[name = "proxy"]
assertions:
- http.status_code = http.proxy.status_code # referencing an attribute from the span
- tracetest.span.endtime < tracetest.span.startTime + 800ms # same as duration < 800ms
Checklist
- [x] tested locally
- [ ] added new dependencies
- [ ] updated the docs
- [x] added a test
Related to #782
@schoren applied changes.