Skip to content

Commit

Permalink
Run site tests only on fr.wikt and test.wd
Browse files Browse the repository at this point in the history
Use nosetests with attribute selectors to only run tests which
will only use the site in the matrix.

Change-Id: I60f4b87ff414ba9ab32abc39bf2a90801056c8a5
  • Loading branch information
jayvdb committed Dec 7, 2014
1 parent ca55884 commit 43080de
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ before_install:
- sudo apt-get install -y liblua5.1-dev

install:
- if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install ordereddict unittest2==0.6.0; fi
- pip install six
- export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
Expand All @@ -27,6 +28,7 @@ install:

- echo "max_retries = 2" >> ~/.pywikibot/user-config.py
- echo "maximum_GET_length = 5000" >> ~/.pywikibot/user-config.py
- echo "console_encoding = 'utf8'" >> ~/.pywikibot/user-config.py

- if [[ "$GITHUB_USER" == "wikimedia" ]]; then PYWIKIBOT2_USERNAME="Pywikibot-test"; fi

Expand All @@ -44,7 +46,16 @@ install:
- python -c "import setuptools; print(setuptools.__version__)"

script:
- if [[ "$USE_NOSE" == "1" ]]; then nosetests -v ; else python setup.py test; fi
- if [[ "$USE_NOSE" == "1" ]]; then
if [[ "$SITE_ONLY" == "1" ]]; then
echo "Running site tests only code ${LANGUAGE} on family ${FAMILY}" ;
nosetests tests -v -a "family=$FAMILY,code=$LANGUAGE" ;
else
nosetests tests -v ;
fi ;
else
python setup.py test ;
fi

env:
global:
Expand All @@ -56,8 +67,8 @@ env:
matrix:
- LANGUAGE=en FAMILY=wikipedia
- LANGUAGE=ar FAMILY=wikipedia PYSETUP_TEST_EXTRAS=1
- LANGUAGE=test FAMILY=wikidata
- LANGUAGE=fr FAMILY=wiktionary
- LANGUAGE=test FAMILY=wikidata SITE_ONLY=1
- LANGUAGE=fr FAMILY=wiktionary SITE_ONLY=1

notifications:
email:
Expand Down

0 comments on commit 43080de

Please sign in to comment.