Skip to content

Commit 2d16971

Browse files
authored
[chore] fix trace tests (#1377)
* add tracetesting vars Signed-off-by: Pierre Tessier <[email protected]> * fix tests targets Signed-off-by: Pierre Tessier <[email protected]> * update for semconv Signed-off-by: Pierre Tessier <[email protected]> * update actions/checkout version Signed-off-by: Pierre Tessier <[email protected]> * update trace based tests Signed-off-by: Pierre Tessier <[email protected]> --------- Signed-off-by: Pierre Tessier <[email protected]>
1 parent 1b2214e commit 2d16971

12 files changed

+22
-16
lines changed

.github/workflows/run-integration-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: "Run CI"
3030
steps:
3131
- name: check out code
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333
- name: install docker
3434
run: |
3535
curl -fsSL https://get.docker.com -o get-docker.sh

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ composer.lock
3838
src/frontend/cypress/videos
3939
src/frontend/cypress/screenshots
4040
src/shippingservice/target/
41+
test/tracetesting/tracetesting-vars.yaml
4142

4243
# Ignore copied/generated protobuf files
4344
/src/cartservice/src/protos/

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ the release.
5252
([#1359](https://github.com/open-telemetry/opentelemetry-demo/pull/1359))
5353
* [productcatalog] allow products to be extended
5454
([#1363](https://github.com/open-telemetry/opentelemetry-demo/pull/1363))
55+
* [tests] update trace based tests for semantic conventions
56+
([#1377](https://github.com/open-telemetry/opentelemetry-demo/pull/1377))
5557

5658
## 1.7.2
5759

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,14 @@ build-env-file:
9595
sed -i '/IMAGE_VERSION=.*/c\IMAGE_VERSION=${RELEASE_VERSION}' .ghcr.env
9696
sed -i '/IMAGE_NAME=.*/c\IMAGE_NAME=${GHCR_REPO}' .ghcr.env
9797

98+
.PHONY: run-tests
9899
run-tests:
99100
docker compose run frontendTests
100-
docker compose run integrationTests
101+
# integrationTests is deprecated in favor of traceBasedTests
102+
# docker compose run integrationTests
101103
docker compose run traceBasedTests
102104

105+
.PHONY: run-tracetesting
103106
run-tracetesting:
104107
docker compose run traceBasedTests ${SERVICES_TO_TEST}
105108

test/tracetesting/cart-service/add-item-to-cart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ spec:
2222
}
2323
specs:
2424
- name: It added an item correctly into the shopping cart
25-
selector: span[name="oteldemo.CartService/AddItem"]
25+
selector: span[name="POST /oteldemo.CartService/AddItem"]
2626
assertions:
27-
- attr:rpc.grpc.status_code = 0
27+
- attr:grpc.status_code = 0
2828
- name: It set the cart item correctly on the database
2929
selector: span[tracetest.span.type="database" name="HMSET" db.system="redis" db.redis.database_index="0"]
3030
assertions:

test/tracetesting/cart-service/check-if-cart-is-empty.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ spec:
1818
}
1919
specs:
2020
- name: It retrieved the cart items correctly
21-
selector: span[name="oteldemo.CartService/GetCart"]
21+
selector: span[name="POST /oteldemo.CartService/GetCart"]
2222
assertions:
23-
- attr:rpc.grpc.status_code = 0
23+
- attr:grpc.status_code = 0
2424
- name: It returned no items
2525
selector: span[tracetest.span.type="general" name="Tracetest trigger"]
2626
assertions:

test/tracetesting/cart-service/check-if-cart-is-populated.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ spec:
1818
}
1919
specs:
2020
- name: It retrieved the cart items correctly
21-
selector: span[name="oteldemo.CartService/GetCart"]
21+
selector: span[name="POST /oteldemo.CartService/GetCart"]
2222
assertions:
23-
- attr:rpc.grpc.status_code = 0
23+
- attr:grpc.status_code = 0
2424
- name: It returned the first item with correct attributes
2525
selector: span[tracetest.span.type="general" name="Tracetest trigger"]
2626
assertions:

test/tracetesting/cart-service/empty-cart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ spec:
1818
}
1919
specs:
2020
- name: It emptied the shopping cart with success
21-
selector: span[name="oteldemo.CartService/EmptyCart"]
21+
selector: span[name="POST /oteldemo.CartService/EmptyCart"]
2222
assertions:
23-
- attr:rpc.grpc.status_code = 0
23+
- attr:grpc.status_code = 0
2424
- name: It sent cleaning message to the database
2525
selector: span[tracetest.span.type="database" name="EXPIRE" db.system="redis" db.redis.database_index="0"]
2626
assertions:

test/tracetesting/currency-service/convert.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
specs:
2525
- name: It converts from USD to CAD
2626
selector: span[tracetest.span.type="rpc" name="CurrencyService/Convert" rpc.system="grpc"
27-
rpc.method="Convert" rpc.service="CurrencyService"]
27+
rpc.method="Convert" rpc.service="oteldemo.CurrencyService"]
2828
assertions:
2929
- attr:app.currency.conversion.from = "USD"
3030
- attr:app.currency.conversion.to = "CAD"

test/tracetesting/currency-service/supported.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
specs:
1616
- name: It has a span called "CurrencyService/GetSupportedCurrencies"
1717
selector: span[tracetest.span.type="rpc" name="CurrencyService/GetSupportedCurrencies"
18-
rpc.system="grpc" rpc.method="GetSupportedCurrencies" rpc.service="CurrencyService"]
18+
rpc.system="grpc" rpc.method="GetSupportedCurrencies" rpc.service="oteldemo.CurrencyService"]
1919
assertions:
2020
- attr:name = "CurrencyService/GetSupportedCurrencies"
2121
- name: It returns the expected currency codes

test/tracetesting/frontend-service/04-add-product-to-cart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ spec:
2828
assertions:
2929
- attr:tracetest.response.status = 200
3030
- name: It added an item correctly into the shopping cart
31-
selector: span[name="oteldemo.CartService/AddItem"]
31+
selector: span[name="POST /oteldemo.CartService/AddItem"]
3232
assertions:
33-
- attr:rpc.grpc.status_code = 0
33+
- attr:grpc.status_code = 0
3434
- attr:app.product.id = "0PUK6V6EV0"
3535
- name: It set the cart item correctly on the database
3636
selector: span[tracetest.span.type="database" name="HMSET" db.system="redis" db.redis.database_index="0"]

test/tracetesting/frontend-service/05-view-cart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ spec:
2020
assertions:
2121
- attr:tracetest.response.status = 200
2222
- name: It retrieved the cart items correctly
23-
selector: span[name="oteldemo.CartService/GetCart"]
23+
selector: span[name="POST /oteldemo.CartService/GetCart"]
2424
assertions:
25-
- attr:rpc.grpc.status_code = 0
25+
- attr:grpc.status_code = 0

0 commit comments

Comments
 (0)