New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fwd: Parallelize the Perl 6 tests #212
Comments
From @pmichaudSchwern provided the following patch at the OSCON hackathon, If it works on sufficient platforms, we can apply it. Thanks! Pm ----- Forwarded message from Michael G Schwern <schwern@pobox.com> ----- Date: Sat, 26 Jul 2008 19:44:36 -0700 Turns on parallel testing for the perl 6 tests Runs the spectest_regression about 50% faster on my Macbook. -- Index: lib/Parrot/Test/Harness.pm--- lib/Parrot/Test/Harness.pm (revision 29706) if (eval { require TAP::Harness; 1 }) { + $harness_options{jobs} = $ENV{PARROT_HARNESS_JOBS} || $options{jobs} || 1; Index: languages/perl6/t/harness--- languages/perl6/t/harness (revision 29782) -our %harness_args; our %harness_args = ( Index: languages/perl6/config/makefiles/root.in--- languages/perl6/config/makefiles/root.in (revision 29782) # NOTE: eventually, we should remove --keep-exit-code and --fudge spectest: all t/spec # Run a single test t/localtest.data: ----- End forwarded message ----- |
From @cokeOn Sat, Aug 2, 2008 at 1:52 PM, Patrick R. Michaud (via RT)
It'd be nice if we used the same env var for this as we did for the -- |
The RT System itself - Status changed from 'new' to 'open' |
From @ronaldxs
Per request from moritz I have come up with an updated patch that seems Per the suggestion above the controlling environment variable in the Ron |
From @ronaldxsparatest.patchIndex: lib/Parrot/Test/Harness.pm
===================================================================
--- lib/Parrot/Test/Harness.pm (revision 30967)
+++ lib/Parrot/Test/Harness.pm (working copy)
@@ -166,12 +166,13 @@
exit unless my @files = get_files(%options);
if (eval { require TAP::Harness; 1 }) {
- my %opts =
+ my %harness_options =
$options{exec} ? ( exec => $options{exec} )
: $options{compiler} ? ( exec => [ '../../parrot', './' . $options{compiler} ] )
: ();
- $opts{verbosity} = $options{verbosity} ? $options{verbosity} : 0;
- TAP::Harness->new( \%opts )->runtests( @files );
+ $harness_options{verbosity} = $options{verbosity} ? $options{verbosity} : 0;
+ $harness_options{jobs} = $ENV{TEST_JOBS} || $options{jobs} || 1;
+ TAP::Harness->new( \%harness_options )->runtests( @files );
return;
}
Index: languages/perl6/t/harness
===================================================================
--- languages/perl6/t/harness (revision 30967)
+++ languages/perl6/t/harness (working copy)
@@ -24,6 +24,9 @@
'tests-from-file=s' => \my $list_file,
'fudge' => \my $do_fudge,
'verbosity=i' => \$harness_args{verbosity},
+ # A sensible default is num_cores + 1.
+ # Many people have two cores these days.
+ 'jobs:3' => \$harness_args{jobs},
);
Index: languages/perl6/config/makefiles/root.in
===================================================================
--- languages/perl6/config/makefiles/root.in (revision 30967)
+++ languages/perl6/config/makefiles/root.in (working copy)
@@ -196,7 +196,7 @@
# NOTE: eventually, we should remove --keep-exit-code and --fudge
# as the goal is that all tests must pass without fudge
-HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code
+HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code --jobs
spectest: all t/spec
-cd t/spec && svn up
@@ -224,7 +224,7 @@
# Run a single test
t/*.t t/*/*.t t/*/*/*.t: all
- @$(HARNESS_WITH_FUDGE) $@
+ @$(HARNESS_WITH_FUDGE) --jobs=1 $@
t/localtest.data:
$(PERL) -MExtUtils::Command -e test_f $@
|
From @moritzRon Schmidt via RT wrote:
Thank you very much. On Debian with two cores I get Which is good enough for me ;-)
Is there a good reason to test in parallel at all if TEST_JOBS isn't set
++ for that, and ++ for the patch. Now we need some feedback from MacOS X and windows/msvc users, then I'll Cheers, -- |
From @moritzMoritz Lenz wrote:
Well, actually it's the other way round ;-) -- |
From @rurbanconfirmed moritz cygwin test Interesting is that the step from Test-Harness-3.12 to Test-Harness-3.13 make spectest_regression without patch or with patch + Test::Harness-3.12 |
From @ronaldxsOn Wed Sep 10 09:37:42 2008, rurban wrote:
I upgraded my Test::Harness for cygwin and my performance started to |
From @moritzRon Schmidt via RT wrote:
Attached is a slightly improved patch: Moritz -- |
From @moritzparallel-r.patchIndex: lib/Parrot/Test/Harness.pm
===================================================================
--- lib/Parrot/Test/Harness.pm (revision 30954)
+++ lib/Parrot/Test/Harness.pm (working copy)
@@ -166,12 +166,13 @@
exit unless my @files = get_files(%options);
if (eval { require TAP::Harness; 1 }) {
- my %opts =
+ my %harness_options =
$options{exec} ? ( exec => $options{exec} )
: $options{compiler} ? ( exec => [ '../../parrot', './' . $options{compiler} ] )
: ();
- $opts{verbosity} = $options{verbosity} ? $options{verbosity} : 0;
- TAP::Harness->new( \%opts )->runtests( @files );
+ $harness_options{verbosity} = $options{verbosity} ? $options{verbosity} : 0;
+ $harness_options{jobs} = $ENV{TEST_JOBS} || $options{jobs} || 1;
+ TAP::Harness->new( \%harness_options )->runtests( @files );
return;
}
Index: languages/perl6/t/harness
===================================================================
--- languages/perl6/t/harness (revision 30969)
+++ languages/perl6/t/harness (working copy)
@@ -24,6 +24,9 @@
'tests-from-file=s' => \my $list_file,
'fudge' => \my $do_fudge,
'verbosity=i' => \$harness_args{verbosity},
+ # A sensible default is num_cores + 1.
+ # Many people have two cores these days.
+ 'jobs:3' => \$harness_args{jobs},
);
Index: languages/perl6/config/makefiles/root.in
===================================================================
--- languages/perl6/config/makefiles/root.in (revision 30969)
+++ languages/perl6/config/makefiles/root.in (working copy)
@@ -197,21 +197,22 @@
# NOTE: eventually, we should remove --keep-exit-code and --fudge
# as the goal is that all tests must pass without fudge
HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code
+HARNESS_WITH_FUDGE_JOBS = $(HARNESS_WITH_FUDGE) --jobs
spectest: all t/spec
-cd t/spec && svn up
- $(HARNESS_WITH_FUDGE) t/spec
+ $(HARNESS_WITH_FUDGE_JOBS) t/spec
# Run the spectests that we know work.
spectest_regression: all t/spec t/spectest_regression.data
-cd t/spec && svn up
- $(HARNESS_WITH_FUDGE) --tests-from-file=t/spectest_regression.data
+ $(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/spectest_regression.data
fulltest: coretest spectest_regression codetest
# Run the tests in t/localtest.data
localtest: all t/spec t/localtest.data
- @$(HARNESS_WITH_FUDGE) --tests-from-file=t/localtest.data
+ @$(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/localtest.data
# Run the tests in t/localtest.data with a higher verbosity
localtest_loud: all t/spec t/localtest.data
@@ -220,11 +221,11 @@
# Run many tests of your choise.
# make somtests TESTFILES=t/foo/bar
sometests: all
- @$(HARNESS_WITH_FUDGE) $(TESTFILES)
+ @$(HARNESS_WITH_FUDGE_JOBS) $(TESTFILES)
# Run a single test
t/*.t t/*/*.t t/*/*/*.t: all
- @$(HARNESS_WITH_FUDGE) $@
+ @$(HARNESS_WITH_FUDGE) --verbosity=1 $@
t/localtest.data:
$(PERL) -MExtUtils::Command -e test_f $@
|
From @jkeenanMoritz, I applied parallel-r.patch to trunk at r30978 on Darwin (10.4 PPC), Since I build and test Perl 6 infrequently, I'm not sure whether these Thank you very much. /usr/local/bin/perl t/harness t/00-parrot t/01-sanity |
From @rurban2008/9/11 James Keenan via RT <perl6-bugs-followup@perl.org>:
Wrong make target. $ cd languages/perl6 to test this patch and the speed difference.
-- |
From @moritzSince the feedback so far was mostly positive (and none defeating) I now If there are some problems with the test harness, please open a new ticket. Moritz |
@moritz - Status changed from 'open' to 'resolved' |
From @jkeenanOn Thu Sep 11 08:30:49 2008, moritz wrote:
FWIW: Here are the results I got when I ran make spectest_regression as |
From @jkeenanChecked out revision 22229. t/spec/S03-operators/context.rakudo (Wstat: 0 Tests: 35 Failed: 1) |
Migrated from rt.perl.org#57530 (status was 'resolved')
Searchable as RT57530$
The text was updated successfully, but these errors were encountered: