From ba60f4f445abc90e7ad86b8a9ff0764c8e6b2cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Mon, 16 Sep 2024 17:50:57 +0200 Subject: [PATCH 1/3] Revert PR #12 Revert the temporary fix in PR #12 as the temporary fix may not be needed after Test::Vars has been updated. --- .github/workflows/dzil-build-and-test.yml | 3 ++ t/app-perlvars.t | 20 ++------- t/perlvars.t | 49 ++++++++--------------- 3 files changed, 22 insertions(+), 50 deletions(-) diff --git a/.github/workflows/dzil-build-and-test.yml b/.github/workflows/dzil-build-and-test.yml index 1ffdc67..8c04a6b 100644 --- a/.github/workflows/dzil-build-and-test.yml +++ b/.github/workflows/dzil-build-and-test.yml @@ -64,6 +64,7 @@ jobs: - "5.34" - "5.36" - "5.38" + - "5.40" name: perl ${{ matrix.perl-version }} on ${{ matrix.os }} steps: - name: set up perl @@ -104,6 +105,7 @@ jobs: - "5.34" - "5.36" - "5.38" + - "5.40" name: perl ${{ matrix.perl-version }} on ${{ matrix.os }} steps: - name: set up perl @@ -143,6 +145,7 @@ jobs: - "5.32" - "5.36" - "5.38" + - "5.40" name: perl ${{ matrix.perl-version }} on ${{ matrix.os }} steps: - name: set up perl diff --git a/t/app-perlvars.t b/t/app-perlvars.t index 121c6a7..12bc29c 100644 --- a/t/app-perlvars.t +++ b/t/app-perlvars.t @@ -6,33 +6,19 @@ use lib 'test-data/lib'; use App::perlvars (); use Test::More import => [qw( done_testing is ok subtest )]; -# For perl version 5.37.3 there was a change in the Perl internals such that -# some variables are no longer considered unused by Test::Vars. This is a known issue, see -# https://github.com/houseabsolute/p5-Test-Vars/issues/47 -# Until this is resolved, we need to adjust the expected number of errors depending on -# the Perl version. -my $perl_old = $] <= 5.037002; - subtest 'pkg with unused vars' => sub { my ( $exit_code, $msg, @errors ) = App::perlvars->new->validate_file('test-data/lib/Local/Unused.pm'); ok( $exit_code, 'non-zero exit code' ); - my $expected = $perl_old ? 4 : 5; - is( scalar @errors, $expected, 'found all errors' ); + is( scalar @errors, 4, 'found all errors' ); }; subtest 'pkg without unused vars' => sub { my ( $exit_code, $msg, @errors ) = App::perlvars->new->validate_file( 'test-data/lib/Local/NoUnused.pm'); - if ($perl_old) { - is( $exit_code, 0, '0 exit code' ); - is( scalar @errors, 0, 'found no errors' ); - } - else { - is( $exit_code, 256, 'exit code 256' ); - is( scalar @errors, 1, 'found 1 error' ); - } + is( $exit_code, 0, '0 exit code' ); + is( scalar @errors, 0, 'found no errors' ); }; subtest 'file not found' => sub { diff --git a/t/perlvars.t b/t/perlvars.t index 6192274..e25fb78 100644 --- a/t/perlvars.t +++ b/t/perlvars.t @@ -11,13 +11,6 @@ use Test::Script qw( script_stderr_like ); -# For perl version 5.37.3 there was a change in the Perl internals such that -# some variables are no longer considered unused by Test::Vars. This is a known issue, see -# https://github.com/houseabsolute/p5-Test-Vars/issues/47 -# Until this is resolved, we need to adjust the expected number of errors depending on -# the Perl version. -my $perl_old = $] <= 5.037002; - script_compiles('script/perlvars'); subtest 'file not found' => sub { @@ -46,40 +39,30 @@ subtest 'arg is a dir' => sub { }; subtest 'ignore file is used' => sub { - my @script = ( - 'script/perlvars', '--ignore-file', - 'test-data/ignore-file', 'test-data/lib/Local/Unused.pm', + script_runs( + [ + 'script/perlvars', + '--ignore-file', 'test-data/ignore-file', + 'test-data/lib/Local/Unused.pm' + ] ); - if ($perl_old) { - script_runs( \@script ); - } - else { - script_fails( \@script, { exit => 255 } ); - } }; subtest 'file has no errors' => sub { - my @script = ( 'script/perlvars', 'test-data/lib/Local/NoUnused.pm', ); - if ($perl_old) { - script_runs( \@script ); - } - else { - script_fails( \@script, { exit => 255 } ); - } + script_runs( + [ 'script/perlvars', 'test-data/lib/Local/NoUnused.pm' ], + ); }; subtest 'multiple files are checked' => sub { - my @script = ( - 'script/perlvars', '--ignore-file', - 'test-data/ignore-file', 'test-data/lib/Local/Unused.pm', - 'test-data/lib/Local/NoUnused.pm', + script_runs( + [ + 'script/perlvars', + '--ignore-file', 'test-data/ignore-file', + 'test-data/lib/Local/Unused.pm', + 'test-data/lib/Local/NoUnused.pm', + ] ); - if ($perl_old) { - script_runs( \@script ); - } - else { - script_fails( \@script, { exit => 255 } ); - } }; done_testing(); From fe65d34c4eb84e6e9a0b093f407d1aade1f63066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Mon, 16 Sep 2024 18:11:29 +0200 Subject: [PATCH 2/3] Bump Test::Vars version Bump minimum version of Test::Vars to 0.017 --- META.json | 47 +++++++++++++++++++++++++++++------------------ Makefile.PL | 4 ++-- cpanfile | 2 +- dist.ini | 3 +++ 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/META.json b/META.json index dd88848..3b372ec 100644 --- a/META.json +++ b/META.json @@ -63,7 +63,7 @@ "PPI::Document" : "0", "Path::Tiny" : "0", "Pod::Usage" : "0", - "Test::Vars" : "0", + "Test::Vars" : "0.017", "autodie" : "0", "perl" : "v5.14.0", "strict" : "0", @@ -87,19 +87,19 @@ "release_status" : "stable", "resources" : { "bugtracker" : { - "web" : "https://github.com/perl-ide/App-perlvars/issues" + "web" : "https://github.com/hakonhagland/App-perlvars/issues" }, - "homepage" : "https://github.com/perl-ide/App-perlvars", + "homepage" : "https://github.com/hakonhagland/App-perlvars", "repository" : { "type" : "git", - "url" : "https://github.com/perl-ide/App-perlvars.git", - "web" : "https://github.com/perl-ide/App-perlvars" + "url" : "https://github.com/hakonhagland/App-perlvars.git", + "web" : "https://github.com/hakonhagland/App-perlvars" } }, - "version" : "0.000005", + "version" : "0.000006", "x_Dist_Zilla" : { "perl" : { - "version" : "5.034000" + "version" : "5.038001" }, "plugins" : [ { @@ -148,7 +148,7 @@ "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : "8" + "default_jobs" : 1 } }, "name" : "@Author::OALDERS/MakeMaker", @@ -325,7 +325,7 @@ "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : "8" + "default_jobs" : 1 } }, "name" : "@Author::OALDERS/RunExtraTests", @@ -505,7 +505,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.34.1", + "git_version" : "2.43.0", "repo_root" : "." } }, @@ -516,7 +516,7 @@ "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { - "git_version" : "2.34.1", + "git_version" : "2.43.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", @@ -524,7 +524,7 @@ } }, "name" : "@Author::OALDERS/Git::Contributors", - "version" : "0.037" + "version" : "0.036" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", @@ -636,7 +636,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.34.1", + "git_version" : "2.43.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -653,12 +653,12 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "v0.000005", + "tag" : "v0.000006", "tag_format" : "v%V", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.34.1", + "git_version" : "2.43.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -709,7 +709,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.34.1", + "git_version" : "2.43.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -729,7 +729,7 @@ "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.34.1", + "git_version" : "2.43.0", "repo_root" : "." } }, @@ -741,6 +741,17 @@ "name" : "GitHubREADME::Badge", "version" : "0.35" }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "runtime", + "type" : "requires" + } + }, + "name" : "Prereqs", + "version" : "6.031" + }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { @@ -816,7 +827,7 @@ "H\u00e5kon H\u00e6gland ", "Olaf Alders " ], - "x_generated_by_perl" : "v5.34.0", + "x_generated_by_perl" : "v5.38.1", "x_serialization_backend" : "Cpanel::JSON::XS version 4.37", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_static_install" : 1 diff --git a/Makefile.PL b/Makefile.PL index b63d4c6..97e2a26 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -25,7 +25,7 @@ my %WriteMakefileArgs = ( "PPI::Document" => 0, "Path::Tiny" => 0, "Pod::Usage" => 0, - "Test::Vars" => 0, + "Test::Vars" => "0.017", "autodie" => 0, "strict" => 0, "warnings" => 0 @@ -54,7 +54,7 @@ my %FallbackPrereqs = ( "Pod::Usage" => 0, "Test::More" => 0, "Test::Script" => "1.29", - "Test::Vars" => 0, + "Test::Vars" => "0.017", "autodie" => 0, "lib" => 0, "strict" => 0, diff --git a/cpanfile b/cpanfile index 405e326..45609dc 100644 --- a/cpanfile +++ b/cpanfile @@ -6,7 +6,7 @@ requires "Moo" => "0"; requires "PPI::Document" => "0"; requires "Path::Tiny" => "0"; requires "Pod::Usage" => "0"; -requires "Test::Vars" => "0"; +requires "Test::Vars" => "0.017"; requires "autodie" => "0"; requires "perl" => "v5.14.0"; requires "strict" => "0"; diff --git a/dist.ini b/dist.ini index 09fe87d..78d52e7 100644 --- a/dist.ini +++ b/dist.ini @@ -20,5 +20,8 @@ branch = main place = top phase = build +[Prereqs] +Test::Vars = 0.017 + [Prereqs / TestRequires] Test::Script = 1.29 From a41e9306ba98744a605faaedef7295e3cfe06100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Mon, 16 Sep 2024 18:22:15 +0200 Subject: [PATCH 3/3] Revert changes in previous commit --- META.json | 47 ++++++++++++++++++----------------------------- Makefile.PL | 4 ++-- dist.ini | 3 --- 3 files changed, 20 insertions(+), 34 deletions(-) diff --git a/META.json b/META.json index 3b372ec..dd88848 100644 --- a/META.json +++ b/META.json @@ -63,7 +63,7 @@ "PPI::Document" : "0", "Path::Tiny" : "0", "Pod::Usage" : "0", - "Test::Vars" : "0.017", + "Test::Vars" : "0", "autodie" : "0", "perl" : "v5.14.0", "strict" : "0", @@ -87,19 +87,19 @@ "release_status" : "stable", "resources" : { "bugtracker" : { - "web" : "https://github.com/hakonhagland/App-perlvars/issues" + "web" : "https://github.com/perl-ide/App-perlvars/issues" }, - "homepage" : "https://github.com/hakonhagland/App-perlvars", + "homepage" : "https://github.com/perl-ide/App-perlvars", "repository" : { "type" : "git", - "url" : "https://github.com/hakonhagland/App-perlvars.git", - "web" : "https://github.com/hakonhagland/App-perlvars" + "url" : "https://github.com/perl-ide/App-perlvars.git", + "web" : "https://github.com/perl-ide/App-perlvars" } }, - "version" : "0.000006", + "version" : "0.000005", "x_Dist_Zilla" : { "perl" : { - "version" : "5.038001" + "version" : "5.034000" }, "plugins" : [ { @@ -148,7 +148,7 @@ "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : 1 + "default_jobs" : "8" } }, "name" : "@Author::OALDERS/MakeMaker", @@ -325,7 +325,7 @@ "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { - "default_jobs" : 1 + "default_jobs" : "8" } }, "name" : "@Author::OALDERS/RunExtraTests", @@ -505,7 +505,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.43.0", + "git_version" : "2.34.1", "repo_root" : "." } }, @@ -516,7 +516,7 @@ "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { - "git_version" : "2.43.0", + "git_version" : "2.34.1", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", @@ -524,7 +524,7 @@ } }, "name" : "@Author::OALDERS/Git::Contributors", - "version" : "0.036" + "version" : "0.037" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", @@ -636,7 +636,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.43.0", + "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -653,12 +653,12 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "v0.000006", + "tag" : "v0.000005", "tag_format" : "v%V", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.43.0", + "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -709,7 +709,7 @@ "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.43.0", + "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { @@ -729,7 +729,7 @@ "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { - "git_version" : "2.43.0", + "git_version" : "2.34.1", "repo_root" : "." } }, @@ -741,17 +741,6 @@ "name" : "GitHubREADME::Badge", "version" : "0.35" }, - { - "class" : "Dist::Zilla::Plugin::Prereqs", - "config" : { - "Dist::Zilla::Plugin::Prereqs" : { - "phase" : "runtime", - "type" : "requires" - } - }, - "name" : "Prereqs", - "version" : "6.031" - }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { @@ -827,7 +816,7 @@ "H\u00e5kon H\u00e6gland ", "Olaf Alders " ], - "x_generated_by_perl" : "v5.38.1", + "x_generated_by_perl" : "v5.34.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.37", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_static_install" : 1 diff --git a/Makefile.PL b/Makefile.PL index 97e2a26..b63d4c6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -25,7 +25,7 @@ my %WriteMakefileArgs = ( "PPI::Document" => 0, "Path::Tiny" => 0, "Pod::Usage" => 0, - "Test::Vars" => "0.017", + "Test::Vars" => 0, "autodie" => 0, "strict" => 0, "warnings" => 0 @@ -54,7 +54,7 @@ my %FallbackPrereqs = ( "Pod::Usage" => 0, "Test::More" => 0, "Test::Script" => "1.29", - "Test::Vars" => "0.017", + "Test::Vars" => 0, "autodie" => 0, "lib" => 0, "strict" => 0, diff --git a/dist.ini b/dist.ini index 78d52e7..09fe87d 100644 --- a/dist.ini +++ b/dist.ini @@ -20,8 +20,5 @@ branch = main place = top phase = build -[Prereqs] -Test::Vars = 0.017 - [Prereqs / TestRequires] Test::Script = 1.29