5

I'm in a drawn-out situation now with a difficult project where a significant part was refactored and checked in with a significant number of failing tests.

I run PIT in maven but I haven't been able to for a long time because the tests have to be green, but I want the PIT overview at least on the tests that do run.

What's the most effective way to isolate the failing tests from PIT?

henry
  • 5,923
  • 29
  • 46
Adam
  • 5,215
  • 5
  • 51
  • 90
  • Why tests fail, are there bugs in code or tests are deprecated ? – Paweł Adamski Dec 14 '15 at 15:49
  • @PawełAdamski functionality is broken. I haven't tried deprecating tests - what effect does that have? – Adam Dec 14 '15 at 18:20
  • By deprecated tests I mean those that fails because they were written for old code and don't work with refactored one. – Paweł Adamski Dec 14 '15 at 19:36
  • @PawełAdamski I'd say the tests are broken, but not deprecated. I thought you mean there was some functionality in JUnit when you tag a test as deprecated. So the tests were definitely written against the old code, and definitely don't work with the new code, but they need fixing, not deprecating - which is a significant task that is taking time to get done, hence my problem. – Adam Dec 15 '15 at 12:47

1 Answers1

2

I suggest to create JUnit category 'PIT_SKIP' and mark all failing test with it. After that you can set excludedGroups property in PIT maven configuration to filter out selected tests.

You can also go in opposite direction and create category 'PIT_OK' and use property includedGroups.

PIT Maven plugin documentation.

kryger
  • 12,906
  • 8
  • 44
  • 65
Paweł Adamski
  • 3,285
  • 2
  • 28
  • 48
  • Thanks for the pointer - I looked at the 'Maven Quick Start' page and on account of its title, decided it wouldn't tell me anything except how to get started :S – Adam Dec 14 '15 at 16:27
  • Yes, we have very long "quick starts", but no documentation. – henry Dec 15 '15 at 21:07