-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(skip-execution): add support to display system logs #957
base: feat/skip-request
Are you sure you want to change the base?
Conversation
- fix the type of request object in jsdocs - add comments
…wrapper over events
System logs will be displayed on postman app console with special highlight, they should be used when you want to inform user that some action was taken from script.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## feat/skip-request #957 +/- ##
==================================================
Coverage 60.78% 60.78%
==================================================
Files 12 12
Lines 561 561
Branches 135 135
==================================================
Hits 341 341
Misses 220 220
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
* @param {'skip_request'} type - this is used to identify the message type in postman-app | ||
* @param {...any} args - any other information like request name to be used to generate console message | ||
*/ | ||
function dispatchSystemMessage (console, type, ...args) { |
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.
Don't think if this should be part of this module. Maybe a helper?
timers, | ||
( | ||
new PostmanAPI(execution, function (request, callback) { | ||
var eventId = timers.setEvent(callback); | ||
|
||
dispatchEvent(bridge, execution, executionRequestEventName, options.cursor, id, eventId, request); | ||
}, /* onStopExecution = */ function () { | ||
// Dispatch event to display system message on console informing user that the request | ||
// execution was skipped from script | ||
dispatchSystemMessage(postmanConsole, 'skip_request', _.get(execution, 'legacy._itemName')); |
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.
Why dispatch a system type console event? Why not a "execution_stopped" or such event? Every client can then interpret it and use it however they want to.
Also, "system" type log is not supported in Console interface either.
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.
This can also be a part of any existing events like item
event with some indication that the execution was stopped from script.
abcb20c
to
bf0e253
Compare
Stacked on top of https://github.com/postmanlabs/postman-sandbox/pull/942/files
System logs will be displayed on postman app console with special highlight, they should be used when you want to inform user that some action was taken from script.