in reply to Re^10: Creating coverage big report
in thread Creating coverage big report

At this point, I can only speculate that you have different versions of Devel::Cover installed with the different versions of perl and that those different versions of Devel::Cover have incompatible databases. Fixing this will require running independent tests with each perl version and generating separate reports, which is probably a good idea anyway — coverage under one version of perl does not guarantee that the same code will work correctly under other versions, so it should be accounted separately in any case.

Replies are listed 'Best First'.
Re^12: Creating coverage big report
by ovedpo15 (Pilgrim) on Oct 09, 2019 at 23:14 UTC
    I tried to create a small test and check where the problem is coming from.
    setenv DEVEL_COVER_DB_FORMAT JSON setenv PERL5OPT "-MDevel::Cover=+ignore,/cov/,/data/,-silent,1,-summar +y,0,+select,project/" ./script.pl unsetenv PERL5OPT /usr/pkgs/perl/5.14.1/bin/cover
    The script looks like:
    #!/usr/pkgs/perl/5.14.1/bin/perl use strict; use warnings; my $cmd = "/project/bin/create_d.pl --data abc system($cmd); print("Done"); exit(0);
    I unset PERL5OPT because if not and I run the cover script it fails with:
    /usr/pkgs/perl/5.14.1/bin/cover shouldn't be run with coverage turned +on.
    Anyway, after unsetting PERL5OPT I run the cover script and get:
    Reading database from /play_ground/cov/cover_db found cover.13 in /play_ground/cov/cover_db/runs/1570662588.11726.0385 +0 at /usr/pkgs/perl/5.14.1/lib64/module/r3/x86_64-linux/Devel/Cover/D +B.pm line 203. Devel::Cover: /play_ground/cov/cover_db/runs/1570662588.11726.03850 is + an invalid database found cover.13 in /play_ground/cov/cover_db/runs/1570662590.11725.0717 +0 at /usr/pkgs/perl/5.14.1/lib64/module/r3/x86_64-linux/Devel/Cover/D +B.pm line 203. Devel::Cover: /play_ground/cov/cover_db/runs/1570662590.11725.07170 is + an invalid database ---------------------------------------------------------------------- +------- File ---------------------------------------------------------------------- +------- Total ---------------------------------------------------------------------- +------- HTML output written to /play_ground/cov/cover_db/coverage.html done.
    I use only one version and that is 5.14.1 - both in coverage, script's shabeng and all of the project's scripts. So I does not seems to be a version issue. Any ideas what it also could be?

      You may have some kind of strange filesystem problem — how are your filenames flipping between /play_ground/cov/... and /apollo_dev/apollo_tests/play_ground/cov/...?

      You have broken something or you are tickling a bug in Devel::Cover. The first suggestion I have is to remove all of the options and set PERL5OPT to exactly "-MDevel::Cover". You may be specifying options such that Devel::Cover ends up not actually including anything and producing an invalid database.

      And until you get this sorted out, remember to delete the coverage database after each change, so we do not have an old coverage database hanging around to give us bad data.