Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP-47001: stdext: quickcheck-style tests and select->epoll conversion #5402

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4c29a1e
[maintenance]: disable implicit transitive deps
edwintorok Feb 15, 2024
0278742
fix(dune): avoid "module unavailable" errors when running dune build …
edwintorok Jan 29, 2024
514f136
CP-47001: [xapi-fdcaps]: dune plumbing for new library
edwintorok Dec 13, 2023
4c26824
CP-47001: [xapi-fd-test]: dune plumbing for a new test framework
edwintorok Dec 13, 2023
5b0ac7b
CP-47001: [xapi-fdcaps]: add -principal flag
edwintorok Dec 15, 2023
a975edf
CP-47001: [xapi-fdcaps]: optional coverage support
edwintorok Dec 15, 2023
89e95b4
CP-47001: [xapi-fdcaps]: add properties module and tests
edwintorok Dec 20, 2023
fd68005
CP-47001: [xapi-fdcaps]: add operations module and tests
edwintorok Dec 20, 2023
b1c757b
CP-47001: [xapi-fdcaps]: wrap more Unix operations
edwintorok Dec 21, 2023
4da756c
CP-47001: [xapi-fdcaps] runtime tests for read-write properties
edwintorok Dec 22, 2023
43026be
CP-47001: [xapi-fdcaps-test]: add observations module
edwintorok Dec 22, 2023
908f5a0
CP-47001: [xapi-fdcaps-test]: add generate module
edwintorok Dec 22, 2023
78ec02f
CP-47001: [unixext-test]: add quickcheck-style test
edwintorok Dec 22, 2023
de2613e
CP-47001: Add unit tests for threadext
snwoods Feb 14, 2023
8ef9fa5
CP-47001: [unixext-test]: add test for Unixext.proxy
edwintorok Jan 30, 2024
801bb4f
Unix.time_limited_write: fix timeout behaviour on >64KiB writes/reads
edwintorok Nov 21, 2023
319b82b
Unix.time_limited_{read,write}: replace select with Polly
edwintorok Nov 21, 2023
8736e5d
add Unixext.time_limited_single_read
edwintorok Nov 28, 2023
b093542
CP-32622: replace select with Thread.delay
edwintorok Nov 21, 2023
bcae6f5
CP-32622: Delay: replace select with time_limited_read
edwintorok Nov 21, 2023
1c374c2
CP-32622: replace select in proxy with polly
edwintorok Jan 26, 2024
3f9472c
CP-32622: move new libraries to proper subdir
edwintorok Apr 15, 2024
4ef091d
Merge remote-tracking branch 'upstream/feature/perf' into private/edv…
edwintorok May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ _build/
*.bak
*.native
.merlin
_coverage/
*.install
*.swp
compile_flags.txt
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ JOBS = $(shell getconf _NPROCESSORS_ONLN)
PROFILE=release
OPTMANDIR ?= $(OPTDIR)/man/man1/

.PHONY: build clean test doc python format install uninstall
.PHONY: build clean test doc python format install uninstall coverage

# if we have XAPI_VERSION set then set it in dune-project so we use that version number instead of the one obtained from git
# this is typically used when we're not building from a git repo
Expand All @@ -20,6 +20,11 @@ build:
check:
dune build @check -j $(JOBS)

coverage:
dune runtest --instrument-with bisect_ppx --force --profile=$(RELEASE) -j $(JOBS)
bisect-ppx-report html
bisect-ppx-report summary --per-file

clean:
dune clean

Expand Down
32 changes: 31 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(lang dune 2.0)
(lang dune 2.7)
(formatting (enabled_for ocaml))

(cram enable)
(implicit_transitive_deps false)
(generate_opam_files true)

(source (github xapi-project/xen-api))
Expand Down Expand Up @@ -274,6 +276,7 @@
(xapi-stdext-threads (= :version))
(xapi-stdext-unix (= :version))
(xapi-stdext-zerocheck (= :version))
(xapi-fdcaps (= :version))
)
)

Expand Down Expand Up @@ -333,6 +336,8 @@
base-unix
(odoc :with-doc)
(xapi-stdext-pervasives (= :version))
(mtime :with-test)
(xapi-stdext-unix (= :version))
)
)

Expand All @@ -346,6 +351,7 @@
(odoc :with-doc)
xapi-backtrace
(xapi-stdext-pervasives (= :version))
polly
)
)

Expand All @@ -357,3 +363,27 @@
(odoc :with-doc)
)
)

(package
(name xapi-fdcaps)
(synopsis "Static capabilities for file descriptor operations")
(depends
(alcotest :with-test)
base-unix
fmt
(bisect_ppx :with-test)
)
)

(package
(name xapi-fd-test)
(synopsis "Test framework for file descriptor operations")
(depends
(alcotest :with-test)
base-unix
fmt
(mtime (>= 2.0.0))
logs
(qcheck-core (>= 0.21.2))
)
)
2 changes: 2 additions & 0 deletions ocaml/database/dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

