Wikimedia Discovery/BrowserBot

From mediawiki.org

Who is Cindy?[edit]

Cindy is a browser test bot running on cirrus-integ.eqiad.wmflabs. Cindy queries gerrit for patches she has not yet voted on within the CirrusSearch repository every 10 minutes. For those patches she has not yet voted on she checks them out and runs the browser tests. Tests run against cirrustestwiki and commonswiki.

This is a fork of Barry-the-Browser-Test-Bot and runs under the gerrit username Cindy-the-browser-test-bot.

If some tests are intermittently failing[edit]

If some tests are intermittently failing and you can't fix it yet, tag them as @expect_failure so they are excluded from voting.

Other Details[edit]

The server is cirrus-integ.search.eqiad.wmflabs

The code for the bot itself is in /srv/Barry-the-Browser-Test-Bot/barrybot.py

The code that runs in a loop, runs the bot regularly and provides it options is in /home/cindy/run-cindy.sh

Because the python bot is run in a loop from a shell script nothing special needs to be done when updating the python code. The next loop through will pick up the new code. If the loop needs to be restarted to pick up new arguments kill the old one and start a new one as the `cindy` user.

Running individual test[edit]

  1. Log in to cirrus-integ.eqiad.wmflabs
  2. sudo -u cindy -i
  3. cd /srv/mediawiki-vagrant/mediawiki/extensions/CirrusSearch/tests/browser
  4. bundle exec cucumber features/YOURTEST.feature

Some things that might, or might not help[edit]

Delete every last index in elasticsearch

mwscript extensions/CirrusSearch/tests/jenkins/nukeAllIndexes.php

Delete and recreate indexes for named wikis. Commons must be indexed before cirrustest or the OtherIndex values will be incorrect.

for wiki in commonswiki cirrustestwiki; do
  mwscript extensions/CirrusSearch/tests/jenkins/cleanSetup.php --wiki=$wiki
done

If a class is missing this will pull in the latest dependencies.

cd /vagrant/mediawiki && composer update

Brute force reinitialization of the database

for wiki in commonswiki cirrustestwiki; do 
  ( echo "drop database $wiki; create database $wiki;" && \
    cat /vagrant/mediawiki/maintenance/tables.sql ) \
    | mysql
  mwscript update.php --wiki=$wiki --quick
done

When the system first starts up it can get into a state where it thinks no wikis exist. This happens because somehow apache gets a handle on /vagrant before the nfs mount and sees an empty directory. To fix restart apache

 sudo service apache restart