Skip to content

Commit

Permalink
Stop tests from failing on machines which don't have Parallel::ForkMa…
Browse files Browse the repository at this point in the history
…nager,

which fails its own tests on at least some Solaris machines.
  • Loading branch information
DrHyde committed Dec 11, 2023
1 parent 46f3b3e commit 052c57f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/linux-without-parallel-forkmanager.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion t/fork.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 052c57f

Please sign in to comment.