Skip to content

Fix eunit_surefire crash with rebar eunit tests=... #304

Closed
wants to merge 1 commit into from

5 participants

@liskin
liskin commented Jun 20, 2014

This fixes the following crash:

=ERROR REPORT==== 20-Jun-2014::16:35:38 ===
Error in process <0.40.0> with exit value:
{function_clause,[{eunit_surefire,escape_suitename,[undefined,[]],[{file,"eunit_surefire.erl"},{line,416}]},{eunit_surefire,write_report,2,[{file,"eunit_surefire.erl"},{line,258}]},{lists,foreach,2,[{file,"lists.erl"},{line,1336}]},{...

@liskin liskin Fix eunit_surefire crash with rebar eunit tests=...
This fixes the following crash:

> =ERROR REPORT==== 20-Jun-2014::16:35:38 ===
> Error in process <0.40.0> with exit value: {function_clause,[{eunit_surefire,escape_suitename,[undefined,[]],[{file,"eunit_surefire.erl"},{line,416}]},{eunit_surefire,write_report,2,[{file,"eunit_surefire.erl"},{line,258}]},{lists,foreach,2,[{file,"lists.erl"},{line,1336}]},{...
81244dc
@ferd
ferd commented Jun 20, 2014

What causes the crash?

@ferd ferd added the bug label Jun 20, 2014
@liskin
liskin commented Jun 20, 2014

eunit_surefire needs to know the name of the "test suite", which it usually doesn't if we call eunit:test with just {generator, M, F}. By "usually" I mean that if the generator contains only named tests, it doesn't crash but generates files .eunit/TEST-.xml, which is quite undesirable (I've seen it generate files with spaces, commas, etc.).

When we call eunit:test(mod), it's automatically surrounded by {"module 'mod'", …}, so I figured we might want to do that manually when calling eunit:test with generators directly.

@tuncer
tuncer commented Jun 22, 2014

Does this need an extra test case?

@liskin
liskin commented Jun 22, 2014

I think it does and I'll try to write one in the evening.

By the way, the tests= option is marked as experimental. Does anyone remember why is that and if, perhaps, this fix may be enough for it to become non-experimental? :-)

@tuncer
tuncer commented Jul 25, 2014

@liskin wrote:

By the way, the tests= option is marked as experimental. Does anyone remember why is that and if, perhaps, this fix may be enough for it to become non-experimental? :-)

Fixed in #330.

@tuncer
tuncer commented Jul 25, 2014

@liskin ping?

@liskin
liskin commented Jul 26, 2014

Oh, that "evening" got pretty long, didn't it? Sorry, got quite busy lately.
Anyway, I'm on vacation until 2014-08-03, can't promise anything until then, but I may try to catch up on the plane home.

@tuncer
tuncer commented Dec 21, 2014

ping?

@pichi
pichi commented on 81244dc May 13, 2015

I don't see this patch merged in upstream. Is there any reason?

I think they're waiting for me to write a test case, which I've been postponing for months. Maybe we can hack something together at the next Perl Mongers? :-)

@tuncer
tuncer commented Jun 1, 2015

Any chance of getting this finished and into the next release (to happen really soon)?

@liskin
liskin commented Jun 26, 2015

Not much, I'm sorry. I didn't write any Erlang for almost a year now and therefore I am not a user of rebar any more. I wish I could force myself to do this for the sake of closure, but I can't promise much. :-(

@lrascao
lrascao commented Feb 19, 2016

@liskin i've cherry-picked you commit and added a test case, do you mind looking over #591 and see if the test sufficiently covers the bug you found?

@liskin
liskin commented Feb 19, 2016

@lrascao If that test fails without my patch and succeeds with it, then I think it's okay. I can't remember the exact details of this issue, but I don't think there was more to it than a simple tests=something. :-)

@lrascao
lrascao commented Feb 23, 2016

Closing in favor of #591 as it contains the fix plus a simple test

@lrascao lrascao closed this Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.