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-05 06:51:27 +0300
commit26c3ef8c515ac525130a9e7f37011cc3cd6e728c (patch)
treef0fcbbe299930d983c5cbf8b4e759ad5e26b116e
parent0da5fc413c24c23c79cf47c40bb930b4082f5f90 (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)