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
path: root/cmd
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-12-06 09:49:50 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-12-06 09:50:11 +0300
commitddfe5c04ef463e76b5b021415a915fcc055c2fa7 (patch)
treef08ded4873af3b2d403e1fd4caaa9d4ce4c70e34 /cmd
parent555260f1579aca1dcb8494c0d505971c861b673a (diff)
testhelper: Absorb helpers from the testassert package
Personally, whenever I want to compare gRPC errors and/or messages, I stand there asking myself where the helper I want is located again. This is caused by a split we have in test helpers related to gRPC: while we do have `testhelper.RequireGrpcError()`, checking for actual errors is done via `testassert.GrpcEqualErr()`. I always have to look up which of both does what and where it's located. Fix this by absorbing the helpers from the testassert package into the testhelper package.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/praefect/subcmd_metadata_test.go3
-rw-r--r--cmd/praefect/subcmd_set_replication_factor_test.go3
2 files changed, 2 insertions, 4 deletions
diff --git a/cmd/praefect/subcmd_metadata_test.go b/cmd/praefect/subcmd_metadata_test.go
index d0bba3ec4..dcc655feb 100644
--- a/cmd/praefect/subcmd_metadata_test.go
+++ b/cmd/praefect/subcmd_metadata_test.go
@@ -12,7 +12,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/datastore/glsql"
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/service/info"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
- "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testassert"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testdb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -92,7 +91,7 @@ func TestMetadataSubcommand(t *testing.T) {
fs := cmd.FlagSet()
require.NoError(t, fs.Parse(tc.args))
err := cmd.Exec(fs, config.Config{SocketPath: ln.Addr().String()})
- testassert.GrpcEqualErr(t, tc.error, err)
+ testhelper.GrpcEqualErr(t, tc.error, err)
if tc.error != nil {
return
}
diff --git a/cmd/praefect/subcmd_set_replication_factor_test.go b/cmd/praefect/subcmd_set_replication_factor_test.go
index 67b917d9d..c5c934a3c 100644
--- a/cmd/praefect/subcmd_set_replication_factor_test.go
+++ b/cmd/praefect/subcmd_set_replication_factor_test.go
@@ -11,7 +11,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/datastore/glsql"
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/service/info"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
- "gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testassert"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
@@ -107,7 +106,7 @@ func TestSetReplicationFactorSubcommand(t *testing.T) {
err := cmd.Exec(fs, config.Config{
SocketPath: ln.Addr().String(),
})
- testassert.GrpcEqualErr(t, tc.error, err)
+ testhelper.GrpcEqualErr(t, tc.error, err)
require.Equal(t, tc.stdout, stdout.String())
})
}