Skip to content

Added integration tests for http adapter#113

Merged
bnusunny merged 1 commit intomainfrom
integration-tests
Dec 29, 2022
Merged

Added integration tests for http adapter#113
bnusunny merged 1 commit intomainfrom
integration-tests

Conversation

@ferdingler
Copy link
Copy Markdown
Contributor

@ferdingler ferdingler commented Dec 29, 2022

Description of changes:
Added integration tests for the HTTP adapter using an HTTP mock server. The mock server simulates the web application and it actually spins up a Hyper server locally so the tests are excercising the majority of the adapter logic, except for the part where we register as a Lambda extension (see note 2 below).

Note
I made a minor change to the AdapterOptions struct to make fields public so that we could initialize the struct from within the tests. Using environment variables for the tests wasn't an option as by default all tests run in parallel and modifying env variables in one test affects the rest of them.

Note 2
I tried to simulate the Lambda Extensions API locally as well and made really good progress, but I ended up stuck with some tokio threads hanging and not being terminated gracefully when the tests finished. I kept that work on a local branch, may push it in the future if I manage to fix the issue.

Future work

  • Add tests for TCP adapter
  • Add more scenarios to test API Gateway events.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Copy Markdown
Contributor

@bnusunny bnusunny left a comment

Choose a reason for hiding this comment

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

LGTM

@bnusunny bnusunny merged commit 1147817 into main Dec 29, 2022
@bnusunny bnusunny deleted the integration-tests branch December 29, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants