-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.hurl
194 lines (166 loc) · 5.58 KB
/
tests.hurl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# WARNING: This file was not generated, but manually written.
# DON'T OVERWRITE IT
# Use it to test:
# npx hurl --test data-computer/tests.hurl
POST {{host}}/v1/tree-segment
content-type: application/gzip
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
file,example-json.tar.gz;
HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists
# There should be a waiting time, representing the time taken to process data.
# Fortunately, as the data is sparse, and the computing time is small,
# the need is small.
# Version 4.1.0 of hurl added a delay option, which value is milliseconds.
# https://hurl.dev/blog/2023/09/24/announcing-hurl-4.1.0.html#add-delay-between-requests
POST {{host}}/v1/retrieve-json
content-type: application/json
[Options]
delay: 2000
```
[
{
"value":"{{computing_token}}"
}
]
```
HTTP 200
[{"source":"a","target":"b","weight":3,"origin":["#1","#3","#4"]},{"source":"b","target":"c","weight":2,"origin":["#1","#4"]},{"source":"a","target":"c","weight":2,"origin":["#2","#5"]},{"source":"c","target":"d","weight":3,"origin":["#2","#4","#5"]},{"source":"b","target":"d","weight":1,"origin":["#3"]},{"source":"d","target":"e","weight":1,"origin":["#5"]}]
# stats
POST {{host}}/v1/statistics
content-type: application/gzip
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
file,example-json-minimal.tar.gz;
HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists
# There should be a waiting time, representing the time taken to process data.
# Fortunately, as the data is sparse, and the computing time is small,
# the need is small.
# Version 4.1.0 of hurl added a delay option, which value is milliseconds.
# https://hurl.dev/blog/2023/09/24/announcing-hurl-4.1.0.html#add-delay-between-requests
POST {{host}}/v1/retrieve-json
content-type: application/json
[Options]
delay: 2000
```
[
{
"value":"{{computing_token}}"
}
]
```
HTTP 200
[{"id":"#1","value":{"sample":2,"frequency":0.6666666666666666,"percentage":null,"sum":0,"count":5,"min":0,"max":0,"mean":0,"range":0,"midrange":0,"variance":0,"deviation":0,"population":3,"input":"a"}},{"id":"#2","value":{"sample":2,"frequency":0.6666666666666666,"percentage":null,"sum":0,"count":5,"min":0,"max":0,"mean":0,"range":0,"midrange":0,"variance":0,"deviation":0,"population":3,"input":"b"}},{"id":"#3","value":{"sample":1,"frequency":0.3333333333333333,"percentage":null,"sum":0,"count":5,"min":0,"max":0,"mean":0,"range":0,"midrange":0,"variance":0,"deviation":0,"population":3,"input":"c"}},{"id":"#4","value":{"sample":2,"frequency":0.6666666666666666,"percentage":null,"sum":0,"count":5,"min":0,"max":0,"mean":0,"range":0,"midrange":0,"variance":0,"deviation":0,"population":3,"input":"a"}},{"id":"#5","value":{"sample":2,"frequency":0.6666666666666666,"percentage":null,"sum":0,"count":5,"min":0,"max":0,"mean":0,"range":0,"midrange":0,"variance":0,"deviation":0,"population":3,"input":"b"}}]
################################ Test for Similarity ################################
POST {{host}}/v1/corpus-similarity
content-type: application/x-tar
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
file,example-similarity-json.tar.gz;
HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists
# There should be a waiting time, representing the time taken to process data.
# Fortunately, as the data is sparse, and the computing time is small,
# the need is small.
# Version 4.1.0 of hurl added a delay option, which value is milliseconds.
# https://hurl.dev/blog/2023/09/24/announcing-hurl-4.1.0.html#add-delay-between-requests
POST {{host}}/v1/retrieve-json?indent=true
content-type: application/json
[Options]
delay: 1000
```
[
{
"value":"{{computing_token}}"
}
]
```
HTTP 200
[{
"id": "Titre 1",
"value": {
"similarity": [
"Titre 4",
"Titre 2"
],
"score": [
0.9411764705882353,
0.9349112426035503
]
}
},
{
"id": "Titre 2",
"value": {
"similarity": [
"Titre 1"
],
"score": [
0.9349112426035503
]
}
},
{
"id": "Titre 3",
"value": {
"similarity": [
"Titre 4"
],
"score": [
0.8888888888888888
]
}
},
{
"id": "Titre 4",
"value": {
"similarity": [
"Titre 1"
],
"score": [
0.9411764705882353
]
}
}]
# TODO: ajouter les deux autres routes (v1GraphSegment, v1Lda)
##################################### group-by ######################
POST {{host}}/v1/group-by
content-type: application/gzip
x-hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9
file,example-json-minimal.tar.gz;
HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists
# There should be a waiting time, representing the time taken to process data.
# Fortunately, as the data is sparse, and the computing time is small,
# the need is small.
# Version 4.1.0 of hurl added a delay option, which value is milliseconds.
# https://hurl.dev/blog/2023/09/24/announcing-hurl-4.1.0.html#add-delay-between-requests
POST {{host}}/v1/retrieve-json
content-type: application/json
[Options]
delay: 2000
```
[
{
"value":"{{computing_token}}"
}
]
```
HTTP 200
[{"id":"#1","value":["#4"]},{"id":"#4","value":["#1"]},{"id":"#2","value":["#5"]},{"id":"#5","value":["#2"]},{"id":"#3","value":[]}]
#