(library
(name xapi_database)
(modes best)
(modules
(:standard \ database_server_main db_cache_test db_names db_exn
block_device_io string_marshall_helper string_unmarshall_helper schema
Expand All @@ -40,6 +41,7 @@
xapi-datamodel
xapi-log
(re_export xapi-schema)
xapi-idl.updates
xapi-stdext-encodings
xapi-stdext-pervasives
xapi-stdext-std
Expand Down
1 change: 1 addition & 0 deletions ocaml/forkexecd/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
fd-send-recv
rpclib.core
rpclib.json
rpclib.xml
uuid
xapi-backtrace
xapi-log
Expand Down
6 changes: 4 additions & 2 deletions ocaml/libs/ezxenstore/core/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
logs
threads
uuidm
xenstore_transport
xenstore.unix)
(re_export xenstore)
(re_export xenstore_transport)
threads.posix
(re_export xenstore.unix))
)
4 changes: 2 additions & 2 deletions ocaml/libs/ezxenstore/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name ezxenstore)
(wrapped false)
(libraries
ezxenstore_core
ezxenstore_watch
(re_export ezxenstore_core)
(re_export ezxenstore_watch)
)
)
2 changes: 1 addition & 1 deletion ocaml/libs/ezxenstore/lib_test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name main)
(package ezxenstore)
(deps main.exe)
(libraries cmdliner ezxenstore xenstore_transport)
(libraries cmdliner ezxenstore xenstore_transport xenstore xenstore.unix)
)
5 changes: 4 additions & 1 deletion ocaml/libs/ezxenstore/watch/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
(wrapped false)
(libraries
ezxenstore_core
xenctrl)
xenctrl
uuidm
threads.posix
)
)
5 changes: 5 additions & 0 deletions ocaml/libs/http-lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
(libraries
astring
base64
fmt
ipaddr
mtime
mtime.clock.os
Expand Down Expand Up @@ -35,10 +36,12 @@
(library
(name httpsvr)
(wrapped false)
(modes best)
(modules http_svr http_proxy server_io)
(libraries
astring
http_lib
ipaddr
polly
threads.posix
xapi-log
Expand All @@ -51,10 +54,12 @@
(tests
(names http_test radix_tree_test)
(package http-lib)
(modes (best exe))
(modules http_test radix_tree_test)
(libraries
alcotest
dune-build-info
fmt
http_lib
)
)
Expand Down
5 changes: 4 additions & 1 deletion ocaml/libs/tracing/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name tracing)
(modules tracing)
(libraries re uri xapi-log xapi-stdext-threads)
(libraries re uri xapi-log xapi-stdext-threads threads.posix)
(public_name xapi-tracing))

(library
Expand All @@ -15,7 +15,10 @@
ptime.clock.os
rpclib.core
rpclib.json
result
rresult
tracing
threads.posix
uri
xapi-log
xapi-open-uri
Expand Down
2 changes: 1 addition & 1 deletion ocaml/libs/uuid/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name uuid)
(modules uuidx)
(libraries
unix uuidm
unix (re_export uuidm)
)
(wrapped false)
)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/libs/vhd/cli/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(name disk_to_ocaml)
(public_name disk_to_ocaml)
(package vhd-format-lwt)
(libraries disk lwt))
(libraries disk lwt lwt.unix))
2 changes: 1 addition & 1 deletion ocaml/libs/vhd/vhd_format/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name vhd_format)
(public_name vhd-format)
(flags :standard -w -32-34-37)
(libraries stdlib-shims cstruct io-page rresult uuidm)
(libraries stdlib-shims (re_export bigarray-compat) cstruct io-page rresult uuidm)
(preprocess (pps ppx_cstruct)))
2 changes: 1 addition & 1 deletion ocaml/libs/vhd/vhd_format_lwt/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name vhd_format_lwt)
(public_name vhd-format-lwt)
(libraries cstruct lwt lwt.unix mirage-block vhd-format)
(libraries bigarray-compat cstruct-lwt cstruct lwt lwt.unix mirage-block vhd-format rresult)
(foreign_stubs
(language c)
(names blkgetsize64_stubs lseek64_stubs odirect_stubs)))
2 changes: 1 addition & 1 deletion ocaml/libs/xapi-inventory/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
astring
xapi-stdext-unix
xapi-stdext-threads
threads
threads.posix
)
)
1 change: 1 addition & 0 deletions ocaml/libs/xapi-rrd/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
(libraries
bigarray
rpclib.json
rpclib.core
xmlm
yojson
)
Expand Down
2 changes: 2 additions & 0 deletions ocaml/libs/xapi-rrd/lib_test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
unix
xapi-rrd
xapi-stdext-unix
rpclib.xml
xmlm
)
)

Expand Down
9 changes: 9 additions & 0 deletions ocaml/libs/xapi-stdext/lib/xapi-fd-test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; This will be used to test stdext itself, so do not depend on stdext here
(library
(public_name xapi-fd-test)
(name xapi_fd_test)
(libraries (re_export xapi-fdcaps) unix qcheck-core logs fmt (re_export mtime) mtime.clock.os rresult threads.posix)

; off by default, enable with --instrument-with bisect_ppx
(instrumentation (backend bisect_ppx))
)