tokuhirom / Minilla

Authorizing tool for CPAN modules
https://metacpan.org/release/Minilla
Other
98 stars 65 forks source link

GIT_AUTHOR_NAME may disturb t/project/contributors.t #187

Closed eserte closed 8 years ago

eserte commented 8 years ago

If the GIT_AUTHOR_NAME environment variable is set, then t/projects/contributors.t fails on some systems:

$ env GIT_AUTHOR_NAME="Slaven Rezic" perl5.14.4 -Mblib t/project/contributors.t
...
    not ok 1
    #   Failed test at t/project/contributors.t line 51.
    #     Structures begin differing at:
    #          $got->[0] = 'Slaven Rezic <foo@example.com>'
    #     $expected->[0] = 'Foo <foo@example.com>'
    not ok 2
    #   Failed test at t/project/contributors.t line 57.
    #     Structures begin differing at:
    #          $got->[0] = 'Slaven Rezic <foo@example.com>'
    #     $expected->[0] = 'Foo <foo@example.com>'
    1..2
    # Looks like you failed 2 tests of 2.
not ok 1 - develop deps
#   Failed test 'develop deps'
#   at t/project/contributors.t line 62.
1..1
# Looks like you failed 1 test of 1.

It fails differently if this environment variable is set to the empty string:

...
fatal: empty ident  <tokuhirom@example.com> not allowed
Giving up.
Minilla::Error::CommandExit at /tmpfs/.cpan-build-cpansand/2016032121/Minilla-v3.0.1-FTcY4y/blib/lib/Minilla/Logger.pm line 56, <DATA> line 258.
        Minilla::Logger::errorf("Giving up.\x{a}") called at /tmpfs/.cpan-build-cpansand/2016032121/Minilla-v3.0.1-FTcY4y/blib/lib/Minilla/Util.pm line 159
        Minilla::Util::cmd("git", "commit", "-m", "initial import") called at /tmpfs/.cpan-build-cpansand/2016032121/Minilla-v3.0.1-FTcY4y/blib/lib/Minilla/Git.pm line 29
        Minilla::Git::git_commit("-m", "initial import") called at t/project/contributors.t line 34
        main::__ANON__() called at /opt/perl-5.14.4/lib/site_perl/5.14.4/Test/Builder.pm line 261
        Test::Builder::__ANON__() called at /opt/perl-5.14.4/lib/site_perl/5.14.4/Test/Builder.pm line 266
        eval {...} called at /opt/perl-5.14.4/lib/site_perl/5.14.4/Test/Builder.pm line 266
        Test::Builder::subtest(Test::Builder=HASH(0x12aad58), "develop deps", CODE(0x12ce6f8)) called at /opt/perl-5.14.4/lib/site_perl/5.14.4/Test/More.pm line 771
        Test::More::subtest("develop deps", CODE(0x12ce6f8)) called at t/project/contributors.t line 62
    # Child (develop deps) exited without calling finalize()
not ok 1 - develop deps
#   Failed test 'develop deps'
#   at /opt/perl-5.14.4/lib/site_perl/5.14.4/Test/Builder.pm line 279.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 25 just after 1.

Only unsetting GIT_AUTHOR_NAME helps here.

eserte commented 8 years ago

Also failing: t/work_dir/release_test.t:

    #   Failed test at t/work_dir/release_test.t line 51.
    #                   '{["Slaven","Rezic","Slaven","Rezic","tokuhirom"]}'
    #     doesn't match '(?^:Foo)'
    # {["Slaven","Rezic","Slaven","Rezic","tokuhirom"]}

    #   Failed test at t/work_dir/release_test.t line 52.
    #                   '{["Slaven","Rezic","Slaven","Rezic","tokuhirom"]}'
    #     doesn't match '(?^:Bar)'
    # Looks like you failed 2 tests of 4.

#   Failed test 'Contributors are included in stopwords'
#   at t/work_dir/release_test.t line 53.
# Looks like you failed 1 test of 1.
t/work_dir/release_test.t .................... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests