-
Notifications
You must be signed in to change notification settings - Fork 71
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
Added skip #778
base: main
Are you sure you want to change the base?
Added skip #778
Conversation
Hello @patricoferris and @talex5 -- this is the new PR. The questions asked here are still much needed here too. Thank you :)) |
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.
You need to define the skip
function too (to raise a suitable exception for MDX).
BTW, you don't need to open a new PR for every revision. Just update your existing branch (git push -f
to force-update if you're undoing old commits).
lib_eio_linux/tests/test.ml
Outdated
|
||
let test_poll_add_busy () = | ||
Eio_linux.run ~queue_depth:2 @@ fun _stdenv -> | ||
Eio_linux.run ~fallback:skip (fun _stdenv -> |
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.
You still need the queue depth. And there's no need to remove the @@
.
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.
Thank you @talex5 --
I have made some changes.
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.
For skipping tests in the Alcotest framework there is https://ocaml.org/p/alcotest/1.8.0/doc/Alcotest/index.html#val-skip
lib_eio_linux/tests/test.ml
Outdated
@@ -19,7 +23,7 @@ let read_one_byte ~sw r = | |||
) | |||
|
|||
let test_poll_add () = | |||
Eio_linux.run @@ fun _stdenv -> | |||
Eio_linux.run ~fallback:skip (fun _stdenv -> |
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.
Still no need to make the change from @@
to (
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.
Thank you @patricoferris -- I have gone through the documentation, To get it correct, I used Alcotest.skip
. Something like this
let skip_io_uring () =
Alcotest.skip "Skipping test: io_uring not available in Docker";;
However, when i use this, i encounter this error: Alcotest.skip "Skipping test: io_uring not available in Docker";; Error: This expression has type string but an expression was expected of type unit
Is there something i am doing wrong? I would appreciate help.
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.
@create2000 the type of skip
is
val skip : unit -> 'a
It doesn't expect a string as the first argument but a value of type unit
(i.e ()
). You could perhaps log something with Eio.traceln
and then Alcotest.skip ()
. Note that this is only for the Alcotest-based Linux tests.
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.
@patricoferris Thank you for the clarification. I have modified it and logged a message using the Eio.tracein
which was displayed in the generated file after running the file.
This is the new modification:
let skip_io_uring () =
Eio.traceln "Skipping test: io_uring not available in Docker";
Alcotest.skip ()
let test_poll_add () =
Eio_linux.run ~fallback:(skip_io_uring())
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.
Note that in #777 you were trying to make this work for MDX (.md) files, but this PR is changing an Alcotest (.ml) file. Here you don't need a new exception, as Alcotest already supports skipping. However, you should use the error message that Eio_linux.run
gives you, rather than just assuming that the problem is Docker.
Hello @talex5 -- thank you for the insight. How do I get the error message from Eio_linux.run? |
The argument to fallback is |
Hello @talex5 -- regarding adding the skip feature to MDX, I discovered there are two .md files: spawn.md and fd_sharing.md. Am I to create a new .md file or add the skip feature to one of the already existing .md files? |
Symlinking is privileged operation on Windows, so we check if the running user can make symlinks before running tests that require them.
If the fiber fails, record the backtrace when failing the switch. `fork` itself already did this, but `fork_daemon` and `fork_promise_exn` didn't.
59bcfa2
to
5637e21
Compare
The skip feature needs adding to MDX itself (not Eio). But existing md files will need to be modified to use it. |
@talex5 -- I have been trying to add the skip feature to MDX and I need some help: First, I have MDX installed via spam, but when I try to check the version, it doesn't show. So, I decided to clone the MDX repo and followed the instructions in the From the I will appreciate any additional help. Thank you ;)) |
You'll need to add a test to |
This is a work-in-progress that adds skip to the test file.