pronto icon indicating copy to clipboard operation
pronto copied to clipboard

How to write a pronto runner ?

Open kavink opened this issue 8 years ago • 6 comments

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.

kavink avatar Apr 07 '16 04:04 kavink

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 avatar May 30 '17 12:05 kevinjalbert

@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 avatar Jun 13 '17 19:06 mmozuras

@mmozuras That works for me ;) More documentation never hurts.

kevinjalbert avatar Jun 13 '17 19:06 kevinjalbert

@mmozuras did you have additional documentation in mind?

doomspork avatar Jul 18 '17 06:07 doomspork

@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.

mmozuras avatar Aug 15 '17 14:08 mmozuras

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

hdoan741 avatar Jun 10 '20 03:06 hdoan741