Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Liu <jliu@gitlab.com>2023-12-14 03:48:00 +0300
committerJames Liu <jliu@gitlab.com>2024-01-15 05:40:55 +0300
commit07c7b8b56b241e98f6a3dc3a1b47070b3a7602a9 (patch)
treeb2fd7013b48eeaacd6b5f05fe34720d7b96c99df
parent91e9c2e1e0c3f26db2b3a8b2acf19082c0b79bd8 (diff)
backup: Stop sending invalid requests
Modifies the Restore CLI tests so we stop sending an invalid restore command as the final JSON object into stdin. This is required as a subsequent commit will move the repository removal logic to execute after the Pipeline completes successfully. If the tests purposely cause the pipeline to fail, the restore logic will never execute. Coverage of the Pipeline's error messaging is covered separately in the Pipeline's unit tests.
-rw-r--r--internal/cli/gitalybackup/restore_test.go20
1 files changed, 2 insertions, 18 deletions
diff --git a/internal/cli/gitalybackup/restore_test.go b/internal/cli/gitalybackup/restore_test.go
index 4eae52e4c..6d235525c 100644
--- a/internal/cli/gitalybackup/restore_test.go
+++ b/internal/cli/gitalybackup/restore_test.go
@@ -75,12 +75,6 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
}))
}
- require.NoError(t, encoder.Encode(map[string]string{
- "address": "invalid",
- "token": "invalid",
- "relative_path": "invalid",
- }))
-
ctx = testhelper.MergeIncomingMetadata(ctx, testcfg.GitalyServersMetadataFromCfg(t, cfg))
args := []string{
@@ -103,9 +97,7 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
require.DirExists(t, existRepoPath)
- require.EqualError(t,
- cmd.RunContext(ctx, args),
- "restore: pipeline: 1 failures encountered:\n - invalid: manager: could not dial source: invalid connection string: \"invalid\"\n")
+ require.NoError(t, cmd.RunContext(ctx, args))
require.NoDirExists(t, existRepoPath)
@@ -179,12 +171,6 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
}))
}
- require.NoError(t, encoder.Encode(map[string]string{
- "address": "invalid",
- "token": "invalid",
- "relative_path": "invalid",
- }))
-
ctx = testhelper.MergeIncomingMetadata(ctx, testcfg.GitalyServersMetadataFromCfg(t, cfg))
args := []string{
@@ -207,9 +193,7 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
require.DirExists(t, existRepoPath)
- require.EqualError(t,
- cmd.RunContext(ctx, args),
- "restore: pipeline: 1 failures encountered:\n - invalid: server-side restore: could not dial source: invalid connection string: \"invalid\"\n")
+ require.NoError(t, cmd.RunContext(ctx, args))
require.NoDirExists(t, existRepoPath)