From: Peter Rabbitson Date: Tue, 3 Nov 2015 17:35:03 +0000 (+0100) Subject: (travis) Do not run the git authorship check within a github PR X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=606ff399fbfb4ece89effeab2bc0ef23716b9e6b;p=dbsrgits%2FDBIx-Class.git (travis) Do not run the git authorship check within a github PR Before running the CI test github "helpfully" generates a merge-commit, which uses the email as listed in the github profile, NOT using the email/name as seen on the merged commit itself. This can cause the entire thing to fail for no apparent reason Since any PR is scrutinized and tested to bits after the fact - skipping the test is safe Read under -w --- diff --git a/xt/dist/authors.t b/xt/dist/authors.t index e5bc2cd..8ee1bf3 100644 --- a/xt/dist/authors.t +++ b/xt/dist/authors.t @@ -58,16 +58,29 @@ if (length $ENV{PATH}) { ) =~ /\A(.+)\z/; } -# this may fail - not every system has git -if (my @git_authors = map - { my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname } - qx( git shortlog -e -s ) +# no git-check when smoking a PR +if ( + ( + ! $ENV{TRAVIS_PULL_REQUEST} + or + $ENV{TRAVIS_PULL_REQUEST} eq "false" + ) + and + -d '.git' ) { - for (@git_authors) { + + binmode (Test::More->builder->$_, ':utf8') for qw/output failure_output todo_output/; + + # this may fail - not every system has git + for ( + map + { my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname } + qx( git shortlog -e -s ) + ) { my ($eml) = $_ =~ $email_re; - fail "Commit author '$_' (from git) not reflected in AUTHORS, perhaps a missing .mailmap entry?" - unless $known_authors{$eml}; + ok $known_authors{$eml}, + "Commit author '$_' (from .mailmap-aware `git shortlog -e -s`) reflected in ./AUTHORS"; } }