I'm trying to develop a artillery runner which can run artillery json for arbitrary modules. I'm currently spawning child processes and executing the script via CLI. But doing all that in a cross platform way is a real pain and buggy.
Would be great to have the artillery commands exposed for consumption via Javascript. Specifically, something like:
var artillery = require('artillery')
artillery.run(...)
artillery.report(...)
...
I can see the use-case but this wouldn't be a high priority feature. I would personally rather continue improving the CLI to make using it in shell scripts easier.
That said, a nice PR that implements a simple solution that wouldn't need much maintenance would be gladly received. :)
@hassy I think I was shortsighted on this one. Exposing the commands doesn't do much due to the way things are laid out right now.
What I was looking for is an ability to run tests through code, something like:
artillery.run({
script: path/to/myscript | filestream
options: ...
)
.on('phasesStarted', handler)
.on('stats', handler)
.on('complete', handler)
The way I see it is to refactor commands/runner and runner.js to expose such an API surface. I can work on a PR if you're open to this.
It looks like artillery-core is the way to go for cases like this?
Most helpful comment
@hassy I think I was shortsighted on this one. Exposing the commands doesn't do much due to the way things are laid out right now.
What I was looking for is an ability to run tests through code, something like:
The way I see it is to refactor
commands/runnerandrunner.jsto expose such an API surface. I can work on a PR if you're open to this.