Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DEVEL_COVER_USE_HARNESS_VAR to use HARNESS_PERL_SWITCHES not PERL5OPT #351

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohawk2
Copy link
Contributor

@mohawk2 mohawk2 commented Nov 18, 2024

PDL is changing its directory layout, especially moving its t directory into a subdirectory. Its CI uses local::lib, meaning its tests need to not lose its environment.

Together this creates a problem, where bin/cover is now setting PERL5OPT, which leads to coverage tests repeatedly saying:

  make[2]: Entering directory '/home/runner/work/pdl/pdl/Basic/IO-Misc'
  "/opt/hostedtoolcache/perl/5.30.3/x64/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Misc.bs ../../blib/arch/auto/PDL/IO/Misc/Misc.bs 644
  PERL_DL_NONLAZY=1 "/opt/hostedtoolcache/perl/5.30.3/x64/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, '../../blib/lib', '../../blib/arch')" t/*.t
  Can't locate Devel/Cover.pm in @INC (you may need to install the Devel::Cover module) (@INC contains: /opt/hostedtoolcache/perl/5.30.3/x64/lib/site_perl/5.30.3/x86_64-linux /opt/hostedtoolcache/perl/5.30.3/x64/lib/site_perl/5.30.3 /opt/hostedtoolcache/perl/5.30.3/x64/lib/5.30.3/x86_64-linux /opt/hostedtoolcache/perl/5.30.3/x64/lib/5.30.3 .).
  BEGIN failed--compilation aborted.
  t/misc.t .. ok
  All tests successful.
  Files=1, Tests=47,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.44 cusr  0.07 csys =  0.53 CPU)

I don't know why it continues and passes despite that, but it's clearly not right. This PR creates an environment variable that allows behaving as if there were a t directory. I'm happy to adjust it, and document it, but this makes it go from noise to not that.

This came to my attention because another layout-related change has suddenly made Devel::Cover start imposing boolean context, possibly in the context of //, which is a problem I've worked around in the past, but will investigate a bit more properly this time.

@mohawk2
Copy link
Contributor Author

mohawk2 commented Nov 18, 2024

@pjcj Actually - is there any benefit to picking which of those env vars to set? Is there any reason not to just always set both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant