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

[Bug Report] It is not possible to load a processor when this plugin is enabled #34

Open
RichardSieg opened this issue Feb 7, 2022 · 2 comments

Comments

@RichardSieg
Copy link

RichardSieg commented Feb 7, 2022

I tried loading some custom JS code to load and transform the request body. However, this is not possible when this plugin is activated. I get the following error message

TypeError: Cannot create property 'addAmazonSignatureV4' on string './load-examples.js'

My config (the relevant part)

config:
  target: something.com
  plugins:
    aws-sigv4:
      serviceName: execute-api
    expect: {}
  processor: "./load-examples.js"

I guess this is due to the following line of code:

scriptConfig.processor.addAmazonSignatureV4 = function (requestParams, context, ee, callback) {

@RichardSieg
Copy link
Author

I guess I have fixed it. In the beginning of the init function we have to check the following:

if (typeof process.env.LOCAL_WORKER_ID === 'undefined') {
    debug('Not running in a worker, exiting');
    return;
  }

I created an own fork where I also restructured the plugin to fit the documentation on how to write plugins. See
https://github.com/RichardSieg/artillery-plugin-aws-sigv4/tree/feature/fix-custom-processor

@RJKeane2000
Copy link

@RichardSieg I ran into this same issue and tried out your version. It worked great! I'm looking forward to it being merged and a new build. Thanks for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants