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

Modern logs for invoke local command #10065

Merged
merged 2 commits into from Oct 7, 2021
Merged

Conversation

pgrzesik
Copy link
Contributor

@pgrzesik pgrzesik commented Oct 7, 2021

Addresses: #9860

@codecov
Copy link

codecov bot commented Oct 7, 2021

Codecov Report

Merging #10065 (bdea74e) into master (7c91cde) will decrease coverage by 0.02%.
The diff coverage is 42.85%.

❗ Current head bdea74e differs from pull request most recent head 0c787d8. Consider uploading reports for the commit 0c787d8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10065      +/-   ##
==========================================
- Coverage   85.53%   85.50%   -0.03%     
==========================================
  Files         333      333              
  Lines       13473    13528      +55     
==========================================
+ Hits        11524    11567      +43     
- Misses       1949     1961      +12     
Impacted Files Coverage Δ
lib/plugins/aws/package/compile/layers.js 84.21% <33.33%> (-0.74%) ⬇️
lib/plugins/aws/invokeLocal/index.js 68.70% <43.33%> (-0.12%) ⬇️
lib/plugins/standalone.js 40.74% <0.00%> (-2.40%) ⬇️
lib/plugins/aws/rollback.js 98.18% <0.00%> (-1.82%) ⬇️
commands/plugin-uninstall.js 64.17% <0.00%> (-0.44%) ⬇️
commands/plugin-install.js 62.16% <0.00%> (-0.34%) ⬇️
lib/plugins/install.js 100.00% <0.00%> (ø)
lib/plugins/aws/rollbackFunction.js 100.00% <0.00%> (ø)
lib/plugins/aws/lib/updateStack.js 98.61% <0.00%> (+0.01%) ⬆️
lib/plugins/aws/deploy/lib/uploadArtifacts.js 90.81% <0.00%> (+0.09%) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c91cde...0c787d8. Read the comment docs.

@pgrzesik pgrzesik requested a review from medikoo October 7, 2021 11:47
@@ -773,7 +819,8 @@ class AwsInvokeLocal {
const handlersContainer = require(pathToHandler);
lambda = handlersContainer[handlerName];
} catch (error) {
this.serverless.cli.consoleLog(chalk.red(inspect(error)));
legacy.consoleLog(chalk.red(inspect(error)));
writeText(inspect(error));
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be log.error ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so - it's an error that was thrown by invoked Lambda function - I think we should treat it as an output of the command because that's what it really is. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind, I though it's a different part of the code - you're right, it should be an error here

@pgrzesik pgrzesik force-pushed the modern-logs-for-invoke-local branch from 2a914bb to bdea74e Compare October 7, 2021 12:16
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

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

Looks great to me, still there's test fail on Windows

@pgrzesik pgrzesik force-pushed the modern-logs-for-invoke-local branch from bdea74e to 0c787d8 Compare October 7, 2021 12:59
@pgrzesik pgrzesik requested a review from medikoo October 7, 2021 13:27
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

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

Well done @pgrzesik !

This tests refactor was definitely painful part, great you've addressed that

@pgrzesik pgrzesik merged commit 82dd1e4 into master Oct 7, 2021
@pgrzesik pgrzesik deleted the modern-logs-for-invoke-local branch October 7, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants