Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: PerlDancer/Dancer2
...
head fork: PerlDancer/Dancer2
  • 9 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
3  .gitignore
@@ -10,3 +10,6 @@ MYMETA.yml
contrib/sessions/
contrib/logs/
*.sw?
+tools/plugins_auto_tests/perlbrew
+tools/plugins_auto_tests/plugins_list
+tools/plugins_auto_tests/result.csv
View
2  lib/Dancer/Plugin.pm
@@ -133,7 +133,7 @@ sub register_plugin {
my $plugin_version = eval "\$${plugin}::VERSION" || '??';
# make sure the plugin is compatible with this version of Dancer
- grep { $_ eq $dancer_major_version } @$supported_versions
+ ( grep { $_ eq $dancer_major_version } @$supported_versions) || $ENV{DANCER_FORCE_PLUGIN_REGISTRATION}
or croak "$plugin $plugin_version does not support Dancer $dancer_major_version.";
View
2  t/config.t
@@ -88,7 +88,7 @@ is_deeply [$fail->config_files],
like(
exception { $fail->config },
- qr{not a valid YAML file},
+ qr{YAML},
'Configuration file parsing failure',
);
View
47 tools/plugins_auto_tests/Makefile
@@ -0,0 +1,47 @@
+
+HERE=${PWD}
+
+PERLBREW_DIR=${HERE}/perlbrew
+PERLBREW=export PERLBREW_ROOT=${PERLBREW_DIR} && source ${PERLBREW_DIR}/etc/bashrc && PERLBREW_ROOT=${PERLBREW_DIR} ${PERLBREW_DIR}/bin/perlbrew
+CPANM_DANCER1=${PERLBREW} exec --with dancer1_plugin_tests ${PERLBREW_DIR}/bin/cpanm
+CPANM_DANCER2=${PERLBREW} exec --with dancer2_plugin_tests ${PERLBREW_DIR}/bin/cpanm
+
+all: got_curl got_bash got_perlbrew_perl plugins_list
+ echo "Plugin name,Pass on Dancer 1,Pass on Dancer 2" > result.csv
+ @for i in `cat plugins_list`; do pass_d1=0; pass_d2=0; \
+ echo " ---------- TESTING on Dancer 1 : $$i"; \
+ ${CPANM_DANCER1} -n --installdeps $$i && ${CPANM_DANCER1} --test-only $$i && pass_d1=1; \
+ echo " ---------- TESTING on Dancer 2 : $$i"; \
+ ${CPANM_DANCER2} -n --installdeps $$i && DANCER_FORCE_PLUGIN_REGISTRATION=1 ${CPANM_DANCER2} --test-only $$i && pass_d2=1; \
+ echo "$$i,$$pass_d1,$$pass_d2" >> result.csv; \
+ done;
+
+clean:
+ rm -rf plugins_list
+
+fullclean:
+ rm -rf ${PERLBREW_DIR}
+
+${PERLBREW_DIR}/bin/perlbrew:
+ @echo " - creating a local perlbrew"
+ export PERLBREW_ROOT=${PERLBREW_DIR} && curl -kL http://install.perlbrew.pl | bash
+
+${PERLBREW_DIR}/bin/cpanm:
+ ${PERLBREW} install-cpanm
+
+got_curl:
+ @which curl >/dev/null || ( echo "you don't have curl, please install it and retry" && false )
+
+got_bash:
+ @which bash >/dev/null || ( echo "you don't have bash, please install it and retry" && false )
+
+got_perlbrew_perl: ${PERLBREW_DIR}/bin/perlbrew ${PERLBREW_DIR}/bin/cpanm perlbrew_dancer1_plugin_tests perlbrew_dancer2_plugin_tests
+
+perlbrew_dancer1_plugin_tests:
+ ${PERLBREW} list | grep dancer1_plugin_tests > /dev/null || ( ${PERLBREW} install -j 2 -n perl-5.16.1 --as dancer1_plugin_tests )
+
+perlbrew_dancer2_plugin_tests:
+ ${PERLBREW} list | grep dancer2_plugin_tests > /dev/null || ( ${PERLBREW} install -j 2 -n perl-5.16.1 --as dancer2_plugin_tests && ${CPANM_DANCER2} ${HERE}/../.. )
+
+plugins_list:
+ ${HERE}/get_modules_list.pl > plugins_list
View
38 tools/plugins_auto_tests/get_modules_list.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/env perl
+
+use Modern::Perl;
+use Data::Dumper;
+use LWP::Simple;
+use FindBin qw($Bin);
+use ElasticSearch;
+
+my $es = ElasticSearch->new( servers => 'api.metacpan.org', no_refresh => 1 );
+
+my $scroller = $es->scrolled_search(
+ query => { match_all => { } },
+ search_type => 'scan',
+ scroll => '5m',
+ index => 'v0',
+ type => 'release',
+ size => 100,
+ filter => {
+ term => {
+ 'release.dependency.module' => 'Dancer'
+ }
+ },
+
+);
+
+my $result = $scroller->next;
+
+my %plugins;
+while ( my $result = $scroller->next ) {
+ $result->{_source}->{name} =~ /Dancer-Plugin/
+ or next;
+ my $name = $result->{_source}->{name};
+ $name =~ s/-\d.*//;
+ $name =~ s/-/::/g;
+ $plugins{$name} = 1;
+}
+say $_ foreach sort keys %plugins;
+

No commit comments for this range

Something went wrong with that request. Please try again.