tracetest icon indicating copy to clipboard operation
tracetest copied to clipboard

feat: attribute referencing and expression support

Open mathnogueira opened this issue 3 years ago • 1 comments

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

mathnogueira avatar Jul 27 '22 17:07 mathnogueira

Related to #782

mathnogueira avatar Jul 28 '22 13:07 mathnogueira

@schoren applied changes.

mathnogueira avatar Sep 01 '22 17:09 mathnogueira