John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/178429

Change subject: Add developer instructions for using travis-ci
......................................................................

Add developer instructions for using travis-ci

Change-Id: Ic2fc7f0975bda22ffad03f99add2b2a383d7c791
---
M .travis.yml
M tests/README.rst
2 files changed, 55 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/29/178429/1

diff --git a/.travis.yml b/.travis.yml
index c708c6a..414475a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,5 @@
+# See tests/README.rst for instructions for using travis with developer builds.
+
 language: python
 
 python:
@@ -59,10 +61,10 @@
 
 env:
   global:
-    # This is the encrypted password, which can only be decrypted by Travis 
itself
-    # See http://docs.travis-ci.com/user/encryption-keys/
-    # And 
http://docs.travis-ci.com/user/build-configuration/#Secure-environment-variables
-    # Command use to generate: travis encrypt USER_PASSWORD=<pwd> -r 
wikimedia/pywikibot-core
+    # This is the encrypted password for Wikimedia SUL user 'Pywikibot-test',
+    # and is only decrypted by Travis when running builds of code merged into
+    # the github repository 'wikimedia/pywikibot-core'.
+    # See http://docs.travis-ci.com/user/encryption-keys/ for more information.
     - secure: 
kofInMlisiTBt9o/Ustc/vySlkKfxGzGCX2LwA1D2waym8sDTS0o5gMJ5LsrT/BUKwZbe1vLozPHqZrrkQvsdTml+DpZuotzdILs0m0f3BUoexEC6OON5IDljuxFyETrD1Ug44ih5Mc4lVFOdTcBzg501ZmswGwQrBvg/OyEFfE=
   matrix:
     - LANGUAGE=en FAMILY=wikipedia
diff --git a/tests/README.rst b/tests/README.rst
index e5e289d..4258016 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -10,8 +10,8 @@
 'load tests protocol'.
 <https://docs.python.org/2/library/unittest.html#load-tests-protocol>.
 The default ordering begins with tests of underlying components, then tests
-site and page semantics, and finishes with tests of the scripts and tests
-which are not yet included in the ordered tests.
+site and page semantics, and finishes with tests of the scripts and finally
+any tests which have not been inserted into the ordered list of tests.
 
 A function collector also exists in the 'tests' package.
 
@@ -71,6 +71,41 @@
     python pwb.py tests/site_tests.py -v
 
 
+travis-ci
+=========
+
+After changes are published into a github repository, tests may be run on
+travis-ci.org according to the configuration in .travis.yml .
+
+When changes are merged into the main repository, they are replicated to
+https://github.com/wikimedia/pywikibot-core , and travis tests are run and
+published at travis-ci.org/wikimedia/pywikibot-core/builds .  These tests
+use the Wikimedia global (SUL) account 'Pywikibot-test', which has a password
+securely stored in .travis.yml . See section env:global:secure.
+
+Anyone can run these tests on travis-ci.org using their own account, with
+code changes that have not been merged into the main repository.  To do this:
+
+1. create a github and travis-ci account
+2. fork the main github repository https://github.com/wikimedia/pywikibot-core
+3. enable builds from the travis profile page: https://travis-ci.org/profile
+4. push changes into the forked git repository
+5. watch the build at https://travis-ci.org/<username>/pywikibot-core/builds
+
+Only travis-ci builds from the main repository can access the password for the
+Wikimedia account 'Pywikibot-test'.  All tests which require a logged in user
+are skipped if the travis-ci build environment does not have a password.
+
+To enable 'user' tests on travis-ci builds for a different repository, add
+a username and password to travis:
+
+1. Go to https://travis-ci.org/<username>/pywikibot-core/settings/env_vars
+2. Add a new variable named PYWIKIBOT2_USERNAME and a value of a valid
+   Wikimedia SUL username
+3. Add another variable named USER_PASSWORD, with the private password for
+   the Wikimedia SUL username used in step 2
+4. The next build should run tests that require a logged in user
+
 Contributing tests
 ==================
 
@@ -118,6 +153,18 @@
 
     self.get_site('itwikt')
 
+For tests which require network access to a website which is not an APISite,
+the class attribute 'sites' may include a hostname.
+
+::
+
+    sites = {
+        'wdq':
+            'hostname': 'wdq.wmflabs.org',
+        }
+    }
+
+
 Other class attributes
 ----------------------
 

-- 
To view, visit https://gerrit.wikimedia.org/r/178429
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2fc7f0975bda22ffad03f99add2b2a383d7c791
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to