Skip to content

Commit b944326

Browse files
authored
Merge pull request #5684 from psafont/lesstestlogs
Testing: reduce amount of logs produced, drop ounit2
2 parents 130bbbe + 0a1822f commit b944326

31 files changed

+581
-603
lines changed

.github/workflows/setup-xapi-environment/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ runs:
5050
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }}
5151
opam-repositories: |
5252
xs-opam: ${{ steps.dotenv.outputs.repository }}
53-
opam-pin: false
5453
dune-cache: true
5554
env:
5655
DUNE_CACHE_STORAGE_MODE: copy

dune-project

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
(name xml-light2)
2424
)
2525

26+
(package
27+
(name xapi-sdk)
28+
(license "BSD-2-Clause")
29+
(synopsis "Xen API SDK generation code")
30+
(depends
31+
(alcotest :with-test)
32+
astring
33+
mustache
34+
(xapi-datamodel (= :version))
35+
(xapi-stdext-unix (and (= :version) :with-test))
36+
)
37+
(allow_empty)
38+
)
2639
(package
2740
(name xen-api-client-lwt)
2841
)
@@ -34,6 +47,23 @@
3447

3548
(package
3649
(name xen-api-client)
50+
(synopsis "Xen-API client library for remotely-controlling a xapi host")
51+
(authors "David Scott" "Anil Madhavapeddy" "Jerome Maloberti" "John Else" "Jon Ludlam" "Thomas Sanders" "Mike McClurg")
52+
(depends
53+
dune-build-info
54+
(alcotest :with-test)
55+
astring
56+
(cohttp (>= "0.22.0"))
57+
re
58+
rpclib
59+
uri
60+
(uuid (= :version))
61+
(xapi-client (= :version))
62+
(xapi-idl (= :version))
63+
(xapi-rrd (= :version))
64+
(xapi-types (= :version))
65+
xmlm
66+
)
3767
)
3868

