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

fix(logger): enable sequential invocation in e2e test #658

Merged
merged 2 commits into from Mar 14, 2022
Merged

fix(logger): enable sequential invocation in e2e test #658

merged 2 commits into from Mar 14, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 14, 2022

Description of your changes

This PR addresses the issue of the AWS Lambda function invocation mode in the E2E tests for the Logger package.
Previously, multiple function invocations have always been performed in parallel. However, this made all the cold start checks impossible, because parallel invocations cause multiple cold starts.

The invokeFunction helper function now has an additional optional parameter invocationMode with allowed options PARALLEL or SEQUENTIAL. This parameter lets the invokers control how to call the function-under-test.

Note: the parameter is of a union type which differs from the original proposal of a boolean parameter.
The reasoning behind it is simple: it makes the code easier to read.
Compare:

invocationLogs = await invokeFunction(functionName, 2, false); // what does 'false' mean? need to delve

with

invocationLogs = await invokeFunction(functionName, 2, 'SEQUENTIAL'); // 100% clear

How to verify this change

Run the E2E tests for the Logger package. The test should include cold start equal to TRUE only on the first invocation has to pass.
Follow the steps from the Reproduce section from #590. Only one initialization section has to appear.

Related issues, RFCs

#590

PR status

Is this ready for review?: YES
Is it a breaking change?: NO

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding changes to the examples
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published in downstream module
  • The PR title follows the conventional commit semantics

Breaking change checklist

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

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

@github-actions github-actions bot added the bug Something isn't working label Mar 14, 2022
@dreamorosi dreamorosi added this to the production-ready-release milestone Mar 14, 2022
@dreamorosi dreamorosi assigned ghost Mar 14, 2022
@dreamorosi dreamorosi added the logger This item relates to the Logger Utility label Mar 14, 2022
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Great one, thanks a lot!

@dreamorosi dreamorosi merged commit 800424b into aws-powertools:main Mar 14, 2022
@ghost ghost deleted the fix/e2e-sequential-invocation branch March 14, 2022 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logger This item relates to the Logger Utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants