Skip to content

Commit 64f8259

Browse files
fix test and run tests on ci
1 parent 5b81e4c commit 64f8259

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,30 @@ on:
99

1010
jobs:
1111

12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: '1.25'
21+
22+
- name: Run tests
23+
run: make tests
24+
1225
build:
1326
runs-on: ubuntu-latest
27+
needs: test
1428
steps:
1529
- uses: actions/checkout@v4
1630

1731
- name: Set up Go
1832
uses: actions/setup-go@v5
1933
with:
2034
go-version: '1.25'
21-
35+
2236
- name: Build
2337
env:
2438
RELEASE_BUILD_LINKER_FLAGS: "-s -w"

lambda/core/directinvoke/directinvoke_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestAsyncPayloadCopyWhenPayloadSizeBelowMaxAllowed(t *testing.T) {
119119
require.Equal(t, EndOfResponseComplete, writer.Header().Get(EndOfResponseTrailer))
120120

121121
// reset it to its original value
122-
MaxDirectResponseSize = interop.MaxPayloadSize
122+
MaxDirectResponseSize = int64(interop.MaxPayloadSize)
123123
}
124124

125125
func TestAsyncPayloadCopyWhenPayloadSizeEqualMaxAllowed(t *testing.T) {
@@ -138,7 +138,7 @@ func TestAsyncPayloadCopyWhenPayloadSizeEqualMaxAllowed(t *testing.T) {
138138
require.Equal(t, EndOfResponseComplete, writer.Header().Get(EndOfResponseTrailer))
139139

140140
// reset it to its original value
141-
MaxDirectResponseSize = interop.MaxPayloadSize
141+
MaxDirectResponseSize = int64(interop.MaxPayloadSize)
142142
}
143143

144144
func TestAsyncPayloadCopyWhenPayloadSizeAboveMaxAllowed(t *testing.T) {
@@ -163,7 +163,7 @@ func TestAsyncPayloadCopyWhenPayloadSizeAboveMaxAllowed(t *testing.T) {
163163
require.Equal(t, EndOfResponseOversized, writer.Header().Get(EndOfResponseTrailer))
164164

165165
// reset it to its original value
166-
MaxDirectResponseSize = interop.MaxPayloadSize
166+
MaxDirectResponseSize = int64(interop.MaxPayloadSize)
167167
}
168168

169169
// This is only allowed in streaming mode, currently.
@@ -183,7 +183,7 @@ func TestAsyncPayloadCopyWhenUnlimitedPayloadSizeAllowed(t *testing.T) {
183183
require.Equal(t, EndOfResponseComplete, writer.Header().Get(EndOfResponseTrailer))
184184

185185
// reset it to its original value
186-
MaxDirectResponseSize = interop.MaxPayloadSize
186+
MaxDirectResponseSize = int64(interop.MaxPayloadSize)
187187
}
188188

189189
// We use an interruptable response writer which informs on a channel that it's ready to be interrupted after
@@ -275,7 +275,7 @@ func TestSendPayloadLimitedResponseWithinThresholdWithStreamingFunction(t *testi
275275
<-testFinished
276276

277277
// Reset to its default value, just in case other tests use them
278-
MaxDirectResponseSize = interop.MaxPayloadSize
278+
MaxDirectResponseSize = int64(interop.MaxPayloadSize)
279279
}
280280

281281
func TestSendPayloadLimitedResponseAboveThresholdWithStreamingFunction(t *testing.T) {
@@ -310,7 +310,7 @@ func TestSendPayloadLimitedResponseAboveThresholdWithStreamingFunction(t *testin
310310
<-testFinished
311311

312312
// Reset to its default value, just in case other tests use them
313-
MaxDirectResponseSize = interop.MaxPayloadSize
313+
MaxDirectResponseSize = int64(interop.MaxPayloadSize)
314314
}
315315

316316
func TestSendStreamingInvokeResponseSuccessWithTrailers(t *testing.T) {

lambda/interop/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ type ErrorResponseTooLargeDI struct {
356356

357357
// ErrorResponseTooLarge is returned when response provided by Runtime does not fit into shared memory buffer
358358
func (s *ErrorResponseTooLarge) Error() string {
359-
return fmt.Sprintf("Response payload size exceeded maximum allowed payload size (%d bytes).", s.MaxResponseSize)
359+
return fmt.Sprintf("Response payload size (%d bytes) exceeded maximum allowed payload size (%d bytes).", s.ResponseSize, s.MaxResponseSize)
360360
}
361361

362362
// AsErrorResponse generates ErrorInvokeResponse from ErrorResponseTooLarge

0 commit comments

Comments
 (0)