diff --git a/docker-compose.yml b/docker-compose.yml index a54aacf0bc..8ee658cc78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -725,10 +725,11 @@ services: extra_hosts: - "host.docker.internal:host-gateway" depends_on: - - tracetest-server + tracetest-server: + condition: service_healthy tracetest-server: - image: kubeshop/tracetest:latest + image: kubeshop/tracetest:v0.11.10-rc.2 platform: linux/amd64 container_name: tracetest-server profiles: diff --git a/test/tracetesting/Dockerfile b/test/tracetesting/Dockerfile index 25be5eeec8..e846f09aba 100644 --- a/test/tracetesting/Dockerfile +++ b/test/tracetesting/Dockerfile @@ -7,8 +7,16 @@ FROM alpine WORKDIR /app RUN apk --update add bash jq curl -RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash +#RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -COPY ./test/tracetesting ./ +RUN curl -L https://github.com/kubeshop/tracetest/releases/download/v0.11.10-rc.2/tracetest_0.11.10-rc.2_linux_i386.tar.gz --output /tmp/cli.tar.gz +RUN tar -xf /tmp/cli.tar.gz -C /tmp +RUN mv /tmp/tracetest /usr/local/bin/tracetest +RUN rm -f /tmp/cli.tar.gz -CMD ["/bin/sh", "/app/run.bash"] +COPY ./test/tracetesting ./test/tracetesting +COPY ./pb ./pb + +WORKDIR /app/test/tracetesting + +CMD ["/bin/sh", "/app/test/tracetesting/run.bash"] diff --git a/test/tracetesting/run.bash b/test/tracetesting/run.bash index c132e4ea82..2e035bdcfb 100755 --- a/test/tracetesting/run.bash +++ b/test/tracetesting/run.bash @@ -18,7 +18,7 @@ check_if_tracetest_is_installed() { run_tracetest() { test_file=$1 - tracetest -c ./cli-config.yml test run -d $test_file -w + TRACETEST_DEV=true tracetest -c ./cli-config.yml test run -d $test_file -w return $? } diff --git a/test/tracetesting/tech-based-tests/ad-service/get.yaml b/test/tracetesting/tech-based-tests/ad-service/get.yaml index f626958099..0553a91a9b 100644 --- a/test/tracetesting/tech-based-tests/ad-service/get.yaml +++ b/test/tracetesting/tech-based-tests/ad-service/get.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: adservice:9555 method: oteldemo.AdService.GetAds request: |- diff --git a/test/tracetesting/tech-based-tests/cart-service/add-item-to-cart.yaml b/test/tracetesting/tech-based-tests/cart-service/add-item-to-cart.yaml index c0f5f42a1f..768112e305 100644 --- a/test/tracetesting/tech-based-tests/cart-service/add-item-to-cart.yaml +++ b/test/tracetesting/tech-based-tests/cart-service/add-item-to-cart.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: cartservice:7070 method: oteldemo.CartService.AddItem request: |- diff --git a/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-empty.yaml b/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-empty.yaml index cd97ee52d5..a8871f7699 100644 --- a/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-empty.yaml +++ b/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-empty.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: cartservice:7070 method: oteldemo.CartService.GetCart request: |- diff --git a/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-populated.yaml b/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-populated.yaml index 5e675862ee..cc4f076ae4 100644 --- a/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-populated.yaml +++ b/test/tracetesting/tech-based-tests/cart-service/check-if-cart-is-populated.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: cartservice:7070 method: oteldemo.CartService.GetCart request: |- diff --git a/test/tracetesting/tech-based-tests/cart-service/empty-cart.yaml b/test/tracetesting/tech-based-tests/cart-service/empty-cart.yaml index 9986462bd4..378d083f09 100644 --- a/test/tracetesting/tech-based-tests/cart-service/empty-cart.yaml +++ b/test/tracetesting/tech-based-tests/cart-service/empty-cart.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: cartservice:7070 method: oteldemo.CartService.EmptyCart request: |- @@ -337,9 +18,9 @@ spec: } specs: - name: It emptied the shopping cart with success - selector: span[tracetest.span.type="rpc" name="oteldemo.CartService/EmptyCart" rpc.system="grpc" rpc.method="EmptyCart" rpc.service="oteldemo.CartService"] + selector: span[tracetest.span.type="http" name="oteldemo.CartService/EmptyCart"] assertions: - - attr:rpc.grpc.status_code = 0 + - attr:http.status_code = 200 - name: It sent cleaning message to the database selector: span[tracetest.span.type="database" name="EXPIRE" db.system="redis" db.redis.database_index="0"] diff --git a/test/tracetesting/tech-based-tests/checkout-service/place-order.yaml b/test/tracetesting/tech-based-tests/checkout-service/place-order.yaml index 758787f0d5..8f12f2581b 100644 --- a/test/tracetesting/tech-based-tests/checkout-service/place-order.yaml +++ b/test/tracetesting/tech-based-tests/checkout-service/place-order.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: checkoutservice:5050 method: oteldemo.CheckoutService.PlaceOrder request: |- diff --git a/test/tracetesting/tech-based-tests/currency-service/convert.yaml b/test/tracetesting/tech-based-tests/currency-service/convert.yaml index a53159c09a..316b14d4f7 100644 --- a/test/tracetesting/tech-based-tests/currency-service/convert.yaml +++ b/test/tracetesting/tech-based-tests/currency-service/convert.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: currencyservice:7001 method: oteldemo.CurrencyService.Convert request: |- diff --git a/test/tracetesting/tech-based-tests/currency-service/supported.yaml b/test/tracetesting/tech-based-tests/currency-service/supported.yaml index d4ead36a3c..3ccb4b8695 100644 --- a/test/tracetesting/tech-based-tests/currency-service/supported.yaml +++ b/test/tracetesting/tech-based-tests/currency-service/supported.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: currencyservice:7001 method: oteldemo.CurrencyService.GetSupportedCurrencies specs: diff --git a/test/tracetesting/tech-based-tests/payment-service/amex-credit-card-not-allowed.yaml b/test/tracetesting/tech-based-tests/payment-service/amex-credit-card-not-allowed.yaml index 3c56cb91af..f85e918b11 100644 --- a/test/tracetesting/tech-based-tests/payment-service/amex-credit-card-not-allowed.yaml +++ b/test/tracetesting/tech-based-tests/payment-service/amex-credit-card-not-allowed.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: paymentservice:50051 method: oteldemo.PaymentService.Charge request: |- diff --git a/test/tracetesting/tech-based-tests/payment-service/expired-credit-card.yaml b/test/tracetesting/tech-based-tests/payment-service/expired-credit-card.yaml index fbd3272dc7..28c910a31a 100644 --- a/test/tracetesting/tech-based-tests/payment-service/expired-credit-card.yaml +++ b/test/tracetesting/tech-based-tests/payment-service/expired-credit-card.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: paymentservice:50051 method: oteldemo.PaymentService.Charge request: |- @@ -339,7 +20,7 @@ spec: "nanos": 130000000 }, "creditCard": { - "creditCardNumber": "0000-0000-0000-0000", + "creditCardNumber": "4432-8015-6152-0454", "creditCardCvv": 672, "creditCardExpirationYear": 2021, "creditCardExpirationMonth": 1 diff --git a/test/tracetesting/tech-based-tests/payment-service/invalid-credit-card.yaml b/test/tracetesting/tech-based-tests/payment-service/invalid-credit-card.yaml index d776b52ab9..df1b2e2b06 100644 --- a/test/tracetesting/tech-based-tests/payment-service/invalid-credit-card.yaml +++ b/test/tracetesting/tech-based-tests/payment-service/invalid-credit-card.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: paymentservice:50051 method: oteldemo.PaymentService.Charge request: |- diff --git a/test/tracetesting/tech-based-tests/payment-service/valid-credit-card.yaml b/test/tracetesting/tech-based-tests/payment-service/valid-credit-card.yaml index 95874d0d7a..4ef9e7f1b6 100644 --- a/test/tracetesting/tech-based-tests/payment-service/valid-credit-card.yaml +++ b/test/tracetesting/tech-based-tests/payment-service/valid-credit-card.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: paymentservice:50051 method: oteldemo.PaymentService.Charge request: |- diff --git a/test/tracetesting/tech-based-tests/product-catalog-service/get.yaml b/test/tracetesting/tech-based-tests/product-catalog-service/get.yaml index 20c9b7ad68..37df33a156 100644 --- a/test/tracetesting/tech-based-tests/product-catalog-service/get.yaml +++ b/test/tracetesting/tech-based-tests/product-catalog-service/get.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: productcatalogservice:3550 method: oteldemo.ProductCatalogService.GetProduct request: |- diff --git a/test/tracetesting/tech-based-tests/product-catalog-service/list.yaml b/test/tracetesting/tech-based-tests/product-catalog-service/list.yaml index f863121e04..072880348d 100644 --- a/test/tracetesting/tech-based-tests/product-catalog-service/list.yaml +++ b/test/tracetesting/tech-based-tests/product-catalog-service/list.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: productcatalogservice:3550 method: oteldemo.ProductCatalogService.ListProducts request: "" diff --git a/test/tracetesting/tech-based-tests/product-catalog-service/search.yaml b/test/tracetesting/tech-based-tests/product-catalog-service/search.yaml index 3f88ed3354..4c2e6d5ffe 100644 --- a/test/tracetesting/tech-based-tests/product-catalog-service/search.yaml +++ b/test/tracetesting/tech-based-tests/product-catalog-service/search.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: productcatalogservice:3550 method: oteldemo.ProductCatalogService.SearchProducts request: |- diff --git a/test/tracetesting/tech-based-tests/recommendation-service/list.yaml b/test/tracetesting/tech-based-tests/recommendation-service/list.yaml index d9a51af559..664f6f0f42 100644 --- a/test/tracetesting/tech-based-tests/recommendation-service/list.yaml +++ b/test/tracetesting/tech-based-tests/recommendation-service/list.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: recommendationservice:9001 method: oteldemo.RecommendationService.ListRecommendations request: |- diff --git a/test/tracetesting/tech-based-tests/shipping-service/empty-quote.yaml b/test/tracetesting/tech-based-tests/shipping-service/empty-quote.yaml index ff4bf854b0..28618b539f 100644 --- a/test/tracetesting/tech-based-tests/shipping-service/empty-quote.yaml +++ b/test/tracetesting/tech-based-tests/shipping-service/empty-quote.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: shippingservice:50050 method: oteldemo.ShippingService.GetQuote request: |- diff --git a/test/tracetesting/tech-based-tests/shipping-service/order.yaml b/test/tracetesting/tech-based-tests/shipping-service/order.yaml index 41b605ee67..65fca03e08 100644 --- a/test/tracetesting/tech-based-tests/shipping-service/order.yaml +++ b/test/tracetesting/tech-based-tests/shipping-service/order.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: shippingservice:50050 method: oteldemo.ShippingService.ShipOrder request: |- diff --git a/test/tracetesting/tech-based-tests/shipping-service/quote.yaml b/test/tracetesting/tech-based-tests/shipping-service/quote.yaml index 6fb4347246..c9075dc2f1 100644 --- a/test/tracetesting/tech-based-tests/shipping-service/quote.yaml +++ b/test/tracetesting/tech-based-tests/shipping-service/quote.yaml @@ -9,326 +9,7 @@ spec: trigger: type: grpc grpc: - protobufFile: | - // Copyright 2020 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - syntax = "proto3"; - - import "google/protobuf/timestamp.proto"; - - package oteldemo; - - option go_package = "genproto/oteldemo"; - - // -----------------Cart service----------------- - - service CartService { - rpc AddItem(AddItemRequest) returns (Empty) {} - rpc GetCart(GetCartRequest) returns (Cart) {} - rpc EmptyCart(EmptyCartRequest) returns (Empty) {} - } - - message CartItem { - string product_id = 1; - int32 quantity = 2; - } - - message AddItemRequest { - string user_id = 1; - CartItem item = 2; - } - - message EmptyCartRequest { - string user_id = 1; - } - - message GetCartRequest { - string user_id = 1; - } - - message Cart { - string user_id = 1; - repeated CartItem items = 2; - } - - message Empty {} - - // ---------------Recommendation service---------- - - service RecommendationService { - rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse){} - } - - message ListRecommendationsRequest { - string user_id = 1; - repeated string product_ids = 2; - } - - message ListRecommendationsResponse { - repeated string product_ids = 1; - } - - // ---------------Product Catalog---------------- - - service ProductCatalogService { - rpc ListProducts(Empty) returns (ListProductsResponse) {} - rpc GetProduct(GetProductRequest) returns (Product) {} - rpc SearchProducts(SearchProductsRequest) returns (SearchProductsResponse) {} - } - - message Product { - string id = 1; - string name = 2; - string description = 3; - string picture = 4; - Money price_usd = 5; - - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - repeated string categories = 6; - } - - message ListProductsResponse { - repeated Product products = 1; - } - - message GetProductRequest { - string id = 1; - } - - message SearchProductsRequest { - string query = 1; - } - - message SearchProductsResponse { - repeated Product results = 1; - } - - // ---------------Shipping Service---------- - - service ShippingService { - rpc GetQuote(GetQuoteRequest) returns (GetQuoteResponse) {} - rpc ShipOrder(ShipOrderRequest) returns (ShipOrderResponse) {} - } - - message GetQuoteRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message GetQuoteResponse { - Money cost_usd = 1; - } - - message ShipOrderRequest { - Address address = 1; - repeated CartItem items = 2; - } - - message ShipOrderResponse { - string tracking_id = 1; - } - - message Address { - string street_address = 1; - string city = 2; - string state = 3; - string country = 4; - string zip_code = 5; - } - - // -----------------Currency service----------------- - - service CurrencyService { - rpc GetSupportedCurrencies(Empty) returns (GetSupportedCurrenciesResponse) {} - rpc Convert(CurrencyConversionRequest) returns (Money) {} - } - - // Represents an amount of money with its currency type. - message Money { - // The 3-letter currency code defined in ISO 4217. - string currency_code = 1; - - // The whole units of the amount. - // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - int64 units = 2; - - // Number of nano (10^-9) units of the amount. - // The value must be between -999,999,999 and +999,999,999 inclusive. - // If `units` is positive, `nanos` must be positive or zero. - // If `units` is zero, `nanos` can be positive, zero, or negative. - // If `units` is negative, `nanos` must be negative or zero. - // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - int32 nanos = 3; - } - - message GetSupportedCurrenciesResponse { - // The 3-letter currency code defined in ISO 4217. - repeated string currency_codes = 1; - } - - message CurrencyConversionRequest { - Money from = 1; - - // The 3-letter currency code defined in ISO 4217. - string to_code = 2; - } - - // -------------Payment service----------------- - - service PaymentService { - rpc Charge(ChargeRequest) returns (ChargeResponse) {} - } - - message CreditCardInfo { - string credit_card_number = 1; - int32 credit_card_cvv = 2; - int32 credit_card_expiration_year = 3; - int32 credit_card_expiration_month = 4; - } - - message ChargeRequest { - Money amount = 1; - CreditCardInfo credit_card = 2; - } - - message ChargeResponse { - string transaction_id = 1; - } - - // -------------Email service----------------- - - service EmailService { - rpc SendOrderConfirmation(SendOrderConfirmationRequest) returns (Empty) {} - } - - message OrderItem { - CartItem item = 1; - Money cost = 2; - } - - message OrderResult { - string order_id = 1; - string shipping_tracking_id = 2; - Money shipping_cost = 3; - Address shipping_address = 4; - repeated OrderItem items = 5; - } - - message SendOrderConfirmationRequest { - string email = 1; - OrderResult order = 2; - } - - - // -------------Checkout service----------------- - - service CheckoutService { - rpc PlaceOrder(PlaceOrderRequest) returns (PlaceOrderResponse) {} - } - - message PlaceOrderRequest { - string user_id = 1; - string user_currency = 2; - - Address address = 3; - string email = 5; - CreditCardInfo credit_card = 6; - } - - message PlaceOrderResponse { - OrderResult order = 1; - } - - // ------------Ad service------------------ - - service AdService { - rpc GetAds(AdRequest) returns (AdResponse) {} - } - - message AdRequest { - // List of important key words from the current page describing the context. - repeated string context_keys = 1; - } - - message AdResponse { - repeated Ad ads = 1; - } - - message Ad { - // url to redirect to when an ad is clicked. - string redirect_url = 1; - - // short advertisement text to display. - string text = 2; - } - - // ------------Feature flag service------------------ - - service FeatureFlagService { - rpc GetFlag(GetFlagRequest) returns (GetFlagResponse) {} - rpc CreateFlag(CreateFlagRequest) returns (CreateFlagResponse) {} - rpc UpdateFlag(UpdateFlagRequest) returns (UpdateFlagResponse) {} - rpc ListFlags(ListFlagsRequest) returns (ListFlagsResponse) {} - rpc DeleteFlag(DeleteFlagRequest) returns (DeleteFlagResponse) {} - } - - message Flag { - string name = 1; - string description = 2; - bool enabled = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - } - - message GetFlagRequest { - string name = 1; - } - - message GetFlagResponse { - Flag flag = 1; - } - - message CreateFlagRequest { - string name = 1; - string description = 2; - bool enabled = 3; - } - - message CreateFlagResponse { - Flag flag = 1; - } - - message UpdateFlagRequest { - string name = 1; - bool enabled = 2; - } - - message UpdateFlagResponse {} - - message ListFlagsRequest {} - - message ListFlagsResponse { - repeated Flag flag = 1; - } - - message DeleteFlagRequest { - string name = 1; - } - - message DeleteFlagResponse {} + protobufFile: ../../../../pb/demo.proto address: shippingservice:50050 method: oteldemo.ShippingService.GetQuote request: |-