mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
add hurl tests for currency exchange demo
This commit is contained in:
parent
5526314b3c
commit
6e50f982c3
4 changed files with 47 additions and 4 deletions
5
.github/workflows/e2e_test_demos.yml
vendored
5
.github/workflows/e2e_test_demos.yml
vendored
|
|
@ -32,6 +32,11 @@ jobs:
|
|||
run: |
|
||||
python -m venv venv
|
||||
|
||||
- name: install hurl
|
||||
run: |
|
||||
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/4.0.0/hurl_4.0.0_amd64.deb
|
||||
sudo dpkg -i hurl_4.0.0_amd64.deb
|
||||
|
||||
- name: install model server, arch gateway and test dependencies
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
POST http://localhost:10000/v1/chat/completions
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "convert 100 eur"
|
||||
}
|
||||
]
|
||||
}
|
||||
HTTP 200
|
||||
[Asserts]
|
||||
header "content-type" == "application/json"
|
||||
jsonpath "$.model" matches /^gpt-4o/
|
||||
jsonpath "$.metadata.x-arch-state" != null
|
||||
jsonpath "$.usage" != null
|
||||
jsonpath "$.choices[0].message.content" != null
|
||||
jsonpath "$.choices[0].message.role" == "assistant"
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
POST http://localhost:10000/v1/chat/completions
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "convert 100 eur"
|
||||
}
|
||||
],
|
||||
"stream": true
|
||||
}
|
||||
HTTP 200
|
||||
[Asserts]
|
||||
header "content-type" matches /text\/event-stream/
|
||||
body matches /^data: .*?currency_exchange.*?\n/
|
||||
body matches /^data: .*?EUR.*?\n/
|
||||
|
|
@ -8,11 +8,13 @@ do
|
|||
echo "Running tests for $demo ..."
|
||||
echo "****************************************"
|
||||
cd ../../samples_python/$demo
|
||||
echo "starting archgw"
|
||||
archgw up arch_config.yaml
|
||||
docker compose up -d
|
||||
cd ../../shared/test_runner
|
||||
TEST_DATA=../../samples_python/$demo/test_data.yaml poetry run pytest
|
||||
cd ../../samples_python/$demo
|
||||
echo "starting docker containers"
|
||||
docker compose up -d 2>&1 > /dev/null
|
||||
echo "starting hurl tests"
|
||||
hurl --test hurl_tests/*.hurl
|
||||
echo "stopping docker containers and archgw"
|
||||
archgw down
|
||||
docker compose down -v
|
||||
cd ../../shared/test_runner
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue