Skip to content

Commit

Permalink
fixup! chore(deps): Bump golangci-lint to 1.60.2
Browse files Browse the repository at this point in the history
  • Loading branch information
silvestre committed Aug 29, 2024
1 parent ae5acc1 commit d5e342b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/acceptance/assets/app/go_app/internal/app/cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ var _ = Describe("CPU tests", func() {
Get("/cpu/invalid/4").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid utilization: strconv.ParseUint: parsing \"invalid\": invalid syntax"}}`).
Body(`{"error":{"description":"invalid utilization: strconv.ParseInt: parsing \"invalid\": invalid syntax"}}`).
End()
})
It("should err if cpu out of bounds", func() {
apiTest(nil, nil, fakeCPUWaster, nil).
Get("/cpu/100001010101010249032897287298719874687936483275648273632429479827398798271/4").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid utilization: strconv.ParseUint: parsing \"100001010101010249032897287298719874687936483275648273632429479827398798271\": value out of range"}}`).
Body(`{"error":{"description":"invalid utilization: strconv.ParseInt: parsing \"100001010101010249032897287298719874687936483275648273632429479827398798271\": value out of range"}}`).
End()
})
It("should err if cpu not an int", func() {
apiTest(nil, nil, fakeCPUWaster, nil).
Get("/cpu/5/invalid").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid minutes: strconv.ParseUint: parsing \"invalid\": invalid syntax"}}`).
Body(`{"error":{"description":"invalid minutes: strconv.ParseInt: parsing \"invalid\": invalid syntax"}}`).
End()
})
It("should return ok and sleep correctDuration", func() {
Expand All @@ -51,7 +51,7 @@ var _ = Describe("CPU tests", func() {
Eventually(func() int { return fakeCPUWaster.UseCPUCallCount() }).Should(Equal(1))
utilization, duration := fakeCPUWaster.UseCPUArgsForCall(0)
Expect(duration).Should(Equal(4 * time.Minute))
Expect(utilization).Should(Equal(uint64(5)))
Expect(utilization).Should(Equal(int64(5)))
})
})

Expand Down
8 changes: 4 additions & 4 deletions src/acceptance/assets/app/go_app/internal/app/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ var _ = Describe("Memory tests", func() {
Get("/memory/invalid/4").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid memoryMiB: strconv.ParseUint: parsing \"invalid\": invalid syntax"}}`).
Body(`{"error":{"description":"invalid memoryMiB: strconv.ParseInt: parsing \"invalid\": invalid syntax"}}`).
End()
})
It("should err if memory out of bounds", func() {
apiTest(nil, fakeMemoryTest, nil, nil).
Get("/memory/100001010101010249032897287298719874687936483275648273632429479827398798271/4").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid memoryMiB: strconv.ParseUint: parsing \"100001010101010249032897287298719874687936483275648273632429479827398798271\": value out of range"}}`).
Body(`{"error":{"description":"invalid memoryMiB: strconv.ParseInt: parsing \"100001010101010249032897287298719874687936483275648273632429479827398798271\": value out of range"}}`).
End()
})
It("should err if memory not an int", func() {
apiTest(nil, fakeMemoryTest, nil, nil).
Get("/memory/5/invalid").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid minutes: strconv.ParseUint: parsing \"invalid\": invalid syntax"}}`).
Body(`{"error":{"description":"invalid minutes: strconv.ParseInt: parsing \"invalid\": invalid syntax"}}`).
End()
})
It("should return ok and sleep correctDuration", func() {
Expand All @@ -56,7 +56,7 @@ var _ = Describe("Memory tests", func() {
// http-features (i.e. returing http-status-code 202 etc.) which would involve a lot of
// new lines of code.
Eventually(func() int { return fakeMemoryTest.UseMemoryCallCount() }).Should(Equal(1))
Expect(fakeMemoryTest.UseMemoryArgsForCall(0)).To(Equal(uint64(5 * app.Mebi)))
Expect(fakeMemoryTest.UseMemoryArgsForCall(0)).To(Equal(int64(5 * app.Mebi)))
Eventually(func() int { return fakeMemoryTest.SleepCallCount() }).Should(Equal(1))
Expect(fakeMemoryTest.SleepArgsForCall(0)).To(Equal(4 * time.Minute))
Eventually(func() int { return fakeMemoryTest.StopTestCallCount() }).Should(Equal(1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ var _ = Describe("Responsetime tests", func() {
Get("/responsetime/slow/yes").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid milliseconds: strconv.ParseUint: parsing \"yes\": invalid syntax"}}`).
Body(`{"error":{"description":"invalid milliseconds: strconv.ParseInt: parsing \"yes\": invalid syntax"}}`).
End()
})
It("should err if memory out of bounds", func() {
apiTest(fakeTimeWaster, nil, nil, nil).
Get("/responsetime/slow/100001010101010249032897287298719874687936483275648273632429479827398798271").
Expect(GinkgoT()).
Status(http.StatusBadRequest).
Body(`{"error":{"description":"invalid milliseconds: strconv.ParseUint: parsing \"100001010101010249032897287298719874687936483275648273632429479827398798271\": value out of range"}}`).
Body(`{"error":{"description":"invalid milliseconds: strconv.ParseInt: parsing \"100001010101010249032897287298719874687936483275648273632429479827398798271\": value out of range"}}`).
End()
})

Expand Down

0 comments on commit d5e342b

Please sign in to comment.