Skip to content

Commit

Permalink
test(text-clustering): add tests for v1/noise and v1/noise-lodex
Browse files Browse the repository at this point in the history
  • Loading branch information
leogail committed Aug 1, 2024
1 parent 7281156 commit 0ee40da
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions services/text-clustering/tests.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Use it to test:
# npx hurl --test data-computer/tests.hurl

##################################################################
# v1/clustering
POST {{host}}/v1/clustering
content-type: application/x-tar
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
Expand Down Expand Up @@ -33,3 +35,71 @@ Content-Type: application/json
jsonpath "$" count == 49
jsonpath "$[*].value.cluster" exists
jsonpath "$[*].value.weight" exists


##################################################################
# v1/noise
POST {{host}}/v1/noise
content-type: application/x-tar
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
file,example.tar.gz;

HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists

POST {{host}}/v1/retrieve-json
content-type: application/json
[Options]
delay: 90000
```
[
{
"value":"{{computing_token}}"
}
]
```

HTTP 200
Content-Type: application/json
[Asserts]
jsonpath "$" count > 0
jsonpath "$" count < 50


##################################################################
# v1/noise-lodex
POST {{host}}/v1/noise-lodex
content-type: application/x-tar
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
file,example.tar.gz;

HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists

POST {{host}}/v1/retrieve-json
content-type: application/json
[Options]
delay: 90000
```
[
{
"value":"{{computing_token}}"
}
]
```

HTTP 200
Content-Type: application/json
[Asserts]
jsonpath "$" count > 0
jsonpath "$" count < 50
jsonpath "$[*].id" exists
jsonpath "$[*].value" exists

0 comments on commit 0ee40da

Please sign in to comment.