diff options
author | Erik Wienhold <ewie@ewie.name> | 2023-09-05 19:45:54 +0200 |
---|---|---|
committer | David E. Wheeler <david@justatheory.com> | 2023-09-09 13:34:38 -0400 |
commit | 5724e0a5f35d5d9b7a545fdd4c12ec9f1c6a31fc (patch) | |
tree | ec33bb5ff5dbcd039830fbb2c897c94fde642c32 | |
parent | 257c8eb75bd7f809f76541b90a9a185cb3668332 (diff) |
Fix range of changes printed in deploy debug output
The debug output of deploy (added with commit 06daffc4) starts with
the currently deployed change or the last planned change if nothing
is deployed yet. Fix this by starting with the first change after
the current plan position.
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | lib/App/Sqitch/Engine.pm | 2 | ||||
-rwxr-xr-x | t/engine.t | 12 |
3 files changed, 15 insertions, 2 deletions
@@ -14,6 +14,9 @@ Revision history for Perl extension App::Sqitch - Fixed the output of the list of changes to be deployed or reverted to actually require `--verbose` twice, as described in the v1.4.0 changes, and not just once. Thanks to Erik Wienhold for the PR (#785)! + - Removed the duplicate change name from the output of the list of + changes to be deployed or reverted with `-VV`. Thanks to Erik Wienhold + for the PR (#787)! 1.4.0 2023-08-01T23:37:30Z - Fixed Snowflake warehouse and role setup to properly quote identifiers diff --git a/lib/App/Sqitch/Engine.pm b/lib/App/Sqitch/Engine.pm index af6c901a..0c04a316 100644 --- a/lib/App/Sqitch/Engine.pm +++ b/lib/App/Sqitch/Engine.pm @@ -270,7 +270,7 @@ sub deploy { ); $sqitch->debug(__ "Will deploy the following changes:"); - foreach my $will_deploy_position ($plan->position .. $to_index) { + foreach my $will_deploy_position (($plan->position + 1) .. $to_index) { $sqitch->debug($plan->change_at($will_deploy_position)->format_name_with_tags); } @@ -4,7 +4,7 @@ use strict; use warnings; use 5.010; use utf8; -use Test::More tests => 780; +use Test::More tests => 781; # use Test::More 'no_plan'; use App::Sqitch; use App::Sqitch::Plan; @@ -1169,6 +1169,7 @@ is_deeply +MockOutput->get_info, [ ], 'Should have emitted deploy announcement and successes'; # Make sure we can deploy everything by change. +MockOutput->clear; $latest_change_id = undef; $plan->reset; $plan->add( name => 'lolz', note => 'ha ha' ); @@ -1208,6 +1209,15 @@ is_deeply +MockOutput->get_info_literal, [ [' + lolz ..', '.........', ' '], ], 'Should have seen the output of the deploy to the end'; +is_deeply +MockOutput->get_debug, [ + [__ 'Will deploy the following changes:' ], + ['roles'], + ['users @alpha'], + ['widgets @beta'], + ['lolz'], +], 'Debug output should show what will be deployed'; + + # If we deploy again, it should be up-to-date. $latest_change_id = $changes[-1]->id; ok $engine->deploy, 'Should return success for deploy to up-to-date DB'; |