[darcs-devel] [issue332] Feature request: ask to record if tests fail

Jason Dagit dagit at codersbase.com
Tue Nov 7 12:05:36 PST 2006


Josh,

This should be fairly easy to implement.

Modify test_patch in Test.lhs so that it checks for
--ask-record-on-failed-test (or whatever sounds good).  Also look at
ArgumentDefault.lhs, DarcsArguments.lhs, DarcsCommand.lhs and
DarcsFlags.lhs to get a feel for how to implement the commandline
option.  I don't remember exactly which file the details are in, but
it should be in one or more of those.  If memory serves, you should
just need to add it to DarcsFlags for the record command and then
check that flag in test_patch.

Personally, I have no objection to a change like this, but I don't
think it should be the default behavior.  On the other hand, maybe  it
would be better if darcs remembered the details of the patch you
wanted to record when the test fails.  Then the next time you run
record it could take the unfinished patch out of pending and let you
try again (but being intelligent about updating the contents to
reflect any changes you made).

Good luck,
Jason

On 11/7/06, Josh Hoyt <bugs at darcs.net> wrote:
>
> New submission from Josh Hoyt <josh at janrain.com>:
>
> Sometimes unit tests fail for reasons that are beyond the code that is
> being tested. For instance, at work, we test code that uses a SQL
> database. If the testing database server is down or misconfigured, the
> tests fail even if the code is correct. Also, sometimes the tests fail
> in a way that the solution is obvious.
>
> In either of these cases, it can be frustrating to have to select
> which changes to record and re-enter the patch name and comment. I
> would like to be able to decide after the tests have failed whether or
> not to record the patch. That way I can unrecord if it turns out the
> patch is fundamentally flawed, or I can amend-record if the fix is
> obvious.
>
> Looks like you have a bad patch: My slightly flawed patch
> Shall I record it anyway? [yN]
>
> I think this is a happy medium between --no-test and flat-out
> rejecting patches that don't pass the tests. I would be happy with
> this behaviour being available through an option
> (--ask-record-failed?) or on by default. I'm also willing to try to
> implement it, if that helps.
>
> Josh
>
> ----------
> messages: 1178
> nosy: EricKow, droundy, josh, tommy
> status: unread
> title: Feature request: ask to record if tests fail
>
> ____________________________________
> Darcs issue tracker <bugs at darcs.net>
> <http://bugs.darcs.net/issue332>
> ____________________________________
>
> _______________________________________________
> darcs-devel mailing list
> darcs-devel at darcs.net
> http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel
>
>




More information about the darcs-devel mailing list