Make test tasks specify which target failed in exception.

Review Request #2090 - Created April 17, 2015 and submitted

Information
Itay Donanhirsh
pants
1431
55d3c4a...
Reviewers
pants-reviews
dturner-tw, nhoward_tw

Make test task raise exception on failure with specific tests targets that failed. This will allow me to specify more twitter-specific behavior in Twitter codebase (by registering my own tasks, which extend tasks I change here).

The gist:
- Added targets_failed into TaskError
- Made pytest_run and JUnitRun write a summary file (either xml or resultlog) and analyze it

As this is supposed to be my first evaaaar pants change, I am probably trying to do here something incredibly idiotic. Don't hesitate to tell me that, I'll be glad to learn.

unit tests.

Issues

  • 0
  • 4
  • 1
  • 5
Description From Last Updated
Itay Donanhirsh
Itay Donanhirsh
Itay Donanhirsh
David Turner
David Turner
David Turner
Nick Howard (Twitter)
Itay Donanhirsh
David Turner
Eric Ayers
Nick Howard (Twitter)
David Turner
Itay Donanhirsh
Review request changed

Status: Closed (submitted)

Eric Ayers

I've made some changes and now I'm having some trouble with the new code to identify failed tests. It seems that the output is sometimes missing the filename:

F ::test_two
 def test_two():
 >     assert 1 == core.two()
 E     assert 1 == 2
 E      +  where 2 = <function two at 0x109c03c08>()
 E      +    where <function two at 0x109c03c08> = core.two

 tests/test_core_red.py:5: AssertionError

F ::test_two

when we expected something like:

F tests/test_core_red.py::test_two

I'm still digging into the problem but thought I'd post it here because I thought someone might have some insight.

  1. I actually bumped into it last night while working on another change. I'm not sure how it passed CI. I'll be working on this later on today as well, but I'd appreciate any help.

  2. Its a tough bug. f I run the tests in a different order (or by themselves) they work. Its only when run with ./pants test tests/python/pants_test:all that I see the failures.

  3. From what I can tell, this line comes directly from the 3rdparty pytest library?

Loading...