{"action":"created","issue":{"url":"https://api.github.com/repos/shoreditch-ops/artillery/issues/508","repository_url":"https://api.github.com/repos/shoreditch-ops/artillery","labels_url":"https://api.github.com/repos/shoreditch-ops/artillery/issues/508/labels{/name}","comments_url":"https://api.github.com/repos/shoreditch-ops/artillery/issues/508/comments","events_url":"https://api.github.com/repos/shoreditch-ops/artillery/issues/508/events","html_url":"https://github.com/shoreditch-ops/artillery/issues/508","id":345122370,"node_id":"MDU6SXNzdWUzNDUxMjIzNzA=","number":508,"title":"How to write my own engine? Docs?","user":{"login":"rvetere","id":1505976,"node_id":"MDQ6VXNlcjE1MDU5NzY=","avatar_url":"https://avatars0.githubusercontent.com/u/1505976?v=4","gravatar_id":"","url":"https://api.github.com/users/rvetere","html_url":"https://github.com/rvetere","followers_url":"https://api.github.com/users/rvetere/followers","following_url":"https://api.github.com/users/rvetere/following{/other_user}","gists_url":"https://api.github.com/users/rvetere/gists{/gist_id}","starred_url":"https://api.github.com/users/rvetere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvetere/subscriptions","organizations_url":"https://api.github.com/users/rvetere/orgs","repos_url":"https://api.github.com/users/rvetere/repos","events_url":"https://api.github.com/users/rvetere/events{/privacy}","received_events_url":"https://api.github.com/users/rvetere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-27T07:37:01Z","updated_at":"2018-07-27T09:15:19Z","closed_at":null,"author_association":"NONE","body":"Hi i found the repository \"https://github.com/shoreditch-ops/artillery-engine-kinesis\" which seems to solve exactly what i need - writing my own engine.. I did it already by forking the whole artillery repository and got it running, but it feels as a total overkill to fork the whole thing just to introduce a new engine.\r\n\r\nBut when i see code like this:\r\n\r\n```\r\n      let runnerEngines = _.map(\r\n      Object.assign({}, Engines, runnableScript.config.engines),\r\n      function loadEngine(engineConfig, engineName) {\r\n        let moduleName = 'artillery-engine-' + engineName;\r\n        try {\r\n          if (Engines[engineName]) {\r\n            moduleName = './engine_' + engineName;\r\n          }\r\n          let Engine = require(moduleName);\r\n     ....\r\n```\r\n\r\n-> the runner code is hardcoded looking into his own folder relatively with all the entries of \"Engines\"... i don't see how this should be dynamically able to pick up some new written engines at all oO\r\n\r\nSo... how should this work?"},"comment":{"url":"https://api.github.com/repos/shoreditch-ops/artillery/issues/comments/408361851","html_url":"https://github.com/shoreditch-ops/artillery/issues/508#issuecomment-408361851","issue_url":"https://api.github.com/repos/shoreditch-ops/artillery/issues/508","id":408361851,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODM2MTg1MQ==","user":{"login":"hassy","id":1490,"node_id":"MDQ6VXNlcjE0OTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1490?v=4","gravatar_id":"","url":"https://api.github.com/users/hassy","html_url":"https://github.com/hassy","followers_url":"https://api.github.com/users/hassy/followers","following_url":"https://api.github.com/users/hassy/following{/other_user}","gists_url":"https://api.github.com/users/hassy/gists{/gist_id}","starred_url":"https://api.github.com/users/hassy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hassy/subscriptions","organizations_url":"https://api.github.com/users/hassy/orgs","repos_url":"https://api.github.com/users/hassy/repos","events_url":"https://api.github.com/users/hassy/events{/privacy}","received_events_url":"https://api.github.com/users/hassy/received_events","type":"User","site_admin":false},"created_at":"2018-07-27T09:15:19Z","updated_at":"2018-07-27T09:15:19Z","author_association":"CONTRIBUTOR","body":"hi @rvetere, the way to get it going locally is:\r\n\r\n1. Clone Artillery, run `npm install` in the directory, this will let you run a local copy of Artillery with `./bin/artillery`\r\n2. In the directory where your custom engine code is (let's say `artillery-engine-rvetere`) run `npm link`\r\n3. Back inside Artillery's source dir run `npm link artillery-engine-rvetere` (more info on [npm link](https://docs.npmjs.com/cli/link))\r\n\r\nThis will allow that copy of Artillery to find and load your custom engine. It's important that you set the engine field of your scenario:\r\n\r\n```yaml\r\nconfig:\r\n  target: \"some.target\"\r\nscenarios:\r\n  - name: \"Custom engine scenario\"\r\n    engine: \"rvetere\"\r\n    flow:\r\n     - do: something\r\n     - do: something else\r\n```"}}
{"actor":{"display_login":"hassy"}}