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
Concat stderr and stdout before parsing incoming events, including la… #1355
base: master
Are you sure you want to change the base?
Conversation
@@ -30,7 +30,7 @@ export default class GoRunner { | |||
} | |||
|
|||
// Make sure we have the mock-lambda runner | |||
sync('go', ['get', 'github.com/icarus-sullivan/mock-lambda@e065469']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For visibility, this is the commit hash for the mock-lambda changes icarus-sullivan/mock-lambda@b33d704
IS_LAMBDA_AUTHORIZER: | ||
event.type === 'REQUEST' || event.type === 'TOKEN', | ||
IS_LAMBDA_REQUEST_AUTHORIZER: event.type === 'REQUEST', | ||
IS_LAMBDA_TOKEN_AUTHORIZER: event.type === 'TOKEN', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed by the new mock-lambda version
Hello @icarus-sullivan, Trying to be an early adopter of this change I experienced the same problem. I tried getting your changes in two ways:
Neither Please, tell me whether I got your changes in the wrong way. Maybe it could be a problem on my side. Thanks :) |
@walterdl Can you send me a sample repo with what you have? It might sound silly, but you may or may not have to run For maximum clarity the steps I use are: my changes
mock-lambda
Code example
|
Hi @icarus-sullivan, I followed your suggested steps and the problem persisted 🙈. I tough it was going to work because I missed the Anyways, here is the sample repo that I used to test the changes: https://github.com/walterdl/golang-windows-sls-offline-log-bug. Its |
@walterdl Can you clone my sample repo here https://github.com/icarus-sullivan/go-log-patch-sample All you should have to do is:
Then you can hit the url:
|
@icarus-sullivan I tested with your sample repo but I got the same situation. None difference. I even tested it in a fresh installation of Golang in a different windows machine. However, it worked without problems in macOS. Did you really test this on a Windows machine? It's so weird that you say it works but on my side don't. |
@walterdl No I didn't test on a windows machine, I haven't owned one for over a decade. If you can help debug in any way that would be great. Let me know if you think it is related to paths not resolving correctly, that would be my only suspicion but I'm far from a windows expert. |
d5ea86d
to
22fd667
Compare
fdd1699
to
51a30e9
Compare
…test mock-lambda
Description
Merge stderr and stdout in the response parsing from go invocation
Motivation and Context
There was a check for stderr to return early during the lambda invocation. This was to improve performance as it would ignore stdout. Apparently standard log outputs will write to the stderr channel in golang, so instead we should merge all output and parse it. Any extra lines not marked with the identifier
offline_payload
will be output to the console. Also adding and pinning a change to the mock-lambda which runs the code to support SQS events as well as uses reflection to infer incoming events.Why is this change required? What problem does it solve? Issue 1352
How Has This Been Tested?
Added an additional log call in the test go runner to verify these changes fix 1352 and don't break existing functionality.