3969
(package
@@ -142,6 +172,7 @@
142172
(depends
143173
(ocaml (>= "4.02.0"))
144174
dune-build-info
175+
(alcotest :with-test)
145176
astring
146177
(gzip (= :version))
147178
(http-lib (= :version))
@@ -229,6 +260,19 @@
229260

230261
(package
231262
(name wsproxy)
263+
(synopsis "Websockets proxy for VNC traffic")
264+
(authors "Jon Ludlam" "Marcello Seri")
265+
(license "LGPL-2.0-only WITH OCaml-LGPL-linking-exception")
266+
(depends
267+
(alcotest :with-test)
268+
(base64 (>= "3.1.0"))
269+
fmt
270+
logs
271+
(lwt (>= "3.0.0"))
272+
re
273+
uuid
274+
(qcheck-core :with-test)
275+
)
232276
)
233277

234278
(package
@@ -241,6 +285,29 @@
241285

242286
(package
243287
(name vhd-format-lwt)
288+
(synopsis "Lwt interface to read/write VHD format data")
289+
(description "A pure OCaml library to read and write
290+
[vhd](http://en.wikipedia.org/wiki/VHD_(file_format)) format data, plus a
291+
simple command-line tool which allows vhd files to be interrogated,
292+
manipulated, format-converted and streamed to and from files and remote
293+
servers.
294+
295+
This package provides an Lwt compatible interface to the library.")
296+
(authors "Jon Ludlam" "Dave Scott")
297+
(maintainers "Dave Scott <dave@recoil.org>")
298+
(tags ("org:mirage" "org:xapi-project"))
299+
(homepage "https://github.com/mirage/ocaml-vhd")
300+
(source (github mirage/ocaml-vhd))
301+
(depends
302+
(ocaml (and (>= "4.02.3") (< "5.0.0")))
303+
(alcotest :with-test)
304+
(alcotest-lwt :with-test)
305+
(cstruct (< "6.1.0"))
306+
(lwt (>= "3.2.0"))
307+
(mirage-block (>= "2.0.1"))
308+
(vhd-format (= :version))
309+
(io-page (and :with-test (>= "2.4.0")))
310+
)
244311
)
245312

246313
(package
@@ -277,6 +344,19 @@
277344

278345
(package
279346
(name rrd-transport)
347+
(synopsis "Shared-memory protocols for exposing system metrics")
348+
(description "VMs running on a Xen host can use this library to expose performance counters which can be sampled by xapi's metric daemon.")
349+
(authors "John Else")
350+
(depends
351+
(alcotest :with-test)
352+
astring
353+
cstruct
354+
crc
355+
yojson
356+
(xapi-idl (= :version))
357+
(xapi-rrd (= :version))
358+
(odoc :with-doc)
359+
)
280360
)
281361

282362
(package
@@ -322,6 +402,27 @@
322402

323403
(package
324404
(name http-lib)
405+
(synopsis "An HTTP required used by xapi")
406+
(description "This library allows xapi to perform varios activities related to the HTTP protocol.")
407+
(depends
408+
(alcotest :with-test)
409+
astring
410+
(base64 (>= "3.1.0"))
411+
rpclib
412+
(safe-resources(= :version))
413+
sha
414+
(stunnel (= :version))
415+
(uuid (= :version))
416+
xapi-backtrace
417+
(xapi-idl (= :version))
418+
(xapi-log (= :version))
419+
(xapi-stdext-date (= :version))
420+
(xapi-stdext-pervasives (= :version))
421+
(xapi-stdext-threads (= :version))
422+
(xapi-tracing (= :version))
423+
(xml-light2 (= :version))
424+
(odoc :with-doc)
425+
)
325426
)
326427

327428
(package

http-lib.opam

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
# This file is generated by dune, edit dune-project instead
2-
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
32
opam-version: "2.0"
4-
maintainer: "xen-api@lists.xen.org"
5-
authors: "xen-api@lists.xen.org"
3+
synopsis: "An HTTP required used by xapi"
4+
description:
5+
"This library allows xapi to perform varios activities related to the HTTP protocol."
6+
maintainer: ["Xapi project maintainers"]
7+
authors: ["xen-api@lists.xen.org"]
8+
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
69
homepage: "https://xapi-project.github.io/"
7-
bug-reports: "https://github.com/xapi-project/xen-api.git"
8-
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
9-
build: [
10-
["dune" "build" "-p" name "-j" jobs]
11-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
12-
]
13-
available: [ os = "linux" | os = "macos" ]
10+
bug-reports: "https://github.com/xapi-project/xen-api/issues"
1411
depends: [
15-
"ocaml"
16-
"dune"
12+
"dune" {>= "3.0"}
13+
"alcotest" {with-test}
1714
"astring"
1815
"base64" {>= "3.1.0"}
1916
"rpclib"
20-
"safe-resources"
17+
"safe-resources" {= version}
2118
"sha"
22-
"stunnel"
23-
"uuid"
19+
"stunnel" {= version}
20+
"uuid" {= version}
2421
"xapi-backtrace"
25-
"xapi-idl"
26-
"xapi-log"
27-
"xapi-stdext-date"
28-
"xapi-stdext-pervasives"
29-
"xapi-stdext-threads"
30-
"xapi-stdext-unix"
31-
"xapi-tracing"
32-
"xml-light2"
33-
"ounit2" {with-test & >= "2.0.0"}
22+
"xapi-idl" {= version}
23+
"xapi-log" {= version}
24+
"xapi-stdext-date" {= version}
25+
"xapi-stdext-pervasives" {= version}
26+
"xapi-stdext-threads" {= version}
27+
"xapi-tracing" {= version}
28+
"xml-light2" {= version}
29+
"odoc" {with-doc}
30+
]
31+
build: [
32+
["dune" "subst"] {dev}
33+
[
34+
"dune"
35+
"build"
36+
"-p"
37+
name
38+
"-j"
39+
jobs
40+
"@install"
41+
"@runtest" {with-test}
42+
"@doc" {with-doc}
43+
]
3444
]
35-
synopsis: "Library required by xapi"
36-
description: """
37-
These libraries are provided for backwards compatibility only.
38-
No new code should use these libraries."""
39-
url {
40-
src:
41-
"https://github.com/xapi-project/xen-api/archive/master.tar.gz"
42-
}
45+
dev-repo: "git+https://github.com/xapi-project/xen-api.git"

http-lib.opam.template

Lines changed: 0 additions & 40 deletions
This file was deleted.

ocaml/libs/http-lib/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
(libraries
6969
dune-build-info
7070
http_lib
71-
ounit2
7271
safe-resources
7372
stunnel
7473
threads.posix
@@ -85,7 +84,6 @@
8584
dune-build-info
8685
http_lib
8786
httpsvr
88-
ounit2
8987
safe-resources
9088
threads.posix
9189
xapi-stdext-threads
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(test
22
(name parse_test)
33
(package vhd-format-lwt)
4-
(libraries cstruct disk io-page lwt lwt.unix ounit2 vhd-format
4+
(libraries alcotest alcotest-lwt cstruct disk io-page lwt lwt.unix vhd-format
55
vhd_format_lwt))

ocaml/libs/vhd/vhd_format_lwt_test/patterns_lwt.ml renamed to ocaml/libs/vhd/vhd_format_lwt_test/lib.ml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,25 @@
1111
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
* GNU Lesser General Public License for more details.
1313
*)
14-
open OUnit
1514
open Lwt
1615
module IO = Vhd_format_lwt.IO
1716
module Impl = Vhd_format.F.From_file (IO)
1817
module F = Vhd_format.F
1918
module Field = F.Vhd.Field
2019
open Impl
2120

21+
let header =
22+
Alcotest.testable (Fmt.of_to_string F.Header.to_string) F.Header.equal
23+
24+
let footer = Alcotest.testable (Fmt.of_to_string F.Footer.to_string) ( = )
25+
26+
let bat = Alcotest.testable (Fmt.of_to_string F.BAT.to_string) F.BAT.equal
27+
28+
let cstruct_to_string c = String.escaped (Cstruct.to_string c)
29+
30+
let cstruct =
31+
Alcotest.testable (Fmt.of_to_string cstruct_to_string) F.cstruct_equal
32+
2233
module Memory = struct
2334
let alloc bytes =
2435
if bytes = 0 then
@@ -76,8 +87,6 @@ let _absolute_sector_of vhd _position {Vhd_format.Patterns.block; sector} =
7687
(of_int relative_sector)
7788
)
7889

79-
let cstruct_to_string c = String.escaped (Cstruct.to_string c)
80-
8190
(* Verify that vhd [t] contains the sectors [expected] *)
8291
let check_written_sectors t expected =
8392
let y = Memory.alloc 512 in
@@ -90,7 +99,7 @@ let check_written_sectors t expected =
9099
| false ->
91100
fail (Failure "read empty sector, expected data")
92101
| true ->
93-
assert_equal ~printer:cstruct_to_string ~cmp:F.cstruct_equal data y ;
102+
Alcotest.check cstruct __LOC__ data y ;
94103
return ()
95104
)
96105
>>= fun () -> loop xs
@@ -130,12 +139,10 @@ let check_raw_stream_contents t expected =
130139
let actual = Cstruct.sub data (i * 512) 512 in
131140

132141
( if not (List.mem_assoc sector expected) then
133-
assert_equal ~printer:cstruct_to_string ~cmp:F.cstruct_equal
134-
empty_sector actual
142+
Alcotest.check cstruct __LOC__ empty_sector actual
135143
else
136144
let expected = List.assoc sector expected in
137-
assert_equal ~printer:cstruct_to_string ~cmp:F.cstruct_equal
138-
expected actual
145+
Alcotest.check cstruct __LOC__ expected actual
139146
) ;
140147
check (i + 1)
141148
in
@@ -156,8 +163,7 @@ let check_raw_stream_contents t expected =
156163
else
157164
let expected = List.assoc offset expected in
158165
let actual = Cstruct.sub remaining 0 F.sector_size in
159-
assert_equal ~printer:cstruct_to_string ~cmp:F.cstruct_equal
160-
expected actual ;
166+
Alcotest.check cstruct __LOC__ expected actual ;
161167
loop Int64.(add offset 1L) (Cstruct.shift remaining F.sector_size)
162168
in
163169
loop offset data

ocaml/libs/vhd/vhd_format_lwt_test/patterns_lwt.mli renamed to ocaml/libs/vhd/vhd_format_lwt_test/lib.mli

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
* GNU Lesser General Public License for more details.
1313
*)
1414

15+
val header : Vhd_format.F.Header.t Alcotest.testable
16+
17+
val footer : Vhd_format.F.Footer.t Alcotest.testable
18+
19+
val bat : Vhd_format.F.BAT.t Alcotest.testable
20+
21+
val cstruct : Cstruct.t Alcotest.testable
22+
1523
val verify :
1624
Vhd_format_lwt.IO.fd Vhd_format.F.Vhd.t
1725
-> (int64 * Cstruct.t) list

0 commit comments

Comments
 (0)