Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests suite for provisionedConcurrency #8321

Closed
pgrzesik opened this issue Oct 1, 2020 · 8 comments · Fixed by #8326
Closed

Integration tests suite for provisionedConcurrency #8321

pgrzesik opened this issue Oct 1, 2020 · 8 comments · Fixed by #8326

Comments

@pgrzesik
Copy link
Contributor

pgrzesik commented Oct 1, 2020

I took the liberty of moving the conversation about integration tests for provisionedConcurrency from the discussion in this PR: #8298 (comment)

Use case description

The goal here is to provide coverage of provisionedConcurrency in our integration test suite.

Proposed solution

Solution based on the comment from @medikoo

In light of that, yes I totally agree it's worth to have some deployment that tests provisionedConcurrency setup. It'll probably be optimal to have one dedicated stack (test), for testing all provisioned concurrency cases (but we can start just with this one). What do you think?

  • Introduce a test/integration/provisionedConcurrency.test.js test that will cover all provisionedConcurrency based cases, starting with just one for sqs.
  • Introduce a test/fixtures/provisionedConcurrency fixture which will have a single serverless.yml configuration with all needed functions (starting with just one for sqs)

Before starting the implementation, I would like to resolve if the above sound like a reasonable approach, thanks in advance 🙇

@medikoo
Copy link
Contributor

medikoo commented Oct 1, 2020

Thanks @pgrzesik for opening that. Let me know if you have other suggestions or findings

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Oct 1, 2020

I think that the approach you suggested originally should work quite well. The only other approach that came to my mind is to keep provisionedConcurrency tests in the same suite as tests for specific event, e.g. for sqs, to keep the test in sqs.test.js and use sqs fixture with an additional function that uses provisionedConcurrency.

Which approach is better in your opinion?

@medikoo
Copy link
Contributor

medikoo commented Oct 1, 2020

Which approach is better in your opinion?

I think keeping it in one place, will allow us to rely on single provisioned lambda, and that I think will be more performant (and will incur less costs). It's the only reason I called for that.

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Oct 1, 2020

Thanks for the clarification on that topic. Just to clarify the last thing - if I understand it correctly, we will start out with a single function with sqs event and if we ever need to test e.g. sns with provisionedConcurrency, the function will also handle sns event and will be able to appropriately process both of them and so on for further scenarios?

Originally I thought that each new event will get a separate function but that also makes a ton of sense from efficiency/costs perspective 👍

@medikoo
Copy link
Contributor

medikoo commented Oct 1, 2020

the function will also handle sns event and will be able to appropriately process both of them and so on for further scenarios?

Hopefully that could be the case, but if for some reason it'll be a no go, we'd need to introduce an other function

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Oct 1, 2020

Perfect, thanks a ton, I'll be happy to pick up this one if that's okay 👍

@medikoo
Copy link
Contributor

medikoo commented Oct 1, 2020

That'll be great @pgrzesik ! Thanks for being a part of the community and your work on improving the Serverless Framework!

@pgrzesik
Copy link
Contributor Author

pgrzesik commented Oct 1, 2020

Thanks for the kind words @medikoo, I'm happy that I can help and contribute at least a little bit 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants