From 64f825963f99c0855b969545fd2d8a23274b3f50 Mon Sep 17 00:00:00 2001 From: carole-lavillonniere Date: Fri, 21 Nov 2025 15:04:22 +0100 Subject: [PATCH 1/2] fix test and run tests on ci --- .github/workflows/build.yml | 16 +++++++++++++++- lambda/core/directinvoke/directinvoke_test.go | 12 ++++++------ lambda/interop/model.go | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3e1cb9..9b7ae66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,22 @@ on: jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25' + + - name: Run tests + run: make tests + build: runs-on: ubuntu-latest + needs: test steps: - uses: actions/checkout@v4 @@ -18,7 +32,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.25' - + - name: Build env: RELEASE_BUILD_LINKER_FLAGS: "-s -w" diff --git a/lambda/core/directinvoke/directinvoke_test.go b/lambda/core/directinvoke/directinvoke_test.go index 94b6323..4682270 100644 --- a/lambda/core/directinvoke/directinvoke_test.go +++ b/lambda/core/directinvoke/directinvoke_test.go @@ -119,7 +119,7 @@ func TestAsyncPayloadCopyWhenPayloadSizeBelowMaxAllowed(t *testing.T) { require.Equal(t, EndOfResponseComplete, writer.Header().Get(EndOfResponseTrailer)) // reset it to its original value - MaxDirectResponseSize = interop.MaxPayloadSize + MaxDirectResponseSize = int64(interop.MaxPayloadSize) } func TestAsyncPayloadCopyWhenPayloadSizeEqualMaxAllowed(t *testing.T) { @@ -138,7 +138,7 @@ func TestAsyncPayloadCopyWhenPayloadSizeEqualMaxAllowed(t *testing.T) { require.Equal(t, EndOfResponseComplete, writer.Header().Get(EndOfResponseTrailer)) // reset it to its original value - MaxDirectResponseSize = interop.MaxPayloadSize + MaxDirectResponseSize = int64(interop.MaxPayloadSize) } func TestAsyncPayloadCopyWhenPayloadSizeAboveMaxAllowed(t *testing.T) { @@ -163,7 +163,7 @@ func TestAsyncPayloadCopyWhenPayloadSizeAboveMaxAllowed(t *testing.T) { require.Equal(t, EndOfResponseOversized, writer.Header().Get(EndOfResponseTrailer)) // reset it to its original value - MaxDirectResponseSize = interop.MaxPayloadSize + MaxDirectResponseSize = int64(interop.MaxPayloadSize) } // This is only allowed in streaming mode, currently. @@ -183,7 +183,7 @@ func TestAsyncPayloadCopyWhenUnlimitedPayloadSizeAllowed(t *testing.T) { require.Equal(t, EndOfResponseComplete, writer.Header().Get(EndOfResponseTrailer)) // reset it to its original value - MaxDirectResponseSize = interop.MaxPayloadSize + MaxDirectResponseSize = int64(interop.MaxPayloadSize) } // 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 <-testFinished // Reset to its default value, just in case other tests use them - MaxDirectResponseSize = interop.MaxPayloadSize + MaxDirectResponseSize = int64(interop.MaxPayloadSize) } func TestSendPayloadLimitedResponseAboveThresholdWithStreamingFunction(t *testing.T) { @@ -310,7 +310,7 @@ func TestSendPayloadLimitedResponseAboveThresholdWithStreamingFunction(t *testin <-testFinished // Reset to its default value, just in case other tests use them - MaxDirectResponseSize = interop.MaxPayloadSize + MaxDirectResponseSize = int64(interop.MaxPayloadSize) } func TestSendStreamingInvokeResponseSuccessWithTrailers(t *testing.T) { diff --git a/lambda/interop/model.go b/lambda/interop/model.go index ee7bb2a..2991d8e 100644 --- a/lambda/interop/model.go +++ b/lambda/interop/model.go @@ -356,7 +356,7 @@ type ErrorResponseTooLargeDI struct { // ErrorResponseTooLarge is returned when response provided by Runtime does not fit into shared memory buffer func (s *ErrorResponseTooLarge) Error() string { - return fmt.Sprintf("Response payload size exceeded maximum allowed payload size (%d bytes).", s.MaxResponseSize) + return fmt.Sprintf("Response payload size (%d bytes) exceeded maximum allowed payload size (%d bytes).", s.ResponseSize, s.MaxResponseSize) } // AsErrorResponse generates ErrorInvokeResponse from ErrorResponseTooLarge From 87e9da4c6d3c876086a751409089d889aecb572b Mon Sep 17 00:00:00 2001 From: carole-lavillonniere Date: Tue, 25 Nov 2025 08:47:30 +0100 Subject: [PATCH 2/2] address comment --- .github/workflows/build.yml | 2 +- .github/workflows/integ-tests.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b7ae66..43dad60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: go-version: '1.25' - name: Run tests - run: make tests + run: make tests-with-docker build: runs-on: ubuntu-latest diff --git a/.github/workflows/integ-tests.yml b/.github/workflows/integ-tests.yml index 1205a3e..1ac0a78 100644 --- a/.github/workflows/integ-tests.yml +++ b/.github/workflows/integ-tests.yml @@ -1,10 +1,10 @@ name: Run Integration Tests -on: - pull_request: - branches: - - develop - +# on: +# pull_request: +# branches: +# - develop +# jobs: go-tests: runs-on: ubuntu-latest @@ -46,4 +46,4 @@ jobs: with: python-version: '3.14' - name: run integration tests - run: make integ-tests-with-docker-old \ No newline at end of file + run: make integ-tests-with-docker-old