Skip to content

Commit 6fc9790

Browse files
committed
Don't unmock till done testing $@; fix tests
It seems like a recent change caused `$mock_engine->unmock('run_verify')` to reset `$@`, causing the tests that followed it to fail. Move the unmock call to after the `$@`-using tests.` Thanks @eserte for the report (resolves #921). Also update the test workflows for changes to recent release of `cpm`. Change them to use the new argument `--top-level-phase configure,build,test,runtime`; otherwise `cpm` defaults to installing development modules, too (see skaji/cpm#310). Also work around `cpm` and related modules dropping support for Perl versions prior to 5.24 by installing the last versions to support Perl 5.22 and earlier in the "🧅 Perl" workflow (see shogo82148/actions-setup-perl#2662). This requires using a variable for the `cpm` arguments to support both versions, and requires a further workaround on Perl 5.16 and earlier. And cease testing Perls before 5.24 on Windows, where things just don't work well at all. Update the CockroachDB versions to include 26.2 and drop 21 and 22, as their DockerHub images have been deleted. Work around a test failure on 26.2 returning a `NOTICE` as an error for some reason, too.
1 parent 0ab857e commit 6fc9790

20 files changed

Lines changed: 80 additions & 46 deletions

.github/workflows/clickhouse.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
with:
3838
path: local
3939
key: perl-${{ steps.perl.outputs.perl-hash }}
40-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
41-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::ODBC
40+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
41+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::ODBC
4242
- name: prove
4343
env:
4444
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/cockroach.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ on:
99
jobs:
1010
Cockroach:
1111
strategy:
12+
fail-fast: false
1213
matrix:
1314
# curl https://registry.hub.docker.com/v2/repositories/cockroachdb/cockroach/tags\?page_size\=10000 | jq '.results[].name'
14-
version: ['25.4', '24.3', '23.2', '22.2', '21.2']
15+
version: ['26.2', '25.4', '24.3', '23.2']
1516
name: 🪳 Cockroach ${{ matrix.version }}
1617
runs-on: ubuntu-latest
1718
steps:
@@ -27,8 +28,8 @@ jobs:
2728
with:
2829
path: local
2930
key: perl-${{ steps.perl.outputs.perl-hash }}
30-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
31-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::Pg
31+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
32+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::Pg
3233
- name: prove
3334
env:
3435
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ jobs:
8686
.github/ubuntu/pg.sh
8787
.github/ubuntu/snowflake.sh
8888
.github/ubuntu/vertica.sh
89-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
90-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBI DBD::ODBC DBD::Firebird DBD::Oracle DBD::MariaDB DBD::Pg Devel::Cover Devel::Cover::Report::Coveralls
89+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
90+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBI DBD::ODBC DBD::Firebird DBD::Oracle DBD::MariaDB DBD::Pg Devel::Cover Devel::Cover::Report::Coveralls
9191
- name: Run Tests
9292
env:
9393
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/exasol.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
with:
3232
path: local
3333
key: perl-${{ steps.perl.outputs.perl-hash }}
34-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
35-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::ODBC
34+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
35+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::ODBC
3636
- name: prove
3737
env:
3838
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/firebird.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
with:
4343
path: local
4444
key: perl-${{ steps.perl.outputs.perl-hash }}
45-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
46-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::Firebird
45+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
46+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::Firebird
4747
- name: prove
4848
env:
4949
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/maria.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
path: local
3838
key: perl-${{ steps.perl.outputs.perl-hash }}
39-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
40-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::MariaDB
39+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
40+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::MariaDB
4141
- name: prove
4242
env:
4343
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/mysql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
path: local
3838
key: perl-${{ steps.perl.outputs.perl-hash }}
39-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
40-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::MariaDB
39+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
40+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::MariaDB
4141
- name: prove
4242
env:
4343
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/oracle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151
with:
5252
path: local
5353
key: perl-${{ steps.perl.outputs.perl-hash }}
54-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
55-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::Oracle
54+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
55+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends DBD::Oracle
5656
- name: prove
5757
env:
5858
PERL5LIB: "${{ github.workspace }}/local/lib/perl5"

.github/workflows/os.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
with:
3434
path: local
3535
key: perl-${{ steps.perl.outputs.perl-hash }}
36-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends ExtUtils::MakeMaker List::MoreUtils::XS
36+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends ExtUtils::MakeMaker List::MoreUtils::XS
3737
- if: runner.os == 'Windows'
38-
run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends Encode Win32::Console::ANSI Win32API::Net Win32::Locale Win32::ShellQuote DateTime::TimeZone::Local::Win32
39-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
40-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends Test::Spelling Test::Pod Test::Pod::Coverage
38+
run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends Encode Win32::Console::ANSI Win32API::Net Win32::Locale Win32::ShellQuote DateTime::TimeZone::Local::Win32
39+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends --cpanfile dist/cpanfile
40+
- run: cpm install --top-level-phase configure,build,test,runtime --verbose --show-build-log-on-failure --no-test --top-level-relationship requires,recommends Test::Spelling Test::Pod Test::Pod::Coverage
4141
- name: prove
4242
env: { PERL5LIB: "${{ github.workspace }}/local/lib/perl5" }
4343
run: prove -lrj4

.github/workflows/perl.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,27 @@ on:
1010
jobs:
1111
Perl:
1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
os: [[🐧, ubuntu], [🍎, macos], [🪟, windows]]
1516
perl: [ '5.42', '5.40', '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.26', '5.24', '5.22', '5.20', '5.18', '5.16', '5.14', '5.12' ]
1617
exclude:
17-
- { os: [🪟, windows], perl: '5.12' } # https://github.com/shogo82148/actions-setup-perl/issues/876
18-
- { os: [🪟, windows], perl: '5.14' } # https://github.com/shogo82148/actions-setup-perl/issues/881
19-
- { os: [🪟, windows], perl: '5.22' } # https://github.com/shogo82148/actions-setup-perl/issues/2310
20-
- { os: [🪟, windows], perl: '5.24' } # https://github.com/shogo82148/actions-setup-perl/issues/2310
18+
- { os: [🪟, windows], perl: '5.12' } # cpm too much a PITA && https://github.com/shogo82148/actions-setup-perl/issues/876
19+
- { os: [🪟, windows], perl: '5.14' } # cpm too much a PITA && https://github.com/shogo82148/actions-setup-perl/issues/881
20+
- { os: [🪟, windows], perl: '5.16' } # cpm too much a PITA
21+
- { os: [🪟, windows], perl: '5.18' } # cpm too much a PITA
22+
- { os: [🪟, windows], perl: '5.20' } # cpm too much a PITA
23+
- { os: [🪟, windows], perl: '5.22' } # cpm too much a PITA && https://github.com/shogo82148/actions-setup-perl/issues/2310
24+
- { os: [🪟, windows], perl: '5.24' } # cpm too much a PITA && https://github.com/shogo82148/actions-setup-perl/issues/2310
2125
- { os: [🪟, windows], perl: '5.40' } # https://github.com/shogo82148/actions-setup-perl/issues/2310
2226
- { os: [🪟, windows], perl: '5.42' } # https://github.com/shogo82148/actions-setup-perl/issues/2310
27+
- { os: [🪟, windows], perl: '5.26' } # https://github.com/shogo82148/actions-setup-perl/issues/2669
28+
- { os: [🪟, windows], perl: '5.28' } # https://github.com/shogo82148/actions-setup-perl/issues/2669
2329
name: 🧅 Perl ${{ matrix.perl }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }}
2430
runs-on: ${{ matrix.os[1] }}-latest
31+
env:
32+
# Set args for cpm depending on the Perl version.
33+
CPM_ARGS: --verbose --show-build-log-on-failure --no-test ${{ matrix.perl < 5.24 && '--no-test --with-recommends' || '--top-level-phase configure,build,test,runtime --top-level-relationship requires,recommends' }}
2534
steps:
2635
- uses: actions/checkout@v4
2736
- name: Setup Perl
@@ -37,10 +46,22 @@ jobs:
3746
with:
3847
path: local
3948
key: perl-${{ steps.perl.outputs.perl-hash }}
49+
- if: matrix.perl < 5.24
50+
# Newer SKAJI modules require 5.24; install older versions to compensate.
51+
run: |
52+
cpanm install --verbose --notest --no-man-pages Module::Build::Tiny Module::cpmfile@0.006 Darwin::InitObjC@0.001 Parallel::Pipes::App@0.201 Command::Runner@0.201 Proc::ForkSafe@0.001 CPAN::02Packages::Search@0.100 App::cpm@0.998003
53+
perl -E 'use Config; say $Config{sitebin}' >> "${{ github.path }}"
54+
- if: matrix.perl < 5.18
55+
# cpanm fails to install the cpm script above, but a manual install works.
56+
working-directory: ${{ runner.temp }}
57+
run: |
58+
curl -O https://cpan.metacpan.org/authors/id/S/SK/SKAJI/App-cpm-0.998003.tar.gz
59+
tar zxf App-cpm-0.998003.tar.gz && cd App-cpm-0.998003
60+
perl Build.PL && ./Build && ./Build install
4061
- if: runner.os == 'Windows'
41-
run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends Encode Win32::Console::ANSI Win32API::Net Win32::Locale Win32::ShellQuote DateTime::TimeZone::Local::Win32
42-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile dist/cpanfile
43-
- run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends Test::Spelling Test::Pod Test::Pod::Coverage
62+
run: cpm install ${{ env.CPM_ARGS }} Encode Win32::Console::ANSI Win32API::Net Win32::Locale Win32::ShellQuote DateTime::TimeZone::Local::Win32
63+
- run: cpm install ${{ env.CPM_ARGS }} --cpanfile dist/cpanfile
64+
- run: cpm install ${{ env.CPM_ARGS }} Test::Spelling Test::Pod Test::Pod::Coverage
4465
- name: prove
4566
env: { PERL5LIB: "${{ github.workspace }}/local/lib/perl5" }
4667
run: prove -lrj4

0 commit comments

Comments
 (0)