Skip to content

Commit 1f2b699

Browse files
committed
lint
Signed-off-by: Chris Martin <chris@cmartinit.co.uk>
1 parent 01524b1 commit 1f2b699

File tree

7 files changed

+12
-17
lines changed

7 files changed

+12
-17
lines changed

internal/common/ingest/testfixtures/event.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ package testfixtures
33
import (
44
"time"
55

6-
"google.golang.org/protobuf/proto"
7-
86
"github.com/google/uuid"
7+
"google.golang.org/protobuf/proto"
98
v1 "k8s.io/api/core/v1"
109
"k8s.io/apimachinery/pkg/api/resource"
1110

internal/common/proto/protoutil.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package protoutil
33
import (
44
"time"
55

6-
proto2 "github.com/golang/protobuf/proto"
6+
legacyproto "github.com/golang/protobuf/proto"
77
"google.golang.org/protobuf/proto"
88

99
"github.com/pkg/errors"
@@ -69,8 +69,8 @@ func MustMarshall(msg proto.Message) []byte {
6969
return b
7070
}
7171

72-
func MustMarshallProto2(msg proto2.Message) []byte {
73-
b, err := proto2.Marshal(msg)
72+
func MustMarshallLegacyProto(msg legacyproto.Message) []byte {
73+
b, err := legacyproto.Marshal(msg)
7474
if err != nil {
7575
panic(errors.Wrap(err, "Error marshalling object"))
7676
}

internal/executor/reporter/event.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import (
44
"fmt"
55
"strconv"
66

7-
"google.golang.org/protobuf/types/known/timestamppb"
8-
97
"github.com/pkg/errors"
8+
"google.golang.org/protobuf/types/known/timestamppb"
109
v1 "k8s.io/api/core/v1"
1110
networking "k8s.io/api/networking/v1"
1211

internal/scheduler/database/executor_repository_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"testing"
55
"time"
66

7+
"github.com/armadaproject/armada/internal/common/testutil"
8+
79
"github.com/jackc/pgx/v5/pgxpool"
810
"github.com/stretchr/testify/assert"
911
"github.com/stretchr/testify/require"
1012
"golang.org/x/exp/slices"
11-
"google.golang.org/protobuf/proto"
1213

1314
"github.com/armadaproject/armada/internal/common/armadacontext"
1415
protoutil "github.com/armadaproject/armada/internal/common/proto"
@@ -77,7 +78,7 @@ func TestExecutorRepository_LoadAndSave(t *testing.T) {
7778
slices.SortFunc(tc.executors, executorSort)
7879
require.Equal(t, len(tc.executors), len(retrievedExecutors))
7980
for i, expected := range tc.executors {
80-
assert.True(t, proto.Equal(expected, retrievedExecutors[i]))
81+
testutil.AssertProtoEqual(t, expected, retrievedExecutors[i])
8182
}
8283

8384
return nil

internal/scheduler/database/job_repository_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import (
55
"testing"
66
"time"
77

8+
"github.com/armadaproject/armada/internal/common/testutil"
9+
810
"github.com/google/uuid"
911
"github.com/jackc/pgx/v5/pgxpool"
1012
"github.com/pkg/errors"
1113
"github.com/stretchr/testify/assert"
1214
"github.com/stretchr/testify/require"
1315
"golang.org/x/exp/slices"
14-
"google.golang.org/protobuf/proto"
1516
v1 "k8s.io/api/core/v1"
1617

1718
"github.com/armadaproject/armada/internal/common/armadacontext"
@@ -375,10 +376,7 @@ func TestFetchJobRunErrors(t *testing.T) {
375376
require.Error(t, err)
376377
} else {
377378
require.NoError(t, err)
378-
require.Equal(t, len(tc.expected), len(received))
379-
for k, v := range received {
380-
assert.True(t, proto.Equal(tc.expected[k], v))
381-
}
379+
testutil.AssertProtoEqual(t, tc.expected, received)
382380
}
383381
cancel()
384382
return nil

internal/server/submit/validation/submit_request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ func TestValidatePodSpecSize(t *testing.T) {
592592
},
593593
}
594594

595-
defaultPodSpecSize := uint(len(protoutil.MustMarshallProto2(defaultPodSpec)))
595+
defaultPodSpecSize := uint(len(protoutil.MustMarshallLegacyProto(defaultPodSpec)))
596596

597597
tests := map[string]struct {
598598
req *api.JobSubmitRequestItem

magefiles/proto.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,5 @@ func protoProtocRun(armada, grpcGateway bool, swaggerFileName string, paths ...s
196196

197197
args = append(args, paths...)
198198

199-
println(strings.Join(args, " "))
200-
201199
return protocRun(args...)
202200
}

0 commit comments

Comments
 (0)