Skip to content

Commit

Permalink
Re-introducing tests for parallel execution, modified for new require…
Browse files Browse the repository at this point in the history
…ments

This partially reverts commit 0a7debf.
  • Loading branch information
Lucas Hinderberger committed Jun 6, 2024
1 parent 3ced367 commit deb5472
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/parallel/check_collected_responses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"name": "bounce-json: bounce collected responses from N={{datastore "n_parallel"}} parallel runs: {{ datastore "responses" }}",
"request": {
"server_url": "http://localhost{{ datastore "local_port" }}",
"endpoint": "bounce-json",
"method": "POST",
"body": {
"responses": {{ datastore "responses" | marshal }}
}
},
"response": {
"statuscode": 200,
"body": {
"body": {
"responses": [
{{ range $idx, $n := N (datastore "n_parallel") }}
{{ if gt $idx 0 }}, {{ end }}
1
{{ end }}
]
}
}
}
}
]
21 changes: 21 additions & 0 deletions test/parallel/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ $local_port := ":9999" }}
{{ $n_parallel := 5 }}
{
"http_server": {
"addr": "{{ $local_port }}",
"dir": "../_res",
"testmode": false
},
"name": "parallel run of N={{ $n_parallel }} repetitions",
"tests": [
{
"name": "port {{ $local_port }}",
"store": {
"n_parallel": {{ $n_parallel }},
"local_port": {{ $local_port | marshal }}
}
}
, "{{ $n_parallel }}@parallel.json"
, "@check_collected_responses.json"
]
}
24 changes: 24 additions & 0 deletions test/parallel/parallel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"name": "bounce-json: bounce n=1",
"request": {
"server_url": "http://localhost{{ datastore "local_port" }}",
"endpoint": "bounce-json",
"method": "POST",
"body": {
"n": 1
}
},
"response": {
"statuscode": 200,
"body": {
"body": {
"n": 1
}
}
},
"store_response_qjson": {
"responses[]": "body.body.n"
}
}
]

0 comments on commit deb5472

Please sign in to comment.