From aa901c4fda53eb1749e91e0cecad4a6edff341a2 Mon Sep 17 00:00:00 2001 From: Daniel Baptista Dias Date: Wed, 30 Aug 2023 17:31:38 -0300 Subject: [PATCH] chore: update trace based tests to test stream events (#1072) --- CHANGELOG.md | 2 ++ docker-compose.yml | 5 +++ test/tracetesting/ad-service/all.yaml | 2 +- test/tracetesting/ad-service/get.yaml | 2 +- .../cart-service/add-item-to-cart.yaml | 2 +- test/tracetesting/cart-service/all.yaml | 2 +- .../cart-service/check-if-cart-is-empty.yaml | 2 +- .../check-if-cart-is-populated.yaml | 2 +- .../tracetesting/cart-service/empty-cart.yaml | 2 +- test/tracetesting/checkout-service/all.yaml | 2 +- .../checkout-service/place-order.yaml | 6 +++- test/tracetesting/currency-service/all.yaml | 2 +- .../currency-service/convert.yaml | 2 +- .../currency-service/supported.yaml | 2 +- test/tracetesting/email-service/all.yaml | 2 +- .../email-service/confirmation.yaml | 2 +- .../frontend-service/01-see-ads.yaml | 2 +- .../02-get-product-recommendation.yaml | 2 +- .../frontend-service/03-browse-product.yaml | 2 +- .../04-add-product-to-cart.yaml | 2 +- .../frontend-service/05-view-cart.yaml | 2 +- .../06-checking-out-cart.yaml | 32 +++++++++++++------ test/tracetesting/frontend-service/all.yaml | 2 +- test/tracetesting/payment-service/all.yaml | 2 +- .../amex-credit-card-not-allowed.yaml | 2 +- .../payment-service/expired-credit-card.yaml | 2 +- .../payment-service/invalid-credit-card.yaml | 2 +- .../payment-service/valid-credit-card.yaml | 2 +- .../product-catalog-service/all.yaml | 2 +- .../product-catalog-service/get.yaml | 2 +- .../product-catalog-service/list.yaml | 2 +- .../product-catalog-service/search.yaml | 2 +- .../recommendation-service/all.yaml | 2 +- .../recommendation-service/list.yaml | 2 +- test/tracetesting/run.bash | 14 ++++---- test/tracetesting/shipping-service/all.yaml | 2 +- .../shipping-service/empty-quote.yaml | 2 +- test/tracetesting/shipping-service/order.yaml | 2 +- test/tracetesting/shipping-service/quote.yaml | 2 +- 39 files changed, 77 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a64e6edb..b17d41cdb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ release. ## Unreleased +* update trace-based tests to test stream events + ([#1072](https://github.com/open-telemetry/opentelemetry-demo/pull/1072)) * Add cartServiceFailure feature flag triggering Cart Service errors ([#824](https://github.com/open-telemetry/opentelemetry-demo/pull/824)) * [paymentservice] update JS SDKs to 1.12.0/0.38.0 diff --git a/docker-compose.yml b/docker-compose.yml index 64d01c33f5..51e097e3e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -828,6 +828,7 @@ services: - PRODUCT_CATALOG_SERVICE_ADDR - RECOMMENDATION_SERVICE_ADDR - SHIPPING_SERVICE_ADDR + - KAFKA_SERVICE_ADDR extra_hosts: - "host.docker.internal:host-gateway" depends_on: @@ -856,6 +857,10 @@ services: condition: service_started quoteservice: condition: service_started + accountingservice: + condition: service_started + frauddetectionservice: + condition: service_started tracetest-server: image: kubeshop/tracetest:latest diff --git a/test/tracetesting/ad-service/all.yaml b/test/tracetesting/ad-service/all.yaml index 70bdbcca31..a114984752 100644 --- a/test/tracetesting/ad-service/all.yaml +++ b/test/tracetesting/ad-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: ad-service-all name: 'Ad Service' diff --git a/test/tracetesting/ad-service/get.yaml b/test/tracetesting/ad-service/get.yaml index 58c18f8888..a5b710f457 100644 --- a/test/tracetesting/ad-service/get.yaml +++ b/test/tracetesting/ad-service/get.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:AD_SERVICE_ADDR} + address: ${var:AD_SERVICE_ADDR} method: oteldemo.AdService.GetAds request: |- { diff --git a/test/tracetesting/cart-service/add-item-to-cart.yaml b/test/tracetesting/cart-service/add-item-to-cart.yaml index a63ad7c632..704ad57708 100644 --- a/test/tracetesting/cart-service/add-item-to-cart.yaml +++ b/test/tracetesting/cart-service/add-item-to-cart.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CART_SERVICE_ADDR} + address: ${var:CART_SERVICE_ADDR} method: oteldemo.CartService.AddItem request: |- { diff --git a/test/tracetesting/cart-service/all.yaml b/test/tracetesting/cart-service/all.yaml index 89a5457344..03ee4e55d7 100644 --- a/test/tracetesting/cart-service/all.yaml +++ b/test/tracetesting/cart-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: cart-all name: 'Cart Service' diff --git a/test/tracetesting/cart-service/check-if-cart-is-empty.yaml b/test/tracetesting/cart-service/check-if-cart-is-empty.yaml index 53292b2d9b..a78bb784c2 100644 --- a/test/tracetesting/cart-service/check-if-cart-is-empty.yaml +++ b/test/tracetesting/cart-service/check-if-cart-is-empty.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CART_SERVICE_ADDR} + address: ${var:CART_SERVICE_ADDR} method: oteldemo.CartService.GetCart request: |- { diff --git a/test/tracetesting/cart-service/check-if-cart-is-populated.yaml b/test/tracetesting/cart-service/check-if-cart-is-populated.yaml index 25e5d8a1a7..b18acc4905 100644 --- a/test/tracetesting/cart-service/check-if-cart-is-populated.yaml +++ b/test/tracetesting/cart-service/check-if-cart-is-populated.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CART_SERVICE_ADDR} + address: ${var:CART_SERVICE_ADDR} method: oteldemo.CartService.GetCart request: |- { diff --git a/test/tracetesting/cart-service/empty-cart.yaml b/test/tracetesting/cart-service/empty-cart.yaml index 7fdf4f6f20..ae8f7a28e3 100644 --- a/test/tracetesting/cart-service/empty-cart.yaml +++ b/test/tracetesting/cart-service/empty-cart.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CART_SERVICE_ADDR} + address: ${var:CART_SERVICE_ADDR} method: oteldemo.CartService.EmptyCart request: |- { diff --git a/test/tracetesting/checkout-service/all.yaml b/test/tracetesting/checkout-service/all.yaml index 031e478414..8d083a8815 100644 --- a/test/tracetesting/checkout-service/all.yaml +++ b/test/tracetesting/checkout-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: checkout-service-all name: 'Checkout Service' diff --git a/test/tracetesting/checkout-service/place-order.yaml b/test/tracetesting/checkout-service/place-order.yaml index 14e88ef119..800ef158d6 100644 --- a/test/tracetesting/checkout-service/place-order.yaml +++ b/test/tracetesting/checkout-service/place-order.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CHECKOUT_SERVICE_ADDR} + address: ${var:CHECKOUT_SERVICE_ADDR} method: oteldemo.CheckoutService.PlaceOrder request: |- { @@ -44,3 +44,7 @@ spec: rpc.system="grpc" rpc.method="PlaceOrder" rpc.service="oteldemo.CheckoutService"] assertions: - attr:rpc.grpc.status_code = 0 + - name: It sends an order to be processed asyncronously + selector: span[tracetest.span.type="messaging" name="orders send" messaging.system="kafka" messaging.destination="orders" messaging.destination_kind="topic" messaging.operation="send"] + assertions: + - attr:messaging.destination = "orders" diff --git a/test/tracetesting/currency-service/all.yaml b/test/tracetesting/currency-service/all.yaml index ee1bdc4965..843df84c9e 100644 --- a/test/tracetesting/currency-service/all.yaml +++ b/test/tracetesting/currency-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: currency-service-all name: 'Currency Service' diff --git a/test/tracetesting/currency-service/convert.yaml b/test/tracetesting/currency-service/convert.yaml index f0c6ead817..9bc7710ce9 100644 --- a/test/tracetesting/currency-service/convert.yaml +++ b/test/tracetesting/currency-service/convert.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CURRENCY_SERVICE_ADDR} + address: ${var:CURRENCY_SERVICE_ADDR} method: oteldemo.CurrencyService.Convert request: |- { diff --git a/test/tracetesting/currency-service/supported.yaml b/test/tracetesting/currency-service/supported.yaml index 491dd03cc8..5533594c80 100644 --- a/test/tracetesting/currency-service/supported.yaml +++ b/test/tracetesting/currency-service/supported.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:CURRENCY_SERVICE_ADDR} + address: ${var:CURRENCY_SERVICE_ADDR} method: oteldemo.CurrencyService.GetSupportedCurrencies specs: - name: It has a span called "CurrencyService/GetSupportedCurrencies" diff --git a/test/tracetesting/email-service/all.yaml b/test/tracetesting/email-service/all.yaml index 3fde9a62e4..0a2f79aaad 100644 --- a/test/tracetesting/email-service/all.yaml +++ b/test/tracetesting/email-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: email-service-all name: 'Email Service' diff --git a/test/tracetesting/email-service/confirmation.yaml b/test/tracetesting/email-service/confirmation.yaml index e586f6d3bc..6aff590e31 100644 --- a/test/tracetesting/email-service/confirmation.yaml +++ b/test/tracetesting/email-service/confirmation.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: ${env:EMAIL_SERVICE_ADDR}/send_order_confirmation + url: ${var:EMAIL_SERVICE_ADDR}/send_order_confirmation method: POST headers: - key: Content-Type diff --git a/test/tracetesting/frontend-service/01-see-ads.yaml b/test/tracetesting/frontend-service/01-see-ads.yaml index 0e9e7fd6d9..698a6dfb92 100644 --- a/test/tracetesting/frontend-service/01-see-ads.yaml +++ b/test/tracetesting/frontend-service/01-see-ads.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: http://${env:FRONTEND_ADDR}/api/data + url: http://${var:FRONTEND_ADDR}/api/data method: GET headers: - key: Content-Type diff --git a/test/tracetesting/frontend-service/02-get-product-recommendation.yaml b/test/tracetesting/frontend-service/02-get-product-recommendation.yaml index bc0bb2a87c..78569c3162 100644 --- a/test/tracetesting/frontend-service/02-get-product-recommendation.yaml +++ b/test/tracetesting/frontend-service/02-get-product-recommendation.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: http://${env:FRONTEND_ADDR}/api/recommendations + url: http://${var:FRONTEND_ADDR}/api/recommendations method: GET headers: - key: Content-Type diff --git a/test/tracetesting/frontend-service/03-browse-product.yaml b/test/tracetesting/frontend-service/03-browse-product.yaml index 041a0c582f..2d13fdfa4a 100644 --- a/test/tracetesting/frontend-service/03-browse-product.yaml +++ b/test/tracetesting/frontend-service/03-browse-product.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: http://${env:FRONTEND_ADDR}/api/products/0PUK6V6EV0 + url: http://${var:FRONTEND_ADDR}/api/products/0PUK6V6EV0 method: GET headers: - key: Content-Type diff --git a/test/tracetesting/frontend-service/04-add-product-to-cart.yaml b/test/tracetesting/frontend-service/04-add-product-to-cart.yaml index 5c838c6685..f0ad829cb4 100644 --- a/test/tracetesting/frontend-service/04-add-product-to-cart.yaml +++ b/test/tracetesting/frontend-service/04-add-product-to-cart.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: http://${env:FRONTEND_ADDR}/api/cart + url: http://${var:FRONTEND_ADDR}/api/cart method: POST headers: - key: Content-Type diff --git a/test/tracetesting/frontend-service/05-view-cart.yaml b/test/tracetesting/frontend-service/05-view-cart.yaml index f029ceadb9..921b6e55d0 100644 --- a/test/tracetesting/frontend-service/05-view-cart.yaml +++ b/test/tracetesting/frontend-service/05-view-cart.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: http://${env:FRONTEND_ADDR}/api/cart?userId=2491f868-88f1-4345-8836-d5d8511a9f83 + url: http://${var:FRONTEND_ADDR}/api/cart?userId=2491f868-88f1-4345-8836-d5d8511a9f83 method: GET headers: - key: Content-Type diff --git a/test/tracetesting/frontend-service/06-checking-out-cart.yaml b/test/tracetesting/frontend-service/06-checking-out-cart.yaml index 3c9be1579b..db54d7ab41 100644 --- a/test/tracetesting/frontend-service/06-checking-out-cart.yaml +++ b/test/tracetesting/frontend-service/06-checking-out-cart.yaml @@ -9,7 +9,7 @@ spec: trigger: type: http httpRequest: - url: http://${env:FRONTEND_ADDR}/api/checkout + url: http://${var:FRONTEND_ADDR}/api/checkout method: POST headers: - key: Content-Type @@ -38,23 +38,37 @@ spec: selector: span[tracetest.span.type="general" name="Tracetest trigger"] assertions: - attr:tracetest.response.status = 200 - - selector: span[tracetest.span.type="rpc" name="oteldemo.CheckoutService/PlaceOrder" rpc.system="grpc" rpc.method="PlaceOrder" rpc.service="oteldemo.CheckoutService"] - name: "The order was placed" + - name: "The order was placed" + selector: span[tracetest.span.type="rpc" name="oteldemo.CheckoutService/PlaceOrder" rpc.system="grpc" rpc.method="PlaceOrder" rpc.service="oteldemo.CheckoutService"] assertions: - attr:app.user.id = "2491f868-88f1-4345-8836-d5d8511a9f83" - attr:app.order.items.count = 1 - - selector: span[tracetest.span.type="rpc" name="oteldemo.PaymentService/Charge" rpc.system="grpc" rpc.method="Charge" rpc.service="oteldemo.PaymentService"] - name: "The user was charged" + - name: "The user was charged" + selector: span[tracetest.span.type="rpc" name="oteldemo.PaymentService/Charge" rpc.system="grpc" rpc.method="Charge" rpc.service="oteldemo.PaymentService"] assertions: - attr:rpc.grpc.status_code = 0 - attr:tracetest.selected_spans.count >= 1 - - selector: span[tracetest.span.type="rpc" name="oteldemo.ShippingService/ShipOrder" rpc.system="grpc" rpc.method="ShipOrder" rpc.service="oteldemo.ShippingService"] - name: "The product was shipped" + - name: "The product was shipped" + selector: span[tracetest.span.type="rpc" name="oteldemo.ShippingService/ShipOrder" rpc.system="grpc" rpc.method="ShipOrder" rpc.service="oteldemo.ShippingService"] assertions: - attr:rpc.grpc.status_code = 0 - attr:tracetest.selected_spans.count >= 1 - - selector: span[tracetest.span.type="rpc" name="oteldemo.CartService/EmptyCart" rpc.system="grpc" rpc.method="EmptyCart" rpc.service="oteldemo.CartService"] - name: "The cart was emptied" + - name: "The cart was emptied" + selector: span[tracetest.span.type="rpc" name="oteldemo.CartService/EmptyCart" rpc.system="grpc" rpc.method="EmptyCart" rpc.service="oteldemo.CartService"] assertions: - attr:rpc.grpc.status_code = 0 - attr:tracetest.selected_spans.count >= 1 + - name: The order was sent to be processed asyncronously + selector: span[tracetest.span.type="messaging" name="orders send" messaging.system="kafka" messaging.destination="orders" messaging.destination_kind="topic" messaging.operation="send"] + assertions: + - attr:messaging.destination = "orders" + - name: The order was sent to accountability + # captures the span emitted by Kafka instrumentation for Go + selector: span[tracetest.span.type="messaging" name="orders receive" messaging.system="kafka" messaging.destination="orders" messaging.destination_kind="topic" messaging.operation="receive"] + assertions: + - attr:name = "orders receive" + - name: The order was sent to fraud detection team + # captures the span emitted by Kafka instrumentation for Kotlin + selector: span[tracetest.span.type="messaging" name="orders process" messaging.system="kafka" messaging.operation="process"] + assertions: + - attr:name = "orders process" diff --git a/test/tracetesting/frontend-service/all.yaml b/test/tracetesting/frontend-service/all.yaml index f3b8635d3b..d7f1960dcc 100644 --- a/test/tracetesting/frontend-service/all.yaml +++ b/test/tracetesting/frontend-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: frontend-all name: 'Frontend Service' diff --git a/test/tracetesting/payment-service/all.yaml b/test/tracetesting/payment-service/all.yaml index d27c985755..e295034dce 100644 --- a/test/tracetesting/payment-service/all.yaml +++ b/test/tracetesting/payment-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: payment-service-all name: 'Payment Service' diff --git a/test/tracetesting/payment-service/amex-credit-card-not-allowed.yaml b/test/tracetesting/payment-service/amex-credit-card-not-allowed.yaml index 0f04a39232..ab3629df30 100644 --- a/test/tracetesting/payment-service/amex-credit-card-not-allowed.yaml +++ b/test/tracetesting/payment-service/amex-credit-card-not-allowed.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PAYMENT_SERVICE_ADDR} + address: ${var:PAYMENT_SERVICE_ADDR} method: oteldemo.PaymentService.Charge request: |- { diff --git a/test/tracetesting/payment-service/expired-credit-card.yaml b/test/tracetesting/payment-service/expired-credit-card.yaml index fbc8272d98..27963f28d7 100644 --- a/test/tracetesting/payment-service/expired-credit-card.yaml +++ b/test/tracetesting/payment-service/expired-credit-card.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PAYMENT_SERVICE_ADDR} + address: ${var:PAYMENT_SERVICE_ADDR} method: oteldemo.PaymentService.Charge request: |- { diff --git a/test/tracetesting/payment-service/invalid-credit-card.yaml b/test/tracetesting/payment-service/invalid-credit-card.yaml index 4bc67fda2a..a6028f66a2 100644 --- a/test/tracetesting/payment-service/invalid-credit-card.yaml +++ b/test/tracetesting/payment-service/invalid-credit-card.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PAYMENT_SERVICE_ADDR} + address: ${var:PAYMENT_SERVICE_ADDR} method: oteldemo.PaymentService.Charge request: |- { diff --git a/test/tracetesting/payment-service/valid-credit-card.yaml b/test/tracetesting/payment-service/valid-credit-card.yaml index 3b38af6fe1..32c1001332 100644 --- a/test/tracetesting/payment-service/valid-credit-card.yaml +++ b/test/tracetesting/payment-service/valid-credit-card.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PAYMENT_SERVICE_ADDR} + address: ${var:PAYMENT_SERVICE_ADDR} method: oteldemo.PaymentService.Charge request: |- { diff --git a/test/tracetesting/product-catalog-service/all.yaml b/test/tracetesting/product-catalog-service/all.yaml index 5d0a5c6ef6..d52c24142a 100644 --- a/test/tracetesting/product-catalog-service/all.yaml +++ b/test/tracetesting/product-catalog-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: product-catalog-service-all name: 'Product Catalog Service' diff --git a/test/tracetesting/product-catalog-service/get.yaml b/test/tracetesting/product-catalog-service/get.yaml index b46679a000..297f1a51b4 100644 --- a/test/tracetesting/product-catalog-service/get.yaml +++ b/test/tracetesting/product-catalog-service/get.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PRODUCT_CATALOG_SERVICE_ADDR} + address: ${var:PRODUCT_CATALOG_SERVICE_ADDR} method: oteldemo.ProductCatalogService.GetProduct request: |- { diff --git a/test/tracetesting/product-catalog-service/list.yaml b/test/tracetesting/product-catalog-service/list.yaml index 0ad5d56cfa..1b124d2dfc 100644 --- a/test/tracetesting/product-catalog-service/list.yaml +++ b/test/tracetesting/product-catalog-service/list.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PRODUCT_CATALOG_SERVICE_ADDR} + address: ${var:PRODUCT_CATALOG_SERVICE_ADDR} method: oteldemo.ProductCatalogService.ListProducts request: "" specs: diff --git a/test/tracetesting/product-catalog-service/search.yaml b/test/tracetesting/product-catalog-service/search.yaml index 2c3f1e3e9d..50d925375c 100644 --- a/test/tracetesting/product-catalog-service/search.yaml +++ b/test/tracetesting/product-catalog-service/search.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:PRODUCT_CATALOG_SERVICE_ADDR} + address: ${var:PRODUCT_CATALOG_SERVICE_ADDR} method: oteldemo.ProductCatalogService.SearchProducts request: |- { diff --git a/test/tracetesting/recommendation-service/all.yaml b/test/tracetesting/recommendation-service/all.yaml index b739a2e917..d1effe4317 100644 --- a/test/tracetesting/recommendation-service/all.yaml +++ b/test/tracetesting/recommendation-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: recommendation-service-all name: 'Recommendation Service' diff --git a/test/tracetesting/recommendation-service/list.yaml b/test/tracetesting/recommendation-service/list.yaml index e6d5539696..2478bd6dc0 100644 --- a/test/tracetesting/recommendation-service/list.yaml +++ b/test/tracetesting/recommendation-service/list.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:RECOMMENDATION_SERVICE_ADDR} + address: ${var:RECOMMENDATION_SERVICE_ADDR} method: oteldemo.RecommendationService.ListRecommendations request: |- { diff --git a/test/tracetesting/run.bash b/test/tracetesting/run.bash index 02c0100223..7c2b4a0314 100755 --- a/test/tracetesting/run.bash +++ b/test/tracetesting/run.bash @@ -16,11 +16,11 @@ check_if_tracetest_is_installed() { } create_env_file() { - cat << EOF > tracetesting-env.yaml -type: Environment + cat << EOF > tracetesting-vars.yaml +type: VariableSet spec: - id: tracetesting-env - name: tracetesting-env + id: tracetesting-vars + name: tracetesting-vars values: - key: AD_SERVICE_ADDR value: $AD_SERVICE_ADDR @@ -42,14 +42,16 @@ spec: value: $RECOMMENDATION_SERVICE_ADDR - key: SHIPPING_SERVICE_ADDR value: $SHIPPING_SERVICE_ADDR + - key: KAFKA_SERVICE_ADDR + value: $KAFKA_SERVICE_ADDR EOF } run_tracetest() { service_name=$1 - transaction_file=./$service_name/all.yaml + testsuite_file=./$service_name/all.yaml - tracetest --config ./cli-config.yml run transaction --file $transaction_file --environment ./tracetesting-env.yaml + tracetest --config ./cli-config.yml run testsuite --file $testsuite_file --vars ./tracetesting-vars.yaml return $? } diff --git a/test/tracetesting/shipping-service/all.yaml b/test/tracetesting/shipping-service/all.yaml index 88cac40962..e25a2fca0b 100644 --- a/test/tracetesting/shipping-service/all.yaml +++ b/test/tracetesting/shipping-service/all.yaml @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -type: Transaction +type: TestSuite spec: id: shipping-service-all name: 'Shipping Service' diff --git a/test/tracetesting/shipping-service/empty-quote.yaml b/test/tracetesting/shipping-service/empty-quote.yaml index df90da835f..6c85ee1fcf 100644 --- a/test/tracetesting/shipping-service/empty-quote.yaml +++ b/test/tracetesting/shipping-service/empty-quote.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:SHIPPING_SERVICE_ADDR} + address: ${var:SHIPPING_SERVICE_ADDR} method: oteldemo.ShippingService.GetQuote request: |- { diff --git a/test/tracetesting/shipping-service/order.yaml b/test/tracetesting/shipping-service/order.yaml index 27aaa37b8f..1544fb9d2e 100644 --- a/test/tracetesting/shipping-service/order.yaml +++ b/test/tracetesting/shipping-service/order.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:SHIPPING_SERVICE_ADDR} + address: ${var:SHIPPING_SERVICE_ADDR} method: oteldemo.ShippingService.ShipOrder request: |- { diff --git a/test/tracetesting/shipping-service/quote.yaml b/test/tracetesting/shipping-service/quote.yaml index 2cfd48bd7f..945609ea81 100644 --- a/test/tracetesting/shipping-service/quote.yaml +++ b/test/tracetesting/shipping-service/quote.yaml @@ -10,7 +10,7 @@ spec: type: grpc grpc: protobufFile: ../../../pb/demo.proto - address: ${env:SHIPPING_SERVICE_ADDR} + address: ${var:SHIPPING_SERVICE_ADDR} method: oteldemo.ShippingService.GetQuote request: |- {