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

Add option for suppress logs in test cases. #243

Open
ever-cifuentes-globant opened this issue Oct 11, 2017 · 2 comments
Open

Add option for suppress logs in test cases. #243

ever-cifuentes-globant opened this issue Oct 11, 2017 · 2 comments

Comments

@ever-cifuentes-globant
Copy link

ever-cifuentes-globant commented Oct 11, 2017

It would awesome to have a functionality similar to the ExUnit tags. Especially for the suppression of the logs generated in the tests.

@tag :capture_log
it "should forward the error result and stop" do
  #...
do

It would be useful for cases like this one, where ran three tests successfully but the first one is showing a ugly log.

.2017-10-11 14:46:57.783 nonode@nohost pid=<0.30.0> : Process #PID<0.576.0> raised an exception
** (RuntimeError) crash_test
    spec/orders_service/fsm/recipient_spec.exs:683: anonymous fn/0 in (....)
..

This functionality already exists and is not documented correctly? or could be added in a near future?
A function capture_log already exists, but the purpose is different.

@antonmi
Copy link
Owner

antonmi commented Oct 12, 2017

Hi, @ever-cifuentes-globant !
ESpec has a different notation for tags (see (Context blocks and tags)
[https://github.com/antonmi/espec/blob/master/README.md#context-blocks-and-tags])

Idea of :capture_log tag is awesome! ESpec definitely needs such functionality!

Thank you!

@ever-cifuentes-globant
Copy link
Author

This seems to be related.. I also found this kind of warnings related to the coverage, Again, it would be awesome to suppress those kind of warnings and have a nice and green tests executed.

...WARNING: Deleting data for module 'Elixir.ProcessQueue' imported from
["/path/to/my/project/process_queue/Elixir.ProcessQueue.coverdata",
 "/path/to/my/project/process_queue/Elixir.ProcessQueue_meck_original.coverdata"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants