pronto
pronto copied to clipboard
How to write a pronto runner ?
I cannot seem to find docs how to write a new pronto runner and how to run/test it locally. Would be great if i can get some help.
Basically i want to see if i can write a pronto which can look at change and comment if its allowed or not.
I've added a PR (#242) that references an article I wrote that covers this creation point. Hopefully that does the trick for this issue.
I want to say that the best way to approach this is to look at some of the existing runners. They more or less follow a pattern in how they are built.
As for testing, it seems like common the approach is to create a temp git repository in your specs and set up various conditions that exercises your runner and verify the messages outputted. For example, I used this approach for pronto-flow and created a set of helpers to manage the temp git repository.
A final effort for testing is to simply reference your gem in a project locally in your Gemfile. gem "pronto-awesome", path: "../path/to/dir"
. Although with proper testing, as mentioned in the previous section this acts as a sanity test.
@kevinjalbert I love the article, but I want to keep this issue open. As creation of new runners is very important, I think that we need even more documentation 🙂
@mmozuras That works for me ;) More documentation never hurts.
@mmozuras did you have additional documentation in mind?
@doomspork yes, I'd like it to be more extensively documented. I think that documentation should reside in this or https://github.com/prontolabs/welcome repo.
How to set up a runner without setting up a gem? Like for rubocop, you can define custom cop in the repo and add them in the config file with require like this
# -- rubocop adding custom, local cop
require:
- ./linters/feature_spec_rollout.rb