From: Peter Rabbitson Date: Thu, 26 Feb 2015 18:46:47 +0000 (+0100) Subject: Move a number of tests to xt, restructure extra lists X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c26b30de;p=dbsrgits%2FDBIx-Class-Historic.git Move a number of tests to xt, restructure extra lists Instead of the rigid t / xt separation, add more nuance and move some heavy tests around, in order to improve regular user test times, without sacrificing cpantesters coverage Additionally makes it more obvious which tests are decidedly not being run on user-side installs Minimal changes: read diff under -C -C -M --- diff --git a/Makefile.PL b/Makefile.PL index 172cb66..03de9d1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -113,9 +113,18 @@ if ($ENV{DBICTEST_SQLT_DEPLOY}) { } } -tests_recursive (qw| - t -|); +tests_recursive ( + 't', + ( ( + $Module::Install::AUTHOR + or + $ENV{DBICTEST_RUN_ALL_TESTS} + or + ( $ENV{TRAVIS}||'' ) eq 'true' + or + ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL5_CPANM_IS_RUNNING} and ! $ENV{RELEASE_TESTING} ) + ) ? 'xt' : () ), +); install_script (qw| script/dbicadmin diff --git a/maint/Makefile.PL.inc/11_authortests.pl b/maint/Makefile.PL.inc/11_authortests.pl index 442b672..7760de2 100644 --- a/maint/Makefile.PL.inc/11_authortests.pl +++ b/maint/Makefile.PL.inc/11_authortests.pl @@ -1,18 +1,15 @@ require File::Spec; require File::Find; -my $xt_dirs; +my $xt_dist_dirs; File::Find::find(sub { - return if $xt_dirs->{$File::Find::dir}; - $xt_dirs->{$File::Find::dir} = 1 if ( + return if $xt_dist_dirs->{$File::Find::dir}; + $xt_dist_dirs->{$File::Find::dir} = 1 if ( $_ =~ /\.t$/ and -f $_ ); -}, 'xt'); +}, 'xt/dist'); -my @xt_tests = map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dirs; - -# this will add the xt tests to the `make test` target among other things -Meta->tests(join (' ', map { $_ || () } @xt_tests, Meta->tests ) ); +my @xt_dist_tests = map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dist_dirs; # inject an explicit xt test run, mainly to check the contents of # lib and the generated POD's *before* anything is copied around @@ -38,7 +35,7 @@ test_xt : pm_to_blib ), # test list join( ' ', - map { $mm_proto->quote_literal($_) } @xt_tests + map { $mm_proto->quote_literal($_) } @xt_dist_tests ), ) ]} @@ -55,7 +52,7 @@ dbic_distdir_retest_ws_and_footers : '$(ABSPERLRUN)', map { $mm_proto->quote_literal($_) } qw(-Ilib -e $ENV{RELEASE_TESTING}=1;$ENV{DBICTEST_NO_MAKEFILE_VERIFICATION}=1;) ), - 'xt/whitespace.t xt/footers.t', + 'xt/dist/postdistdir/*.t', ) ) ]} diff --git a/maint/travis-ci_scripts/20_install.bash b/maint/travis-ci_scripts/20_install.bash index a3d1c70..f67cd8b 100755 --- a/maint/travis-ci_scripts/20_install.bash +++ b/maint/travis-ci_scripts/20_install.bash @@ -86,6 +86,7 @@ if [[ "$POISON_ENV" = "true" ]] ; then # returned results, look through lib, find all mentioned ENVvars and # set them to true and see if anything explodes for var in \ + DBICTEST_RUN_ALL_TESTS \ DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER \ $( grep -P '\$ENV\{' -r lib/ --exclude-dir Optional | grep -oP '\bDBIC\w+' | sort -u | grep -vP '^(DBIC_TRACE(_PROFILE)?|DBIC_.+_DEBUG)$' ) do diff --git a/xt/authors.t b/xt/dist/authors.t similarity index 100% rename from xt/authors.t rename to xt/dist/authors.t diff --git a/xt/standalone_testschema_resultclasses.t b/xt/dist/loadable_standalone_testschema_resultclasses.t similarity index 100% rename from xt/standalone_testschema_resultclasses.t rename to xt/dist/loadable_standalone_testschema_resultclasses.t diff --git a/xt/podcoverage.t b/xt/dist/pod_coverage.t similarity index 100% rename from xt/podcoverage.t rename to xt/dist/pod_coverage.t diff --git a/xt/footers.t b/xt/dist/postdistdir/pod_footers.t similarity index 100% rename from xt/footers.t rename to xt/dist/postdistdir/pod_footers.t diff --git a/xt/pod.t b/xt/dist/postdistdir/pod_validity.t similarity index 100% rename from xt/pod.t rename to xt/dist/postdistdir/pod_validity.t diff --git a/xt/whitespace.t b/xt/dist/postdistdir/whitespace.t similarity index 100% rename from xt/whitespace.t rename to xt/dist/postdistdir/whitespace.t diff --git a/xt/strictures.t b/xt/dist/strictures.t similarity index 100% rename from xt/strictures.t rename to xt/dist/strictures.t diff --git a/t/04_c3_mro.t b/xt/extra/c3_mro.t similarity index 100% rename from t/04_c3_mro.t rename to xt/extra/c3_mro.t diff --git a/t/admin/10script.t b/xt/extra/dbicadmin.t similarity index 100% rename from t/admin/10script.t rename to xt/extra/dbicadmin.t diff --git a/t/search/deprecated_attributes.t b/xt/extra/diagnostics/deprecated_rs_attributes.t similarity index 100% rename from t/search/deprecated_attributes.t rename to xt/extra/diagnostics/deprecated_rs_attributes.t diff --git a/t/relationship/malformed_declaration.t b/xt/extra/diagnostics/malformed_rel_declaration.t similarity index 100% rename from t/relationship/malformed_declaration.t rename to xt/extra/diagnostics/malformed_rel_declaration.t diff --git a/t/103many_to_many_warning.t b/xt/extra/diagnostics/many_to_many_warning.t similarity index 100% rename from t/103many_to_many_warning.t rename to xt/extra/diagnostics/many_to_many_warning.t diff --git a/t/40resultsetmanager.t b/xt/extra/diagnostics/resultset_manager.t similarity index 100% rename from t/40resultsetmanager.t rename to xt/extra/diagnostics/resultset_manager.t diff --git a/t/search/void.t b/xt/extra/diagnostics/search_in_void_ctx.t similarity index 100% rename from t/search/void.t rename to xt/extra/diagnostics/search_in_void_ctx.t diff --git a/t/relationship/unresolvable.t b/xt/extra/diagnostics/unresolvable_relationship.t similarity index 100% rename from t/relationship/unresolvable.t rename to xt/extra/diagnostics/unresolvable_relationship.t diff --git a/xt/dbictest_unlink_guard.t b/xt/extra/internals/dbictest_unlink_guard.t similarity index 100% rename from xt/dbictest_unlink_guard.t rename to xt/extra/internals/dbictest_unlink_guard.t diff --git a/t/discard_changes_in_DESTROY.t b/xt/extra/internals/discard_changes_in_DESTROY.t similarity index 100% rename from t/discard_changes_in_DESTROY.t rename to xt/extra/internals/discard_changes_in_DESTROY.t diff --git a/t/90ensure_class_loaded.t b/xt/extra/internals/ensure_class_loaded.t similarity index 100% rename from t/90ensure_class_loaded.t rename to xt/extra/internals/ensure_class_loaded.t diff --git a/t/91merge_joinpref_attr.t b/xt/extra/internals/merge_joinpref_attr.t similarity index 100% rename from t/91merge_joinpref_attr.t rename to xt/extra/internals/merge_joinpref_attr.t diff --git a/t/55namespaces_cleaned.t b/xt/extra/internals/namespaces_cleaned.t similarity index 97% rename from t/55namespaces_cleaned.t rename to xt/extra/internals/namespaces_cleaned.t index 4992a99..0023602 100644 --- a/t/55namespaces_cleaned.t +++ b/xt/extra/internals/namespaces_cleaned.t @@ -37,12 +37,6 @@ use Test::More; use lib 't/lib'; -BEGIN { - require DBICTest::RunMode; - plan( skip_all => "Skipping test on plain module install" ) - if DBICTest::RunMode->is_plain; -} - use DBICTest; use File::Find; use File::Spec; diff --git a/xt/optional_deps.t b/xt/extra/internals/optional_deps.t similarity index 100% rename from xt/optional_deps.t rename to xt/extra/internals/optional_deps.t diff --git a/xt/quote_sub.t b/xt/extra/internals/quote_sub.t similarity index 100% rename from xt/quote_sub.t rename to xt/extra/internals/quote_sub.t diff --git a/t/53lean_startup.t b/xt/extra/lean_startup.t similarity index 100% rename from t/53lean_startup.t rename to xt/extra/lean_startup.t diff --git a/t/multi_create/reentrance_count.t b/xt/extra/multicreate_opcount.t similarity index 100% rename from t/multi_create/reentrance_count.t rename to xt/extra/multicreate_opcount.t diff --git a/t/zzzzzzz_sqlite_deadlock.t b/xt/extra/sqlite_deadlock.t similarity index 100% rename from t/zzzzzzz_sqlite_deadlock.t rename to xt/extra/sqlite_deadlock.t