From d65b42d1c31b4bc279df7a87479763076b6cb79e Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Sat, 19 Aug 2023 16:37:03 -0300 Subject: [PATCH 1/4] Updating transactions and variablesets --- test/tracetesting/ad-service/all.yaml | 2 +- test/tracetesting/ad-service/get.yaml | 2 +- test/tracetesting/cart-service/add-item-to-cart.yaml | 2 +- test/tracetesting/cart-service/all.yaml | 2 +- .../cart-service/check-if-cart-is-empty.yaml | 2 +- .../cart-service/check-if-cart-is-populated.yaml | 2 +- test/tracetesting/cart-service/empty-cart.yaml | 2 +- test/tracetesting/checkout-service/all.yaml | 2 +- test/tracetesting/checkout-service/place-order.yaml | 2 +- test/tracetesting/currency-service/all.yaml | 2 +- test/tracetesting/currency-service/convert.yaml | 2 +- test/tracetesting/currency-service/supported.yaml | 2 +- test/tracetesting/email-service/all.yaml | 2 +- test/tracetesting/email-service/confirmation.yaml | 2 +- test/tracetesting/frontend-service/01-see-ads.yaml | 2 +- .../02-get-product-recommendation.yaml | 2 +- .../frontend-service/03-browse-product.yaml | 2 +- .../frontend-service/04-add-product-to-cart.yaml | 2 +- test/tracetesting/frontend-service/05-view-cart.yaml | 2 +- .../frontend-service/06-checking-out-cart.yaml | 2 +- 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 +- test/tracetesting/product-catalog-service/all.yaml | 2 +- test/tracetesting/product-catalog-service/get.yaml | 2 +- test/tracetesting/product-catalog-service/list.yaml | 2 +- .../tracetesting/product-catalog-service/search.yaml | 2 +- test/tracetesting/recommendation-service/all.yaml | 2 +- test/tracetesting/recommendation-service/list.yaml | 2 +- test/tracetesting/run.bash | 12 ++++++------ test/tracetesting/shipping-service/all.yaml | 2 +- test/tracetesting/shipping-service/empty-quote.yaml | 2 +- test/tracetesting/shipping-service/order.yaml | 2 +- test/tracetesting/shipping-service/quote.yaml | 2 +- 37 files changed, 42 insertions(+), 42 deletions(-) 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..00b45cb80f 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: |- { 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..792af7b23c 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 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..b0d44cdaf1 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 @@ -47,9 +47,9 @@ 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: |- { From ff1e6cdcb6ac6392746987ee2d4f725a89688dec Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Sat, 19 Aug 2023 22:41:27 -0300 Subject: [PATCH 2/4] Adding kafka examples into OTel demo --- docker-compose.yml | 5 ++ test/tracetesting/accounting-service/all.yaml | 10 ++++ .../accounting-service/receive-order.yaml | 52 +++++++++++++++++++ .../checkout-service/place-order.yaml | 4 ++ .../fraud-detection-service/all.yaml | 10 ++++ .../process-order.yaml | 52 +++++++++++++++++++ .../06-checking-out-cart.yaml | 30 ++++++++--- test/tracetesting/run.bash | 4 +- 8 files changed, 158 insertions(+), 9 deletions(-) create mode 100644 test/tracetesting/accounting-service/all.yaml create mode 100644 test/tracetesting/accounting-service/receive-order.yaml create mode 100644 test/tracetesting/fraud-detection-service/all.yaml create mode 100644 test/tracetesting/fraud-detection-service/process-order.yaml diff --git a/docker-compose.yml b/docker-compose.yml index 512ef41c9e..4cab9461ff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -762,6 +762,7 @@ services: - PRODUCT_CATALOG_SERVICE_ADDR - RECOMMENDATION_SERVICE_ADDR - SHIPPING_SERVICE_ADDR + - KAFKA_SERVICE_ADDR extra_hosts: - "host.docker.internal:host-gateway" depends_on: @@ -790,6 +791,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/accounting-service/all.yaml b/test/tracetesting/accounting-service/all.yaml new file mode 100644 index 0000000000..9fda3f5971 --- /dev/null +++ b/test/tracetesting/accounting-service/all.yaml @@ -0,0 +1,10 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: TestSuite +spec: + id: accounting-service-all + name: 'Accounting Service' + description: Run all Accounting Service tests enabled in sequence + steps: + - ./receive-order.yaml diff --git a/test/tracetesting/accounting-service/receive-order.yaml b/test/tracetesting/accounting-service/receive-order.yaml new file mode 100644 index 0000000000..e57a09afa7 --- /dev/null +++ b/test/tracetesting/accounting-service/receive-order.yaml @@ -0,0 +1,52 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: Test +spec: + id: accounting-receive-order + name: 'Accounting: receive order' + description: Receive an order from Orders stream + trigger: + type: kafka + kafka: + brokerUrls: + - ${var:KAFKA_SERVICE_ADDR} + topic: messaging + messageKey: "order-505" + messageValue: | + { + "order_id": "505", + "shipping_tracking_id": "dead-beef", + "shipping_cost": { + "currency_code": "USD", + "units": 17, + "nanos": 980000000 + }, + "shipping_address": { + "street_address_1": "1600 Amphitheatre Parkway", + "city": "Mountain View", + "state": "California", + "country": "United States", + "zip_code": "94043" + }, + "items": [ + { + "item": { + "product_id": "1YMWWN1N4O", + "quantity": 5 + }, + "cost": { + "currency_code": "USD", + "units": 100, + "nanos": 0 + } + } + ] + } + + specs: + - 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" diff --git a/test/tracetesting/checkout-service/place-order.yaml b/test/tracetesting/checkout-service/place-order.yaml index 00b45cb80f..800ef158d6 100644 --- a/test/tracetesting/checkout-service/place-order.yaml +++ b/test/tracetesting/checkout-service/place-order.yaml @@ -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/fraud-detection-service/all.yaml b/test/tracetesting/fraud-detection-service/all.yaml new file mode 100644 index 0000000000..1ea076fa3e --- /dev/null +++ b/test/tracetesting/fraud-detection-service/all.yaml @@ -0,0 +1,10 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: TestSuite +spec: + id: frauddetection-service-all + name: 'Fraud Detection Service' + description: Run all Fraud Detection Service tests enabled in sequence + steps: + - ./process-order.yaml diff --git a/test/tracetesting/fraud-detection-service/process-order.yaml b/test/tracetesting/fraud-detection-service/process-order.yaml new file mode 100644 index 0000000000..15b8303a83 --- /dev/null +++ b/test/tracetesting/fraud-detection-service/process-order.yaml @@ -0,0 +1,52 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +type: Test +spec: + id: frauddetection-order + name: 'Fraud Detection: process order' + description: Process an order from Orders stream + trigger: + type: kafka + kafka: + brokerUrls: + - ${var:KAFKA_SERVICE_ADDR} + topic: messaging + messageKey: "order-600" + messageValue: | + { + "order_id": "600", + "shipping_tracking_id": "dead-beef", + "shipping_cost": { + "currency_code": "USD", + "units": 17, + "nanos": 980000000 + }, + "shipping_address": { + "street_address_1": "1600 Amphitheatre Parkway", + "city": "Mountain View", + "state": "California", + "country": "United States", + "zip_code": "94043" + }, + "items": [ + { + "item": { + "product_id": "1YMWWN1N4O", + "quantity": 5 + }, + "cost": { + "currency_code": "USD", + "units": 100, + "nanos": 0 + } + } + ] + } + + specs: + - 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/06-checking-out-cart.yaml b/test/tracetesting/frontend-service/06-checking-out-cart.yaml index 792af7b23c..c169cef441 100644 --- a/test/tracetesting/frontend-service/06-checking-out-cart.yaml +++ b/test/tracetesting/frontend-service/06-checking-out-cart.yaml @@ -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" \ No newline at end of file diff --git a/test/tracetesting/run.bash b/test/tracetesting/run.bash index b0d44cdaf1..f0d8e75d90 100755 --- a/test/tracetesting/run.bash +++ b/test/tracetesting/run.bash @@ -42,6 +42,8 @@ spec: value: $RECOMMENDATION_SERVICE_ADDR - key: SHIPPING_SERVICE_ADDR value: $SHIPPING_SERVICE_ADDR + - key: KAFKA_SERVICE_ADDR + value: $KAFKA_SERVICE_ADDR EOF } @@ -53,7 +55,7 @@ run_tracetest() { return $? } -ALL_SERVICES=("ad-service" "cart-service" "currency-service" "checkout-service" "frontend-service" "email-service" "payment-service" "product-catalog-service" "recommendation-service" "shipping-service") +ALL_SERVICES=("accounting-service" "ad-service" "cart-service" "currency-service" "checkout-service" "fraud-detection-service" "frontend-service" "email-service" "payment-service" "product-catalog-service" "recommendation-service" "shipping-service") CHOSEN_SERVICES=() while [[ $# -gt 0 ]]; do From 3dbb5db4a4e4ca4eba5bbde6351d889b8c94e8c9 Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Mon, 21 Aug 2023 09:07:17 -0300 Subject: [PATCH 3/4] Update tests --- test/tracetesting/accounting-service/all.yaml | 10 ---- .../accounting-service/receive-order.yaml | 52 ------------------- .../fraud-detection-service/all.yaml | 10 ---- .../process-order.yaml | 52 ------------------- test/tracetesting/run.bash | 2 +- 5 files changed, 1 insertion(+), 125 deletions(-) delete mode 100644 test/tracetesting/accounting-service/all.yaml delete mode 100644 test/tracetesting/accounting-service/receive-order.yaml delete mode 100644 test/tracetesting/fraud-detection-service/all.yaml delete mode 100644 test/tracetesting/fraud-detection-service/process-order.yaml diff --git a/test/tracetesting/accounting-service/all.yaml b/test/tracetesting/accounting-service/all.yaml deleted file mode 100644 index 9fda3f5971..0000000000 --- a/test/tracetesting/accounting-service/all.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -type: TestSuite -spec: - id: accounting-service-all - name: 'Accounting Service' - description: Run all Accounting Service tests enabled in sequence - steps: - - ./receive-order.yaml diff --git a/test/tracetesting/accounting-service/receive-order.yaml b/test/tracetesting/accounting-service/receive-order.yaml deleted file mode 100644 index e57a09afa7..0000000000 --- a/test/tracetesting/accounting-service/receive-order.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -type: Test -spec: - id: accounting-receive-order - name: 'Accounting: receive order' - description: Receive an order from Orders stream - trigger: - type: kafka - kafka: - brokerUrls: - - ${var:KAFKA_SERVICE_ADDR} - topic: messaging - messageKey: "order-505" - messageValue: | - { - "order_id": "505", - "shipping_tracking_id": "dead-beef", - "shipping_cost": { - "currency_code": "USD", - "units": 17, - "nanos": 980000000 - }, - "shipping_address": { - "street_address_1": "1600 Amphitheatre Parkway", - "city": "Mountain View", - "state": "California", - "country": "United States", - "zip_code": "94043" - }, - "items": [ - { - "item": { - "product_id": "1YMWWN1N4O", - "quantity": 5 - }, - "cost": { - "currency_code": "USD", - "units": 100, - "nanos": 0 - } - } - ] - } - - specs: - - 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" diff --git a/test/tracetesting/fraud-detection-service/all.yaml b/test/tracetesting/fraud-detection-service/all.yaml deleted file mode 100644 index 1ea076fa3e..0000000000 --- a/test/tracetesting/fraud-detection-service/all.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -type: TestSuite -spec: - id: frauddetection-service-all - name: 'Fraud Detection Service' - description: Run all Fraud Detection Service tests enabled in sequence - steps: - - ./process-order.yaml diff --git a/test/tracetesting/fraud-detection-service/process-order.yaml b/test/tracetesting/fraud-detection-service/process-order.yaml deleted file mode 100644 index 15b8303a83..0000000000 --- a/test/tracetesting/fraud-detection-service/process-order.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -type: Test -spec: - id: frauddetection-order - name: 'Fraud Detection: process order' - description: Process an order from Orders stream - trigger: - type: kafka - kafka: - brokerUrls: - - ${var:KAFKA_SERVICE_ADDR} - topic: messaging - messageKey: "order-600" - messageValue: | - { - "order_id": "600", - "shipping_tracking_id": "dead-beef", - "shipping_cost": { - "currency_code": "USD", - "units": 17, - "nanos": 980000000 - }, - "shipping_address": { - "street_address_1": "1600 Amphitheatre Parkway", - "city": "Mountain View", - "state": "California", - "country": "United States", - "zip_code": "94043" - }, - "items": [ - { - "item": { - "product_id": "1YMWWN1N4O", - "quantity": 5 - }, - "cost": { - "currency_code": "USD", - "units": 100, - "nanos": 0 - } - } - ] - } - - specs: - - 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/run.bash b/test/tracetesting/run.bash index f0d8e75d90..7c2b4a0314 100755 --- a/test/tracetesting/run.bash +++ b/test/tracetesting/run.bash @@ -55,7 +55,7 @@ run_tracetest() { return $? } -ALL_SERVICES=("accounting-service" "ad-service" "cart-service" "currency-service" "checkout-service" "fraud-detection-service" "frontend-service" "email-service" "payment-service" "product-catalog-service" "recommendation-service" "shipping-service") +ALL_SERVICES=("ad-service" "cart-service" "currency-service" "checkout-service" "frontend-service" "email-service" "payment-service" "product-catalog-service" "recommendation-service" "shipping-service") CHOSEN_SERVICES=() while [[ $# -gt 0 ]]; do From ae153bca4e1f5503058c59182d7146b4a3069a1a Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Mon, 21 Aug 2023 09:29:11 -0300 Subject: [PATCH 4/4] Fixing lint and adding changelog --- CHANGELOG.md | 2 ++ test/tracetesting/frontend-service/06-checking-out-cart.yaml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8eebd4df2..75c47b3bfa 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/test/tracetesting/frontend-service/06-checking-out-cart.yaml b/test/tracetesting/frontend-service/06-checking-out-cart.yaml index c169cef441..db54d7ab41 100644 --- a/test/tracetesting/frontend-service/06-checking-out-cart.yaml +++ b/test/tracetesting/frontend-service/06-checking-out-cart.yaml @@ -69,6 +69,6 @@ spec: - 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"] + selector: span[tracetest.span.type="messaging" name="orders process" messaging.system="kafka" messaging.operation="process"] assertions: - - attr:name = "orders process" \ No newline at end of file + - attr:name = "orders process"