tracetest icon indicating copy to clipboard operation
tracetest copied to clipboard

support expressions in assertions

Open mathnogueira opened this issue 2 years ago • 0 comments

Problem

Today we only can execute assertions against static values. However, there are some use-cases for more complex assertions, such as asserting that an operation that is async runs in under 2 minutes. Or that your wallet balance is less than it was before the purchase.

Examples

myapp.user.balance < myapp.user.balance_before_purchase
span.endTime < tracetest.execution.startTime + 2m

Design

To make it fast, I think this should not allow using attributes from other spans. So, you can only reference attributes of the span that is being validated at that moment.

mathnogueira avatar Jun 21 '22 18:06 mathnogueira