mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-23 00:44:55 +03:00
Add integration test for parallel mode with --json
This commit is contained in:
parent
cd431d023a
commit
5123035fd9
7
integration/hurl/tests_ok/parallel_json.out.pattern
Normal file
7
integration/hurl/tests_ok/parallel_json.out.pattern
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
||||||
|
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[{"name":"name","value":"~"}],"url":"http://localhost:8000/parallel/hello?name=~"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"line":1,"time":~~~}],"filename":"tests_ok/parallel_~.hurl","success":true,"time":~~~}
|
11
integration/hurl/tests_ok/parallel_json.ps1
Normal file
11
integration/hurl/tests_ok/parallel_json.ps1
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Set-StrictMode -Version latest
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
hurl --parallel --json `
|
||||||
|
tests_ok/parallel_a.hurl `
|
||||||
|
tests_ok/parallel_b.hurl `
|
||||||
|
tests_ok/parallel_c.hurl `
|
||||||
|
tests_ok/parallel_d.hurl `
|
||||||
|
tests_ok/parallel_e.hurl `
|
||||||
|
tests_ok/parallel_f.hurl `
|
||||||
|
tests_ok/parallel_g.hurl
|
11
integration/hurl/tests_ok/parallel_json.sh
Executable file
11
integration/hurl/tests_ok/parallel_json.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
hurl --parallel --json \
|
||||||
|
tests_ok/parallel_a.hurl \
|
||||||
|
tests_ok/parallel_b.hurl \
|
||||||
|
tests_ok/parallel_c.hurl \
|
||||||
|
tests_ok/parallel_d.hurl \
|
||||||
|
tests_ok/parallel_e.hurl \
|
||||||
|
tests_ok/parallel_f.hurl \
|
||||||
|
tests_ok/parallel_g.hurl
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
hurl --parallel --output /dev/null \
|
hurl --parallel --output /dev/null \
|
||||||
tests_ok/parallel_a.hurl \
|
tests_ok/parallel_a.hurl \
|
||||||
tests_ok/parallel_b.hurl \
|
tests_ok/parallel_b.hurl \
|
||||||
tests_ok/parallel_c.hurl \
|
tests_ok/parallel_c.hurl \
|
||||||
|
@ -26,11 +26,11 @@ use crate::parallel::progress::{Mode, ParProgress};
|
|||||||
use crate::parallel::worker::{Worker, WorkerId};
|
use crate::parallel::worker::{Worker, WorkerId};
|
||||||
use crate::util::term::{Stderr, Stdout, WriteMode};
|
use crate::util::term::{Stderr, Stdout, WriteMode};
|
||||||
|
|
||||||
/// A parallel runner manages a list of `Worker`. Each worker is either idle, or running a
|
/// A parallel runner manages a list of `Worker`. Each worker is either idle or is running a
|
||||||
/// [`Job`]. To run jobs, the [`ParallelRunner::run`] method much be executed on the main thread.
|
/// [`Job`]. To run jobs, the [`ParallelRunner::run`] method much be executed on the main thread.
|
||||||
/// Each worker has its own thread that it used to run a Hurl file, and communicate with the main
|
/// Each worker has its own thread that it uses to run a Hurl file, and communicates with the main
|
||||||
/// thread. The communication use a multi-producer, single-consumer channel: workers are the
|
/// thread. Standard multi-producer single-producer channels are used between the main runner and
|
||||||
/// producers, and the parallel runner is the consumer.
|
/// the workers to send job request and receive job result.
|
||||||
///
|
///
|
||||||
/// The parallel runner is responsible to manage the state of the workers, and to display standard
|
/// The parallel runner is responsible to manage the state of the workers, and to display standard
|
||||||
/// output and standard error, in the main thread. Each worker reports its progression to the
|
/// output and standard error, in the main thread. Each worker reports its progression to the
|
||||||
|
Loading…
Reference in New Issue
Block a user