Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

GitHub perl-ci.yml

by Bod (Parson)
on Oct 12, 2023 at 23:36 UTC ( [id://11154935] : perlquestion . print w/replies, xml ) Need Help??

Bod has asked for the wisdom of the Perl Monks concerning the following question:

Whilst attempting to test a previous module, pryrt very helpfully introduced me to GitHub Continuous Integration.

I tried using this when I released WWW::Crawl and got lots of test configurations to pass, but others failed. When the tests ran again, different configurations passed and different configurations failed!

From this test run it seems much of the problem is from the $VERSION string. But this inconsistency is not reflected in the CPAN Testers results.

Is this an anomaly of GitHub Continuous Integration or have I got something wrong in the per-ci.yml file?

Replies are listed 'Best First'.
Re: GitHub perl-ci.yml
by SankoR (Prior) on Oct 13, 2023 at 12:31 UTC
    I wouldn't bother with such ancient perls but your tests on 5.10 and 5.10.1 fail because your code is looking for a newer version of Test::More than the version installed. Your failing tests on 5.14, 5.16, and 5.18 are all failures to find HTTP::Tiny 0.083 or better. Your module itself fails to load so $WWW::Crawl::VERSION is never defined.

    I haven't used ExtUtils::MakeMaker since the days of Module::Build and perl 5.10 but there should be support for a cpanfile to manage these prerequisites by now. If you're new, I would suggest you switch to Module::Build/Module::Build::Tiny and Minilla to manage it all. Some of your author tests are automatically generated and run by Minilla instead of stashing them in the dist itself. Minilla would have also generated your missing LICENSE file. Could also generate a README.md based on your pod, tidy the code and pod, run spellcheck, make sure your version number is updated before release, tag the releases in git, etc. Really speeds up the entire process of managing a small distribution.

    Before your next release, don't forget to add a LICENSE, delete the misplaced test /01-html.t in the base directory, and fix the typo on line 170 of /lib/WWW/Crawl.pm (itial => initial). :)

      Before your next release, don't forget to add a LICENSE, delete the misplaced test /01-html.t in the base directory, and fix the typo on line 170 of /lib/WWW/Crawl.pm (itial => initial). :)

      Done!
      Thanks...

      Although I've deleted /01-html.t, it still shows :S

        Try git rm then commit and push.

        Not that you asked, but I'd suggest git gui or another 3rd party gui for better control of your repo. Remembering how to use even git's basic features from the terminal is trickier than it seems.

Re: GitHub perl-ci.yml
by stevieb (Canon) on Oct 13, 2023 at 06:31 UTC

    I don't know the problem, but after an exceptionally cursory review, remove this line:

    $VERSION = eval $VERSION;

    See if the issue goes away. If not, report back and we'll look far more closely.

      That's certainly worth a try.

      FWIW, this line was discussed extensively earlier in the year. I remain unconvinced of the benefits but if there are any I would still favour Haarg's solution instead.


      🦛

      ...after an exceptionally cursory review, remove this line:

      The 'offending' line has been commented out and I am still getting failures for just v5.14, v5.16, v5.18 but v5.12 and v5.20 and above pass!

Re: GitHub perl-ci.yml
by pryrt (Abbot) on Oct 16, 2023 at 19:31 UTC
    Bod,

    I have found that occasionally in the CI environments (both in GitHub Actions, and in Appveyor and the old free Travis-CI) that sometimes your prereqs don't get properly honored/installed with just the cpanm --installdeps . despite the fact that your Makefile.PL properly says it requires HTTP::Tiny 0.083 or newer.

    In those cases, I tend to insert the task to manually install/upgrade ExtUtils::MakeMaker (EUMM), and sometimes other modules. Hence the step in the perl-ci.yml that you got from me:

    - name: Pre-Makefile.PL prereqs for older perls if: ${{ matrix.perl < '5.14' }} run: | cpanm --notest ExtUtils::MakeMaker

    For your case, since there was a problem with most perls before 5.20, but wasn't present on v5.14 (which already ran that upgrade of EUMM), I thought EUMM might be the culprit. And since the error you were getting was indicating that HTTP::Tiny was an ancient version, I added that to the step to make sure it manually installs 0.083 or newer. This Ubuntu+5.14 run indicates that EUMM was upgraded from 6.57_05 to the current 7.70, and HTTP::Tiny from 0.012 to 0.088. EUMM 6.57_05 is old enough that it's not using all your Makefile.PL features, so there may be something about that older EUMM that's also not properly checking the version during the prerequisite check. )

    Changing the perl version to force EUMM upgrade, and adding HTTP::Tiny to it, and renaming the step gives the updated step:

    - name: Grab EUMM and HTTP::Tiny 0.083 or newer _before_ running + Makefile.PL for older perls if: ${{ matrix.perl < '5.20' }} run: | cpanm --notest ExtUtils::MakeMaker cpanm HTTP::Tiny~0.083

    I suggest replacing that in your copy of perl-ci.yml as well. You can see the state of my copy of WWW-Crawl's perl-ci.yml for these runs... With that, the results show that all but Perl v5.18 on Windows are passing now.

    (That single 5.18 fail here appears to be something different, and will have to be debugged separately.)

    So to sum up: whenever I have a problem in my CI where it works for my local tests on a group of versions, but when it goes to GitHub Actions or other CI it doesn't work right, especially if there's an error related to a module not having the right version, I first go toward trying to force the CI to use the newest EUMM, and second, I possibly try manually installing stubborn prerequisite modules before the bulk of the prereq installation.

    (Since I was the one who helped you with the initial perl-ci.yml, I was a bit embarrassed that it didn't work straightaway for you on this project. Unfortunately, my weekend was swamped, so I didn't get a chance to fork your repo and run experiments until today... Sorry.)

    BTW: davorg's TPRC2023 "GitHub Actions for Perl Development" recording may be of interest to you. (In fact, starting around 12:30, it actually shows a pair of steps that would be able to save the logs from the windows+v5.18 failure above -- so that could help you with debugging that problem. (I suggest a branch where your CI just runs Windows and 5.18, rather than all, for quicker debugging of the issue; and changing push: branches: ['main'] to push: branches: '*' so that you can get CI on your debug branches as well. I need to add those two steps to my configs as well, as they will definitely help me with my future debugging.)

      Since I was the one who helped you with the initial perl-ci.yml, I was a bit embarrassed that it didn't work straightaway for you on this project. Unfortunately, my weekend was swamped, so I didn't get a chance to fork your repo and run experiments until today... Sorry

      No need to be sorry or embarrassed...
      I wouldn't have got this far without you previously pointing me in the right direction. I'm very grateful for that.

      I'm acutely aware that there is a huge amount that I don't know and thankful for every bit of enlightenment I get from others.

      I don't have time and opportunity to always check these things in timely fashion so don't worry about delays.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11154935]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-02-22 03:40 GMT
Voting Booth?
My favourite way to spend a leap day ...











Results (22 votes). Check out past polls.