Open tresor616 opened 7 years ago
The reason is zero-config discovery of plugins, i.e. as a user you just need to add the name of the plugin + its settings to your test script, and Artillery will know how to load it.
Can you give a bit more detail on why that doesn't work for private plugins?
We package our custom packages in scopes/namespaces, e.g. @organization_name/package_name because there could be a clashing name in some of our registered repositories.
Enforcing the prefix "artillery-plugin-" suggests there would be a universal distinct list of package names which is not always the case, take an example with artillery on github, its https://github.com/shoreditch-ops/artillery instead of https://github.com/artillery because many people/namespaces can have the same name.
I need to be sure at all times that when I run npm install, my custom package will be loaded. I suggest the code below just read the plugin name as provided
...
let requireString = 'artillery-plugin-' + pluginName;
let Plugin, plugin;
try {
Plugin = require(requireString);
...
I am happy to submit a pull request for this change.
Cool. Will gladly accept a PR which allows something like:
config:
plugins:
some-custom-plugin:
package: "@prefix/some-package-name"
option1: "something"
option2: "somethingElse"
scenarios:
# ...
To load the plugin from @prefix/some-package-name
rather than artillery-plugin-some-custom-plugin
.
I don't seem to have write access to this repo, I was trying to push a branch
You need to fork and send a pull request.
On Friday, 28 October 2016, Treasure Mathala notifications@github.com wrote:
I don't seem to have write access to this repo, I was trying to push a branch
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shoreditch-ops/artillery-core/issues/108#issuecomment-256869016, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAF0qV1aauUAnSzaIT2wsnzKcFDrbu1ks5q4bcAgaJpZM4KiXys .
Two things to do before we can close this:
scope
attribute optional
What's the reason for having the 'artillery-plugin-' prefix?
Many organizations keep their own repositories for obvious reasons and with that comes varying naming conventions. More flexibility should be allowed here.