diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-12-09 11:41:04 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-12-10 18:04:03 +0300 |
commit | d5c97bec598ba8f5bee409e691279a50224f371c (patch) | |
tree | 2be7002f8b746364657db732635b4a5943d16093 /cmd | |
parent | 647d47c0ab8733e3695862882af428944021da01 (diff) |
backup: Replace use of standard contexts with testhelper ones
Tests should always use the testhelper package to create contexts such
that we can benefit from the feature flag sanity checks. Convert backup
tests to do so.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gitaly-backup/create_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/gitaly-backup/create_test.go b/cmd/gitaly-backup/create_test.go index 957005e0b..047da4cbf 100644 --- a/cmd/gitaly-backup/create_test.go +++ b/cmd/gitaly-backup/create_test.go @@ -2,7 +2,6 @@ package main import ( "bytes" - "context" "encoding/json" "flag" "fmt" @@ -58,9 +57,12 @@ func TestCreateSubcommand(t *testing.T) { fs := flag.NewFlagSet("create", flag.ContinueOnError) cmd.Flags(fs) + ctx, cancel := testhelper.Context() + defer cancel() + require.NoError(t, fs.Parse([]string{"-path", path})) require.EqualError(t, - cmd.Run(context.Background(), &stdin, io.Discard), + cmd.Run(ctx, &stdin, io.Discard), "create: pipeline: 1 failures encountered:\n - invalid: manager: isEmpty: could not dial source: invalid connection string: \"invalid\"\n") for _, repo := range repos { |