szabgab / CPAN-Digger

CPAN Digger to analyze CPAN modules and other Perl-based applications
https://cpan-digger.perlmaven.com/
7 stars 3 forks source link

Undeclared dependencies? #11

Closed eserte closed 3 years ago

eserte commented 3 years ago

The test suite seems to fail if some prereqs are not installed:

Log excerpts:

PERL_DL_NONLAZY=1 "/usr/local/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t

    #   Failed test at t/00-test.t line 15.
    #          got: '512'
    #     expected: '0'

    #   Failed test at t/00-test.t line 16.
    #          got: 'Can't locate Path/Tiny.pm in @INC (you may need to install the Path::Tiny module) (@INC contains: ...  .) at lib/CPAN/Digger/DB.pm line 9.
    # BEGIN failed--compilation aborted at lib/CPAN/Digger/DB.pm line 9.
    # Compilation failed in require at lib/CPAN/Digger.pm line 19.
    # BEGIN failed--compilation aborted at lib/CPAN/Digger.pm line 19.
    # Compilation failed in require at lib/CPAN/Digger/CLI.pm line 9.
    # BEGIN failed--compilation aborted at lib/CPAN/Digger/CLI.pm line 9.
    # Compilation failed in require at bin/cpan-digger line 2.
    # BEGIN failed--compilation aborted at bin/cpan-digger line 2.
    # '
    #     expected: ''
    # Looks like you failed 2 tests of 3.

#   Failed test 'recent_in_memory'
#   at t/00-test.t line 18.

    #   Failed test at t/00-test.t line 25.
... (etc) ...
Can't locate Test/Version.pm in @INC (you may need to install the Test::Version module) (@INC contains: ...  .) at t/100-version.t line 14.
BEGIN failed--compilation aborted at t/100-version.t line 14.
t/100-version.t .. 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
szabgab commented 3 years ago

Thanks for reporting.

It is strange that the GitHub CI system did not report the missing Path::Tiny as it is needed by the code. Fixed now.

However I don't know where should I declare the need for Test::Version as that is only needed in RELEASE_TESTING. Should it be in the TEST_REQUIRES section of Makefile.PL or is there a separate section for it? Or is the best practice to only check for its availability in the test file? t/100-version.t ?

eserte commented 3 years ago

I think it's fine to check the availability in the test script and skip the test if it's missing.

szabgab commented 3 years ago

Hopefully I fixed it in version 1.02 I've just uploaded. Thanks for reporting.