[QA] getting tests configured for a particular repository

Antoine Musso hashar+wmf at free.fr
Thu Jul 28 20:33:02 UTC 2016


On 27/07/16 18:34, Loic Dachary wrote:
> Hi,
>
> I'd like to get tests configured for a particular gerrit repository hosting a wikidata bot. Is there a document or an example I could read to know more about it ? The bot I'm writing is about 50 lines of code[1] but I'd like to go in the right direction from the start, even before actually getting a gerrit repository for it ;-)
>
> Cheers
>
> [1] https://www.wikidata.org/wiki/Wikidata:Requests_for_permissions/Bot#FLOSSbot

Hello,

What Bryan said in the other reply :]


The code at http://paste2.org/39ekOOeX suggest that it is relying on the 
awesome pywikibot.  It is a volunteer driven project with at least 
handful of very awesome developers.

There is a Gerrit hierarchy apparently hosting several bots. Maybe your 
be created there?  Check pywikibot/bots/*

You can get in touch with them via:

   IRC freenode.net #pywikibot
   List https://lists.wikimedia.org/mailman/listinfo/pywikibot

I am idling in the channel myself as 'hashar'. You will receive tip and 
tricks regarding usage of pywikibot and definitely guidelines to setup a 
proper testing env in your repository.


Pywikibot has been one of the very firsts to take testing and CI 
seriously. To a point I have no idea what kind of testing really happen 
but definitely A LOT!

How do we catch up with Jenkins?  We made it dumb and it really just:

A) clone the repository
B) run the command 'tox'
C) report SUCCESS on exit 0,  FAILURE otherwise

To setup a basic environement for python testing check:

https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Test_your_Python

The CI infrastructure configuration are the last few lines under 
"Editing Zuul configuration" which I have updated slightly.

So given you have tox setup properly, the CI part will be all about:

  clone integration/config.git
  <edit> zuul/layout.yaml

Add:

   projects:
     - name: "pywikibot/bots/LoicBot"  # or whatever nicer name
       template:
         - tox-jessie


Also poke #wikimedia-releng IRC channel if needed.


-- 
Antoine "hashar" Musso





More information about the QA mailing list