Hi,

Eric Kow <ko...@darcs.net> writes:
> 1. when I run tests, I sometimes like to cd into the temporary directory
> for forensics.  Is there a way to make this convenient?

My intention for this was to hook on the failing test and tar up the
working directory into a $sha1.tar.gz and point that out in the output,
probably keeping it somewhere convenient. That would both give you what
you want as well as make it possible to eventually have buildbot publish
those tar files somehow (I think it is possible to have buildsteps copy
files from the slave to the buildmaster and make them available for
download or such these days).

> 2. what's the relationship between this work and shelltestrunner?

If I understand correctly, shelltestrunner serves a fairly different
purpose, namely to run a single shell command and check its outputs
against regexps or such.

The test-framework and shell components in there are largely unrelated
to those that we have.

>> - we can no longer run any tests without -ftest (and those extra 
>> dependencies)
>
> Can -ftest be on by default once shellish is up?

I certainly think so. Unfortunately, cabal will automatically turn the
flag off if it can't satisfy the dependencies without giving a warning,
IIRC. (This only doesn't happen with cURL (where it would be actually
useful) since that's not a Haskell package.)

>> - the output is slightly less nice, maybe another feature request for
>>   test-framework (align the results in a column or something)
>
> I don't mind 

I slightly do, but I can patch my test-framework and send patches to Max
when I get around to. : - )

>> NB: The test runner comes with a dependency on a not-yet-uploaded hackage
>> package, namely "shellish". Grab from http://repos.mornfall.net/shellish
>> ... that code originated in darcs-benchmark and when I upload it to hackage,
>> I'll change darcs-benchmark to use the library too. Upload ETA couple of 
>> days,
>> I need to document it properly first.
>
> darcs failed:  Couldn't fetch
> `0000000046-5066653559d4d6134b022d66a634a17fdcf8db35d28b447e581fec284afa4689'

Booh. Darcs seems to very occasionally ignore my --umask set in
~/.darcs/defaults. Maybe bug-worthy. Anyway, fixed now. (Could this, by
any remote chance, be related to those perpetual problems that patch-tag
has with permissions?)

>> move ./tests/example_binary.png ./tests/repos/example_binary.png
>> move ./tests/haskell_policy.sh ./tests/failing-haskell_policy.sh
>> move ./tests/repos ./tests/data
>> adddir ./tests/bin
>> move ./tests/hspwd.hs ./tests/bin/hspwd.hs
>> move ./tests/trackdown-bisect-helper.hs 
>> ./tests/bin/trackdown-bisect-helper.hs
>
> Seems to be general tidying

Aye.

>> +instance Testlike Running Result ShellTest where
>> +  testTypeName _ = "Shell"
>> +  runTest topts test = runImprovingIO $ liftIO (shellish $ runtest test)
>
> I'm looking forward to seeing test-framework-shell in the future.

It *might* be just above the threshold of usefulness. I am not
sure... the actual bit of the code that's not darcs-specific is fairly
small.

>> hunk ./tests/harness.sh 13
>>  
>>  # Check things that should be true when all the testscripts run
>>  
>> -test -f "$HOME"/harness.sh || { echo "HOME=\"$HOME\" is not the test suite 
>> directory"; exit 1; }
>> +test -f "$HOME/lib"
>> +password="AKARABNADABARAK-KARABADANKBARAKA"
>> +grep $password "$HOME/test" || grep $password "$HOME/harness.sh"
>
> Not sure what this is about

This is the harness.sh test, the purpose of which is to check that the
environment for the tests is set correctly. For that, we check that a
file named $HOME/test or $HOME/harness.sh (the latter is needed to avoid
breaking the existing ShellHarness) contains a rather unlikely string,
which re-assures us, that $HOME is indeed pointing to our test's working
directory.

>> hunk ./tests/gzcrcs.sh 33
>> -gunzip -c repos/maybench-crc.tgz | tar xf -
>> +gunzip -c $TESTDATA/maybench-crc.tgz | tar xf -
>
> And this, less hard-coding of paths and more relying on the environment
> This also makes it a little bit trickier to run tests by hand, but
> that's not too big a deal (these tests are kind of rare anyway)

If that's a concern, it would be easy to add a check to lib that sets
TESTDATA to something reasonable if it is not set.

Yours,
   Petr.
_______________________________________________
darcs-users mailing list
darcs-users@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to