-
Notifications
You must be signed in to change notification settings - Fork 43
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
Ergonomics of :verbose #110
Comments
💚 Yes, this would really be nice and I fall into the same hole once here and there. |
#111 is a first step in making |
I played around with the Using this approach then allows to grep for |
I implemented a simple proof-of-concept for the comment in this branch. This does not yet handle ExUnit assertions. To try it, run |
@alfert what do you think about the poc? |
@evnu , I think we should solve it differently. I suggest tp push it to Do I miss something? I am currently lacking time to look deeper into this and I am not sure whether PropEr will gobble all the output to stdout we are doing. |
That makes sense.
Yes, I am wondering about that as well. I don't know enough of the PropEr-internal specifics to judge that. |
@alfert I added your suggestions in evnu@351365e. This kind-of-works, it detects exceptions and errors. Alas, the output is not written exactly before or after a test (both would be fine I think, as long as it is consistent), but may be split. Maybe there is a way to make ExUnit write the actual output? We might need that in order force flushing the output for the detection before or after a failed test. Note that I did not yet implement the |
Hmm. I assume that the split comes from running tests in parallel, what is the default for ExUnit. What happens if you run the tests in trace mode or with If this does not help, I assume we have to dig into Proper or ExUnit. For Proper, it would be nice to have the possibility to format the output as Elixir code or values instead of the Erlang notation. What do you think? |
With
I think so too. I did some digging into how ExUnit actually prints its output back when I developed https://github.com/evnu/docception. I faintly remember that it was hard to make ExUnit flush its output before the program stopped. Alas, I don't remember if ExUnit uses its own port to write to stdout, or if it buffers the output, or what else is happening with output there. |
This is because ExUnit runs normally in the shutdown handler of the Erlang VM. |
I sometimes encounter users struggling with PropCheck when debugging properties if exceptions are present. Such errors are hard to debug if the
:verbose
flag is not set, as the stack traces are hidden, and new users do not necessarily have that in mind. I wonder if there is something that can be done here. For example, the following requires:verbose
so that the exception is printed:It would be nice if we were able to detect that the test failed due to an exception. The least we should be able to do if such a detection is possible at all would be to output an additional warning: "Failed due to exception. Add :verbose to see stack traces".
The text was updated successfully, but these errors were encountered: