From 5c75ca6f2b0158b0231f1db60f4676600e4ec406 Mon Sep 17 00:00:00 2001 From: Oscar Reyes Date: Fri, 21 Jul 2023 15:17:54 -0600 Subject: [PATCH] fix(tests): updating valid card validation expected status code --- .../payment-service/valid-credit-card.yaml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/tracetesting/payment-service/valid-credit-card.yaml b/test/tracetesting/payment-service/valid-credit-card.yaml index 2a3d41941b..3b38af6fe1 100644 --- a/test/tracetesting/payment-service/valid-credit-card.yaml +++ b/test/tracetesting/payment-service/valid-credit-card.yaml @@ -4,7 +4,7 @@ type: Test spec: id: payment-valid-credit-card - name: 'Payment: valid credit card' + name: "Payment: valid credit card" description: Charge customer with a valid credit card trigger: type: grpc @@ -27,12 +27,13 @@ spec: } } specs: - - name: It should call Charge method successfully - selector: span[tracetest.span.type="rpc" name="grpc.oteldemo.PaymentService/Charge" rpc.system="grpc" rpc.method="Charge" rpc.service="oteldemo.PaymentService"] - # instead of returning status_code 0, this service returns 1, but it works as intended - assertions: - - attr:rpc.grpc.status_code = 1 - - name: It should return a transaction ID - selector: span[tracetest.span.type="general" name="Tracetest trigger"] - assertions: - - attr:tracetest.response.body | json_path '$.transactionId' != "" + - name: It should call Charge method successfully + selector: span[tracetest.span.type="rpc" name="grpc.oteldemo.PaymentService/Charge" rpc.system="grpc" rpc.method="Charge" rpc.service="oteldemo.PaymentService"] + # instead of returning status_code 0, this service can return 1 depending on timing, but it works as intended + assertions: + # updating assertion to match 0 and 1 + - attr:rpc.grpc.status_code <= 1 + - name: It should return a transaction ID + selector: span[tracetest.span.type="general" name="Tracetest trigger"] + assertions: + - attr:tracetest.response.body | json_path '$.transactionId' != ""