Skip to content

Commit efcb7af

Browse files
committed
CP-50448: run the QuickCheck tests in QuickTest
Quicktest runs in Dom0, and the existing quickcheck tests run in the CI. Some of these test as much the OCaml code, as its interaction with the system (e.g. behaviour of system calls). So it is better to run these tests both in the CI and in Dom0. We run these in long mode, to explore more randomly generated scenarios. The seed can be controlled with QCHECK_SEED environment variable. Similar to @StressTest it uses a random seed, instead of a fixed seed. Signed-off-by: Edwin Török <[email protected]>
1 parent eb58c7d commit efcb7af

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

ocaml/quicktest/dune

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
(libraries
77
alcotest
88
astring
9-
109
ezxenstore
1110
ezxenstore.watch
1211
fmt
1312
forkexec
1413
http_lib
1514
mtime
1615
mtime.clock.os
16+
qcheck-alcotest
1717
result
1818
rresult
1919
rpclib.core
2020
rrdd_libs
2121
stunnel
22+
bufio_test
23+
test_timer
2224
threads.posix
2325
unix
2426
uuid

ocaml/quicktest/quicktest.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
(** The main entry point of the quicktest executable *)
1616

17+
let qchecks =
18+
[("bufio", Bufio_test.tests); ("Timer", Test_timer.tests)]
19+
|> List.map @@ fun (name, test) ->
20+
(name, List.map QCheck_alcotest.(to_alcotest ~long:true) test)
21+
1722
let () =
1823
Quicktest_args.parse () ;
1924
Qt_filter.wrap (fun () ->
@@ -43,6 +48,11 @@ let () =
4348
[("http", Quicktest_http.tests)]
4449
else
4550
[]
51+
@
52+
if not !Quicktest_args.skip_stress then
53+
qchecks
54+
else
55+
[]
4656
in
4757
(* Only list tests if asked, without running them *)
4858
if !Quicktest_args.list_tests then

ocaml/quicktest/quicktest_args.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ let set_alcotest_args l = alcotest_args := Array.of_list l
4545

4646
let skip_xapi = ref false
4747

48+
let skip_stress = ref false
49+
4850
(** Parse the legacy quicktest command line args. This is used instead of
4951
invoking Alcotest directly, for backwards-compatibility with clients who
5052
run the quicktest binary. *)
@@ -67,6 +69,7 @@ let parse () =
6769
-default-sr"
6870
)
6971
; ("-skip-xapi", Arg.Set skip_xapi, "SKIP tests that require XAPI")
72+
; ("-skip-stress", Arg.Set skip_stress, "SKIP randomized stress tests")
7073
; ("--", Arg.Rest_all set_alcotest_args, "Supply alcotest arguments")
7174
; ( "-run-only"
7275
, Arg.String (fun x -> run_only := Some x)

0 commit comments

Comments
 (0)