[QA] getting tests configured for a particular repository

Bryan Davis bd808 at wikimedia.org
Thu Jul 28 16:22:28 UTC 2016


On Wed, Jul 27, 2016 at 10:34 AM, Loic Dachary <loic at dachary.org> 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

I sent you to this list and then you got no responses. :(

The CI project page on mediawiki.org [0] is probably the place to
start hunting for docs. The Tutorials [1] sub-page looks promising at
first but then leads to quite a few stubs that could use some
attention.

We use Jenkins Job Builder [2] to generate Jenkins configuration and
Zuul [3] to fire off jobs based on changes uploaded to Gerrit. Most
(all?) of the configuration is in the integration/config repo [4]. My
understanding is that the tooling has been heavily inspired by how the
OpenStack project manages their CI pipeline.

* If your code is written in PHP then using a composer.json with a
"test" command entry is probably the easiest thing to get wired up.
See the CDB library for a basic example [5].
* For Python, using tox is the current best practice. An example of
that can be seen in the operations/docker-images/toollabs-images repo
[6].
* There are also pre-made job templates for running `bundle exec rake
test` (Ruby), `npm test` (Node), and `maven clean package` (Java).

[0]: https://www.mediawiki.org/wiki/Continuous_integration
[1]: https://www.mediawiki.org/wiki/Continuous_integration/Tutorials
[2]: https://www.mediawiki.org/wiki/Continuous_integration/Jenkins_job_builder
[3]: https://www.mediawiki.org/wiki/Continuous_integration/Zuul
[4]: https://github.com/wikimedia/integration-config
[5]: https://github.com/wikimedia/cdb/blob/master/composer.json
[6]: https://github.com/wikimedia/operations-docker-images-toollabs-images/blob/master/tox.ini

Bryan
-- 
Bryan Davis              Wikimedia Foundation    <bd808 at wikimedia.org>
[[m:User:BDavis_(WMF)]]  Sr Software Engineer            Boise, ID USA
irc: bd808                                        v:415.839.6885 x6855



More information about the QA mailing list