diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 5d4f14682..b4e79b2e2 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: perl -V - name: install dependencies from cpanfile.ci uses: perl-actions/install-with-cpm@v1 @@ -51,7 +51,7 @@ jobs: perl-versions: ${{ steps.action.outputs.perl-versions }} steps: - id: action - uses: perl-actions/perl-versions@v1 + uses: perl-actions/perl-versions@v2 with: since-perl: v5.10 with-devel: true @@ -77,7 +77,7 @@ jobs: container: perldocker/perl-tester:${{ matrix.perl-version }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: perl -V - name: Install Dependencies run: | diff --git a/lib/App/Yath/Options/Debug.pm b/lib/App/Yath/Options/Debug.pm index c41fd644e..dc36f92b9 100644 --- a/lib/App/Yath/Options/Debug.pm +++ b/lib/App/Yath/Options/Debug.pm @@ -168,12 +168,14 @@ sub _post_process_interactive { ${$settings->debug->vivify_field('fifo')} = $fifo; if ($settings->check_prefix('display')) { - $settings->display->field(quiet => 0); - $settings->display->field(verbose => 1) unless $settings->display->verbose; + my $display = $settings->display; + $display->field(quiet => 0) if $display->check_field('quiet'); + $display->field(verbose => 1) if $display->check_field('verbose') && !$display->verbose; } if ($settings->check_prefix('formatter')) { - $settings->formatter->field(qvf => 0); + my $formatter = $settings->formatter; + $formatter->field(qvf => 0) if $formatter->check_field('qvf'); } if ($settings->check_prefix('run')) { diff --git a/t/integration/failed.t b/t/integration/failed.t index c0c890325..e8d450665 100644 --- a/t/integration/failed.t +++ b/t/integration/failed.t @@ -34,6 +34,20 @@ yath( unlike($out->{output}, qr{pass\.tx}, "'pass.tx' was not seen as a failure when reading the log"); }, ); + + # GH #300: 'yath failed --interactive' should not crash with + # "The 'quiet' field does not exist" + $out = yath( + command => 'failed', + args => ['-i', $logfile], + exit => 0, + test => sub { + my $out = shift; + + ok(!$out->{exit}, "'failed -i' command exits true"); + unlike($out->{output}, qr{field does not exist}, "'failed -i' does not crash on missing display fields"); + }, + ); }, );