On Wed, Jan 23, 2008 at 11:51:56PM -0500, Mark Stosberg wrote: > >> Sat Jan 19 22:56:51 EST 2008 Mark Stosberg <[EMAIL PROTECTED]> > >> * Major Perl test suite clean-up. > >> The primary purpose of this patch was make sure all the tests are > >> executed in > >> randomly named directories, which allows us to run Perl tests in > >> parallel, > >> without the directory names collided. > >> > >> This isn't enabled by default for "make test", but it is there to > >> play with. > >> In the test directory, you can now do: > >> > >> ./bin/prove -j9 *.pl > >> > >> to run 9 tests in parallel. There is also "--fork" > >> option which should be a win on multi-CPU computers. > >> See "perldoc ./bin/prove" for details. > >> > >> As part of this, a lot of boiler-plate code at the top and bottom of > >> the > >> scripts could be eliminated, and I made few other minor style > >> clean-ups > >> while I had the files open. > >> > >> There should be no functional changes to the tests. > > > > I'm not sure I like this idea, as it seems likely to lead to greater > > difficulty in understanding and debugging failing test results. We can > > already run up to six tests in parallel just by running make -j6 test. > > Unless I misunderstand how this would work, it is quite likely both > tests would have tried to create a repo named "temp1" in the same > directory at the same time, and there would be a conflict.
It just works by using separate directories for the tests_shell, test_shell_hashed etc. It's all done in GNUMakefile, so you can read about it there: # $1 - description # $2 - setup # $3 - discard # $4 - type # $5 - extension # $6 - harness define harness @echo Running $4 tests on $1 repositories... @rm -rf tests-$4-$1.dir && cp -R tests tests-$4-$1.dir @cd tests-$4-$1.dir && rm -rf .darcs; mkdir .darcs;\ $2;\ if [ -r $(TEST_FILTER_FILE) ];\ then grep "\.$5" $(TEST_FILTER_FILE) | grep -v '^#' | $3 | xargs $6; \ else ls *.$5 | sort -r | $3 | xargs $6; fi @echo Done running tests on $1 repositories... endef It's been refactored recently by Eric, so it's got less duplication of code and is more complicated. > > Also, why make the directory names random? > > It's the standard tempfile/tempdir way to name temporary files and > directories. Right, but that's because it's not standard to expect users to investigate temporary files and directories manually, but that's precisely how I use the test suite (when tests fail). > > Couldn't we just generate a unique directory name from the test name > > itself? So then init_tmp_repo() in test foo.pl would generate a > > repository named temp1-foo. > > I have now sent a patch for something like this, that, so that the > directory name is like "add.pl-tmpdir-XXXX", where the XXXX become > random characters. That's definitely better, except that it causes add_in_subdir.pl to fail for me... :( -- David Roundy Department of Physics Oregon State University _______________________________________________ darcs-devel mailing list darcs-devel@darcs.net http://lists.osuosl.org/mailman/listinfo/darcs-devel