On Mon, Oct 14, 2013 at 2:20 PM, Robert Muir <rcm...@gmail.com> wrote:
> On Mon, Oct 14, 2013 at 11:11 AM, Michael McCandless
> <luc...@mikemccandless.com> wrote:
>>
>> Maybe a simple compromise: could we make a new ant target,
>> "run-specific-test-for-certain", whose purpose was to run that test
>> and fail if no such test was not found?  I think it's fine if this
>> only works at the "module" level, if ant makes it too hairy to
>> recurse.
>>
>
> But is that really a compromise or will it only lead to increased
> complexity? I can see how i would implement this now,
> e.g. i'd just create a fileset of build/*pattern.class and fail if it
> was non-empty, and then invoke 'test' target.
>
> But I'm worried the simple compromise would lead us down a slippery
> slope, once we opened the can of worms, someone would eventually want
> it to validate that you didn't typo the -Dtestmethod too right?

I'm less concerned about that -- if you typo that, then all tests run,
right?  That becomes quickly obvious user error :)

I think the other direction (BUILD SUCCESSFUL when the test did not in
fact run) is much worse: it's non-obvious user error.  You go away
gleeful that your test passed.

> And someone might be upset that my simple solution fails always if
> they run clean first (since class file doesnt exist), or that it
> doesnt fail if the test is @Ignored, or @Nightly and they forgot to
> supply -Dtests.nightly, or @BadApples or @Slow, or throws an
> assumption always because it suppresses Lucene3xCodec and you supply
> -Dtests.codec=Lucene3x, or ... (it goes on and on and on). And one
> could argue tehse are all traps and its trappy if we dont fix it.  :)

Actually I think these would be good failures, i.e. if it was a
nightly test and I did not specify -Dtests.nightly then it should
fail, so I know something went wrong when I tried to run "the one
test".

I think the restriction of "you must be in the module's directory" is
acceptable.

In fact, this would close another test trap I've hit, where I run a
single test (spelled correctly!), yet the test hit an Assume, appears
to pass (BUILD SUCCESSFUL) but actually did not run anything, I
commit, test then fails in jenkins for a stupid reason and I'm like
"WTF?  I swear I tested it".

Net/net I think your simple solution would be great?

Really I just want a "run this exact test name, for sure!" test target.

Mike McCandless

http://blog.mikemccandless.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to