diff options
author | James Fargher <jfargher@gitlab.com> | 2021-11-09 03:40:13 +0300 |
---|---|---|
committer | James Fargher <jfargher@gitlab.com> | 2021-11-16 06:34:47 +0300 |
commit | bf2a1d91eab5d2dbd8787dc55e5642c2efa9489d (patch) | |
tree | 77948f793e6e0a8cb44d86720d9fe4a654d3063e /cmd | |
parent | 5997ef7cc293c30d219de2dafa763a9c60b0bc43 (diff) |
backup: Collect summary of backup errors
Start collecting errors so that these can be summarised at the end of
the backup run. Previously errors were only reported in logging which is
often ignored.
Changelog: changed
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gitaly-backup/create_test.go | 7 | ||||
-rw-r--r-- | cmd/gitaly-backup/restore_test.go | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/cmd/gitaly-backup/create_test.go b/cmd/gitaly-backup/create_test.go index bb58c435f..957005e0b 100644 --- a/cmd/gitaly-backup/create_test.go +++ b/cmd/gitaly-backup/create_test.go @@ -48,8 +48,9 @@ func TestCreateSubcommand(t *testing.T) { } require.NoError(t, encoder.Encode(map[string]string{ - "address": "invalid", - "token": "invalid", + "address": "invalid", + "token": "invalid", + "relative_path": "invalid", })) cmd := createSubcommand{backupPath: path} @@ -60,7 +61,7 @@ func TestCreateSubcommand(t *testing.T) { require.NoError(t, fs.Parse([]string{"-path", path})) require.EqualError(t, cmd.Run(context.Background(), &stdin, io.Discard), - "create: pipeline: 1 failures encountered") + "create: pipeline: 1 failures encountered:\n - invalid: manager: isEmpty: could not dial source: invalid connection string: \"invalid\"\n") for _, repo := range repos { bundlePath := filepath.Join(path, repo.RelativePath+".bundle") diff --git a/cmd/gitaly-backup/restore_test.go b/cmd/gitaly-backup/restore_test.go index 083885e42..0b309db30 100644 --- a/cmd/gitaly-backup/restore_test.go +++ b/cmd/gitaly-backup/restore_test.go @@ -55,8 +55,9 @@ func TestRestoreSubcommand(t *testing.T) { } require.NoError(t, encoder.Encode(map[string]string{ - "address": "invalid", - "token": "invalid", + "address": "invalid", + "token": "invalid", + "relative_path": "invalid", })) cmd := restoreSubcommand{} @@ -67,7 +68,7 @@ func TestRestoreSubcommand(t *testing.T) { require.NoError(t, fs.Parse([]string{"-path", path})) require.EqualError(t, cmd.Run(context.Background(), &stdin, io.Discard), - "restore: pipeline: 1 failures encountered") + "restore: pipeline: 1 failures encountered:\n - invalid: manager: remove repository: could not dial source: invalid connection string: \"invalid\"\n") for _, repo := range repos { repoPath := filepath.Join(cfg.Storages[0].Path, repo.RelativePath) |