-
Notifications
You must be signed in to change notification settings - Fork 292
Port some Xapi unit tests from OUnit to Alcotest framework #3568
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
Conversation
ocaml/tests/test_network.ml
Outdated
] | ||
let assert_equal msg p1 p2 = | ||
let network_purpose = Alcotest_comparators.from_rpc_of_t API.rpc_of_network_purpose in | ||
Alcotest.(check (list network_purpose)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need slist
here because it's conceptually a set, the order doesn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good , just one minor comment.
ocaml/tests/test_xapi_db_upgrade.ml
Outdated
let __context = make_test_database () in | ||
upgrade_bios_strings.fn ~__context; | ||
Stdext.Unixext.mkdir_safe "/var/tmp" 0o755; | ||
Stdext.Unixext.write_string_to_file "/var/tmp/.previousInventory" inventory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to reference the Xapi_stdext_unix
module directly, that way we don't have to depend on the whole of stdext.
61bb715
to
202576b
Compare
let assert_succeed url host port = | ||
Alcotest.(check (pair string int)) | ||
"test_split_host_port" | ||
(split url) (host, port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected value should go first here
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Signed-off-by: Akanksha Mathur <akanksha.mathur@citrix.com>
Ported a few simpler tests while waiting around for a build. We should make a list of which would be the most useful tests to port somewhere.