Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,30 @@ 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not rather add (or perhaps even replace) the localstack branch inside the Run Integration Tests job?

on:
pull_request:
branches:
- develop

Seems there is a job there that will ensure the Go tests are run prior to running the int. tests:

jobs:
go-tests:
runs-on: ubuntu-latest
environment:
name: integ-tests
steps:
- uses: actions/checkout@v4
- name: run go tests
run: make tests-with-docker

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out, I had missed this integ-tests.yml file!
What I did is delete it, since:

  • most jobs it contains are failing at the moment
  • the job I added is about unit tests, whereas this workflow is called integ-tests
  • I think it makes sense to always run the unit tests before attempting to build

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Can we keep the integration tests yaml, and just ensure it's skipped/never runs? I think in future, we should be running integration tests with upstream LocalStack IMO.

For example, we can build the go binary, upload it as a workflow artifact, and trigger some upstream LocalStack workflow that ensures we run the Lambda suite with this binary.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-added the workflow but commented out the trigger: 87e9da4
I agree we should improve the testing there in the future.


build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'

- name: Build
env:
RELEASE_BUILD_LINKER_FLAGS: "-s -w"
Expand Down
12 changes: 6 additions & 6 deletions lambda/core/directinvoke/directinvoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lambda/interop/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down