-
Notifications
You must be signed in to change notification settings - Fork 517
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: async hooks and ESM #2522
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
Not sure what's going on with Socket Security here - none of the dependencies it listed as new are in fact new other than |
@SocketSecurity ignore-all |
hassy
changed the title
feat: add support for async functions in HTTP and WebSocket engines
feat: async hooks and ESM
Feb 28, 2024
bernardobridge
previously requested changes
Feb 29, 2024
Also is it possible to add a test for the |
Yep, tests to be added. |
hassy
force-pushed
the
feat/async-hooks
branch
from
February 29, 2024 21:50
1d1371f
to
3db53eb
Compare
2 tasks
* Update signatures of async hooks * Remove check for exit code Throwing from an async hook is the equivalent of calling the done() callback with an Error object in a callback-based hook. The error is shown as an entry in the metric report, and does not stop the entire Artillery process.
The test is not checking the stacktraces as described. Would require intercepting the error object at the point it gets tracked via a metric - not straightforward.
hassy
force-pushed
the
feat/async-hooks
branch
from
February 29, 2024 23:19
3db53eb
to
6c8e3f5
Compare
This was referenced Mar 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR add support for using async functions as hooks in HTTP and WebSocket engines, and the ability to load ES modules via
config.processor
.Hooks:
beforeRequest
,afterResponse
,beforeScenario
,afterScenario
, andfunction
hooks in the HTTP enginefunction
hook in the WebSocket engineESM:
.mjs
, it will beimport()
'ed rather thanrequire()
'd.Fixes #1269 #1384