Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 0e7b927

Browse files
committed
Fix tests
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
1 parent 0c2cb4f commit 0e7b927

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

cmd/asset-syncer/server/utils_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ func Test_filterCharts(t *testing.T) {
14891489
JQ: "not a rule",
14901490
},
14911491
nil,
1492-
fmt.Errorf(`Unable to parse jq query: unexpected token "a"`),
1492+
fmt.Errorf(`unable to parse jq query: unexpected token "a"`),
14931493
},
14941494
{
14951495
"an invalid number of vars cause to return an empty set",
@@ -1501,7 +1501,7 @@ func Test_filterCharts(t *testing.T) {
15011501
JQ: ".name == $var1",
15021502
},
15031503
nil,
1504-
fmt.Errorf(`Unable to compile jq: variable not defined: $var1`),
1504+
fmt.Errorf(`unable to compile jq: variable not defined: $var1`),
15051505
},
15061506
{
15071507
"the query doesn't return a boolean",
@@ -1513,7 +1513,7 @@ func Test_filterCharts(t *testing.T) {
15131513
JQ: `.name`,
15141514
},
15151515
nil,
1516-
fmt.Errorf(`Unable to convert jq result to boolean. Got: foo`),
1516+
fmt.Errorf(`unable to convert jq result to boolean. Got: foo`),
15171517
},
15181518
{
15191519
"matches without vars",

cmd/kubeapps-apis/core/plugins/v1alpha1/plugins_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,18 +360,18 @@ func TestCreateConfigGetterWithParams(t *testing.T) {
360360
{
361361
name: "it doesn't create the config and throws a grpc error when passing an invalid authorization metadata",
362362
headers: http.Header{"Authorization": []string{"Bla"}},
363-
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid authorization metadata: malformed authorization metadata")),
363+
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("Invalid authorization metadata: malformed authorization metadata")),
364364
},
365365
{
366366
name: "it doesn't create the config and throws a grpc error for the default cluster when no authorization metadata is passed",
367367
expectedAPIHost: DefaultK8sAPI,
368-
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid authorization metadata: missing authorization metadata")),
368+
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("Invalid authorization metadata: missing authorization metadata")),
369369
},
370370
{
371371
name: "it doesn't create the config and throws a grpc error for the other cluster",
372372
cluster: OtherClusterName,
373373
expectedAPIHost: OtherK8sAPI,
374-
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid authorization metadata: missing authorization metadata")),
374+
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("Invalid authorization metadata: missing authorization metadata")),
375375
},
376376
}
377377

cmd/kubeapps-apis/plugins/helm/packages/v1alpha1/repositories_validation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func TestOCIValidate(t *testing.T) {
269269
},
270270
expectedResponse: &ValidationResponse{
271271
Code: 400,
272-
Message: "Unexpected status code when querying \"nginx\": 404",
272+
Message: "unexpected status code when querying \"nginx\": 404",
273273
},
274274
},
275275
{

cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/server_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6701,7 +6701,7 @@ func TestAddPackageRepository(t *testing.T) {
67016701
return request
67026702
},
67036703
expectedErrorCode: connect.CodeInvalidArgument,
6704-
expectedErrorString: "secret name is not provided",
6704+
expectedErrorString: "the secret name is not provided",
67056705
},
67066706
{
67076707
name: "validate auth (user managed, secret does not exist)",
@@ -6739,7 +6739,7 @@ func TestAddPackageRepository(t *testing.T) {
67396739
return request
67406740
},
67416741
expectedErrorCode: connect.CodeInvalidArgument,
6742-
expectedErrorString: "secret does not match",
6742+
expectedErrorString: "the secret does not match",
67436743
},
67446744
{
67456745
name: "validate auth (plugin managed, invalid config, basic auth)",
@@ -6750,7 +6750,7 @@ func TestAddPackageRepository(t *testing.T) {
67506750
return request
67516751
},
67526752
expectedErrorCode: connect.CodeInvalidArgument,
6753-
expectedErrorString: "missing basic auth",
6753+
expectedErrorString: "Missing basic auth",
67546754
},
67556755
{
67566756
name: "validate auth (plugin managed, invalid config, docker)",
@@ -6764,7 +6764,7 @@ func TestAddPackageRepository(t *testing.T) {
67646764
return request
67656765
},
67666766
expectedErrorCode: connect.CodeInvalidArgument,
6767-
expectedErrorString: "missing Docker Config auth",
6767+
expectedErrorString: "Missing Docker Config auth",
67686768
},
67696769
{
67706770
name: "validate auth (plugin managed, invalid config, ssh auth)",
@@ -7346,7 +7346,7 @@ func TestUpdatePackageRepository(t *testing.T) {
73467346
return request
73477347
},
73487348
expectedErrorCode: connect.CodeInvalidArgument,
7349-
expectedStatusString: "secret name is not provided",
7349+
expectedStatusString: "the secret name is not provided",
73507350
},
73517351
{
73527352
name: "validate auth (user managed, secret does not exist)",
@@ -7362,7 +7362,7 @@ func TestUpdatePackageRepository(t *testing.T) {
73627362
return request
73637363
},
73647364
expectedErrorCode: connect.CodeInvalidArgument,
7365-
expectedStatusString: "not found",
7365+
expectedStatusString: "Not found",
73667366
},
73677367
{
73687368
name: "validate auth (user managed, secret is incompatible)",
@@ -7381,7 +7381,7 @@ func TestUpdatePackageRepository(t *testing.T) {
73817381
return request
73827382
},
73837383
expectedErrorCode: connect.CodeInvalidArgument,
7384-
expectedStatusString: "secret does not match",
7384+
expectedStatusString: "Secret does not match",
73857385
},
73867386
{
73877387
name: "validate auth (plugin managed, invalid config, basic auth)",
@@ -7392,7 +7392,7 @@ func TestUpdatePackageRepository(t *testing.T) {
73927392
return request
73937393
},
73947394
expectedErrorCode: connect.CodeInvalidArgument,
7395-
expectedStatusString: "missing basic auth",
7395+
expectedStatusString: "Missing basic auth",
73967396
},
73977397
{
73987398
name: "validate auth (plugin managed, invalid config, docker)",

cmd/kubeapps-apis/plugins/pkg/connecterror/connecterror_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ func TestErrorByStatus(t *testing.T) {
2828
"my-resource",
2929
"",
3030
status.Errorf(codes.InvalidArgument, "boom!"),
31-
connect.NewError(connect.CodeInternal, fmt.Errorf("unable to get the my-resource 'all' due to 'rpc error: code = InvalidArgument desc = boom!'")),
31+
connect.NewError(connect.CodeInternal, fmt.Errorf("Unable to get the my-resource 'all' due to 'rpc error: code = InvalidArgument desc = boom!'")),
3232
},
3333
{
3434
"error msg for a single resources ",
3535
"get",
3636
"my-resource",
3737
"my-id",
3838
status.Errorf(codes.InvalidArgument, "boom!"),
39-
connect.NewError(connect.CodeInternal, fmt.Errorf("unable to get the my-resource 'my-id' due to 'rpc error: code = InvalidArgument desc = boom!'")),
39+
connect.NewError(connect.CodeInternal, fmt.Errorf("Unable to get the my-resource 'my-id' due to 'rpc error: code = InvalidArgument desc = boom!'")),
4040
},
4141
}
4242
for _, tt := range tests {

0 commit comments

Comments
 (0)