Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dee-kryvenko committed Feb 18, 2025
1 parent 5628c68 commit 235244e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestControllers(t *testing.T) {

var _ = Describe("LongestProcessingTimePartitioner", func() {
Context("when unsorted list of shards", func() {
// nolint:dupl
It("should sort", func() {
shards := []common.LoadIndex{
{Shard: common.Shard{Name: "shard1"}, Value: resource.MustParse("5")},
Expand All @@ -29,14 +30,15 @@ var _ = Describe("LongestProcessingTimePartitioner", func() {
partitioner := PartitionerImpl{}
sortedShards, bucketSize := partitioner.Sort(shards)
Expect(bucketSize).To(Equal(float64(8)))
Expect(len(sortedShards)).To(Equal(len(shards)))
Expect(sortedShards).To(HaveLen(len(shards)))
Expect(sortedShards[0].Shard.Name).To(Equal("shard3"))
Expect(sortedShards[1].Shard.Name).To(Equal("shard5"))
Expect(sortedShards[2].Shard.Name).To(Equal("shard4"))
Expect(sortedShards[3].Shard.Name).To(Equal("shard1"))
Expect(sortedShards[4].Shard.Name).To(Equal("shard2"))
})

// nolint:dupl
It("should put in-cluster first", func() {
shards := []common.LoadIndex{
{Shard: common.Shard{Name: "shard1"}, Value: resource.MustParse("5")},
Expand All @@ -48,7 +50,7 @@ var _ = Describe("LongestProcessingTimePartitioner", func() {
partitioner := PartitionerImpl{}
sortedShards, bucketSize := partitioner.Sort(shards)
Expect(bucketSize).To(Equal(float64(8)))
Expect(len(sortedShards)).To(Equal(len(shards)))
Expect(sortedShards).To(HaveLen(len(shards)))
Expect(sortedShards[0].Shard.Name).To(Equal("in-cluster"))
Expect(sortedShards[1].Shard.Name).To(Equal("shard3"))
Expect(sortedShards[2].Shard.Name).To(Equal("shard5"))
Expand Down

0 comments on commit 235244e

Please sign in to comment.