]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
tests: Add a way for the user to skip selenium tests
authorDamien Lespiau <damien.lespiau@intel.com>
Tue, 8 Sep 2015 20:54:02 +0000 (21:54 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Thu, 5 Nov 2015 04:22:55 +0000 (04:22 +0000)
It's a bit more convoluted to setup the test environment to work with
selenium (eg. needs a browser installed and Xorg running, ...). It's
possible someone would want to skip those.

v2: Use 'PW' prefix rather than 'PATCHWORK', per existing test
  parameters, and pass said variable through tox

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/tests/browser.py
tox.ini

index 18450001551f15e7aa4c02ba264942509c244b2b..80285dbd6d6eefe7e37b37e7dec844097b7786c4 100644 (file)
@@ -99,6 +99,10 @@ class SeleniumTestCase(StaticLiveServerTestCase):
     _SCREENSHOT_DIR = os.path.dirname(__file__) + '/../../selenium_screenshots'
 
     def setUp(self):
+        self.skip = os.getenv('PW_SKIP_BROWSER_TESTS', None)
+        if self.skip:
+            self.skipTest('Disabled by environment variable')
+
         super(SeleniumTestCase, self).setUp()
 
         self.browser = os.getenv('SELENIUM_BROWSER', 'chrome')
diff --git a/tox.ini b/tox.ini
index 8647cf37c34b5a727723ae21278a8b71448762a7..823d1dc8e3f741d005374f03b5699f52d30edc0b 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -19,7 +19,7 @@ commands =
 passenv =
     http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
     PW_TEST_DB_USER PW_TEST_DB_PASS
-    DISPLAY SELENIUM_BROWSER
+    DISPLAY SELENIUM_BROWSER PW_SKIP_BROWSER_TESTS
 
 [testenv:pep8]
 basepython = python2.7