From 052c57f92d241deade4495356a85ac49564e4d02 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Mon, 11 Dec 2023 19:22:09 +0000 Subject: [PATCH] Stop tests from failing on machines which don't have Parallel::ForkManager, which fails its own tests on at least some Solaris machines. --- .../linux-without-parallel-forkmanager.yml | 29 +++++++++++++++++++ CHANGELOG | 5 ++++ t/fork.t | 4 ++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linux-without-parallel-forkmanager.yml diff --git a/.github/workflows/linux-without-parallel-forkmanager.yml b/.github/workflows/linux-without-parallel-forkmanager.yml new file mode 100644 index 00000000..e3095d2f --- /dev/null +++ b/.github/workflows/linux-without-parallel-forkmanager.yml @@ -0,0 +1,29 @@ +on: [push, pull_request] +name: Linux (build without Parallel::ForkManager) + +jobs: + + build: + runs-on: 'ubuntu-latest' + name: Perl 5.32 build without Parallel::ForkManager + steps: + - name: check out code + uses: actions/checkout@v4 + + - name: switch to perl 5.32 + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: 5.32 + + - name: run tests + env: + BUILD_TEST: 1 + PERL_USE_UNSAFE_INC: 0 + run: | + perl -v + cpanm --quiet --notest ExtUtils::MakeMaker Test::Pod Test::Pod::Coverage parent + cpanm --quiet --notest Data::Dumper::Concise File::ShareDir::Install XML::XPath Data::CompactReadonly File::Find::Rule Spreadsheet::XLSX Text::CSV_XS LWP::Protocol::https + cpanm --quiet --notest --installdeps . + ./build-data.sh + perl Makefile.PL + PERL5OPT=-MDevel::Hide=Parallel::ForkManager make test TEST_VERBOSE=1 diff --git a/CHANGELOG b/CHANGELOG index 2dd59d14..abea6832 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +X.XXXX XXXX-XX-XX + +- Tests are now forgiving of a missing Parallel::ForkManager + (which isn't available on some Solaris machines) + 4.0001 2023-12-10 - Clarification in doco re supported perl versions diff --git a/t/fork.t b/t/fork.t index 8060a149..6a82c17b 100644 --- a/t/fork.t +++ b/t/fork.t @@ -10,11 +10,13 @@ use Test::More; use Number::Phone::NANP; -use Parallel::ForkManager; +eval "use Parallel::ForkManager"; SKIP: { skip "fork() isn't supported properly on Windows", 3 if(os_is("MicrosoftWindows")); + skip "Parallel::ForkManager needed for these tests", 3 + unless($INC{'Parallel/ForkManager.pm'}); my $forker = Parallel::ForkManager->new(1); my $returned_from_child;