diff options
| author | Saumit <justsaumit@protonmail.com> | 2025-09-27 02:14:26 +0530 |
|---|---|---|
| committer | Saumit <justsaumit@protonmail.com> | 2025-09-27 02:14:26 +0530 |
| commit | 82e03978b89938219958032efb1448cc76baa181 (patch) | |
| tree | 626f3e54d52ecd49be0ed3bee30abacc0453d081 /test/tracetesting/payment/valid-credit-card.yaml | |
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/payment/valid-credit-card.yaml')
| -rw-r--r-- | test/tracetesting/payment/valid-credit-card.yaml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/tracetesting/payment/valid-credit-card.yaml b/test/tracetesting/payment/valid-credit-card.yaml new file mode 100644 index 0000000..3bc7a65 --- /dev/null +++ b/test/tracetesting/payment/valid-credit-card.yaml @@ -0,0 +1,39 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: Test +spec: + id: payment-valid-credit-card + name: "Payment: valid credit card" + description: Charge customer with a valid credit card + trigger: + type: grpc + grpc: + protobufFile: ../../../pb/demo.proto + address: ${var:PAYMENT_ADDR} + method: oteldemo.PaymentService.Charge + request: |- + { + "amount": { + "currencyCode": "USD", + "units": 43, + "nanos": 130000000 + }, + "creditCard": { + "creditCardNumber": "4432-8015-6152-0454", + "creditCardCvv": 672, + "creditCardExpirationYear": 2039, + "creditCardExpirationMonth": 1 + } + } + 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 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' != "" |
