Skip to content

Commit fee2adb

Browse files
committed
let's ignore some
1 parent 8494d12 commit fee2adb

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

libs/common/grpc.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ func DefaultStreamInterceptors(metrics *prometheusGrpcProvider.ServerMetrics) []
121121
func DefaultServerOptions() []grpc.ServerOption {
122122
// register new metrics collector with prometheus
123123
metrics := prometheusGrpcProvider.NewServerMetrics()
124-
telemetry.PrometheusRegistry().MustRegister(metrics)
124+
125+
if !hwutil.IsRunningInGoTests() {
126+
telemetry.PrometheusRegistry().MustRegister(metrics)
127+
}
125128

126129
unaryInterceptorChain := grpc.ChainUnaryInterceptor(DefaultUnaryInterceptors(metrics)...)
127130
streamInterceptorChain := grpc.ChainStreamInterceptor(DefaultStreamInterceptors(metrics)...)

libs/common/hwgrpc/locale_interceptor_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func TestLocaleInterceptor(t *testing.T) {
2424
}
2525

2626
for acceptLanguageHeader, expectedLocalesStrings := range testCases {
27-
t.Parallel()
2827
t.Run(fmt.Sprintf("Test localeInterceptor with accept-language header of '%s'", acceptLanguageHeader),
2928
func(t *testing.T) {
3029
t.Parallel()

libs/hwutil/env.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package hwutil
22

33
import (
4+
"flag"
45
"os"
56

67
"github.com/rs/zerolog/log"
@@ -29,3 +30,7 @@ func HasEnv(key string) bool {
2930
_, found := os.LookupEnv(key)
3031
return found
3132
}
33+
34+
func IsRunningInGoTests() bool {
35+
return flag.Lookup("test.v") != nil
36+
}

services/property-svc/internal/property-view/api/grpc_test.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ func setup() (
7171
return ctx, client, as, dbMock, teardown
7272
}
7373

74+
//nolint:paralleltest
7475
func TestPropertyViewGrpcService_UpdatePropertyViewRule_Validation(t *testing.T) {
75-
t.Parallel()
76-
7776
ctx, client, _, dbMock, teardown := setup()
7877
defer teardown()
7978

@@ -243,9 +242,8 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_AllEmptyNoEffect(t *test
243242
as.ExpectToBeEmpty(t)
244243
}
245244

245+
//nolint:paralleltest
246246
func TestPropertyViewGrpcService_UpdatePropertyViewRule_TaskPropertyMatcher_GreenPath_Created(t *testing.T) {
247-
t.Parallel()
248-
249247
ctx, client, as, dbMock, teardown := setup()
250248
defer teardown()
251249

@@ -313,9 +311,8 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_TaskPropertyMatcher_Gree
313311
})
314312
}
315313

314+
//nolint:paralleltest
316315
func TestPropertyViewGrpcService_UpdatePropertyViewRule_PatientPropertyMatcher_GreenPath_Created(t *testing.T) {
317-
t.Parallel()
318-
319316
ctx, client, as, dbMock, teardown := setup()
320317
defer teardown()
321318

@@ -383,9 +380,8 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_PatientPropertyMatcher_G
383380
})
384381
}
385382

383+
//nolint:paralleltest
386384
func TestPropertyViewGrpcService_UpdatePropertyViewRule_TaskPropertyMatcher_GreenPath_Updated(t *testing.T) {
387-
t.Parallel()
388-
389385
ctx, client, as, dbMock, teardown := setup()
390386
defer teardown()
391387

@@ -482,9 +478,8 @@ func TestPropertyViewGrpcService_UpdatePropertyViewRule_TaskPropertyMatcher_Gree
482478
})
483479
}
484480

481+
//nolint:paralleltest
485482
func TestPropertyViewGrpcService_UpdatePropertyViewRule_PatientPropertyMatcher_GreenPath_Updated(t *testing.T) {
486-
t.Parallel()
487-
488483
ctx, client, as, dbMock, teardown := setup()
489484
defer teardown()
490485

services/property-svc/internal/property-view/projections/property_rules_postgres/property_rules_postgres_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ func setup() (ctx context.Context, projection *Projection, dbMock pgxmock.PgxPoo
5252
return ctx, projection, dbMock, teardown
5353
}
5454

55+
//nolint:paralleltest
5556
func TestPropertyViewPropertyRulesProjection_Create_TaskPropertyMatcher_GreenPath(t *testing.T) {
56-
t.Parallel()
57-
5857
ctx, projection, dbMock, teardown := setup()
5958
defer teardown()
6059

services/property-svc/stories/GetPropertieBySubjectType_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import (
1717
// TestGetPropertiesBySubjectType:
1818
// - Create Properties
1919
// - Check GetPropertiesBySubjectType
20+
//
21+
//nolint:paralleltest
2022
func TestGetProperties(t *testing.T) {
21-
t.Parallel()
22-
2323
propertyClient := propertyServiceClient()
2424

2525
ctx := context.Background()

services/tasks-svc/internal/task/api/grpc_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,8 @@ func TestTaskGrpcService_CreateSubtask_Validation(t *testing.T) {
252252
require.NoError(t, err, codes.InvalidArgument, "rejects fully valid request")
253253
}
254254

255+
//nolint:paralleltest
255256
func TestTaskGrpcService_UpdateSubtask_Validation(t *testing.T) {
256-
t.Parallel()
257-
258257
ctx, client, teardown := setup()
259258
defer teardown()
260259

0 commit comments

Comments
 (0)