Browse Source

tests: re-enable policy prompt tests in travis

Xenial environment has much newer GTK/Glib. For those test to run, few
more changes are needed:
 - relevant GTK packages installed
 - X server running (otherwise GTK terminate the process on module
   import...)
 - enable system side packages in virtualenv set by travis
Marek Marczykowski-Górecki 5 years ago
parent
commit
65bdff1fdf
2 changed files with 10 additions and 7 deletions
  1. 5 0
      .travis.yml
  2. 5 7
      qubes/tests/__init__.py

+ 5 - 0
.travis.yml

@@ -3,7 +3,12 @@ dist: xenial
 language: python
 python:
   - '3.5'
+virtualenv:
+  system_site_packages: true
+services:
+  - xvfb
 install:
+  - sudo apt-get -y install python3-gi gir1.2-gtk-3.0
   - pip install --quiet -r ci/requirements.txt
   - git clone https://github.com/"${TRAVIS_REPO_SLUG%%/*}"/qubes-builder ~/qubes-builder
 script:

+ 5 - 7
qubes/tests/__init__.py

@@ -1347,13 +1347,11 @@ def load_tests(loader, tests, pattern): # pylint: disable=unused-argument
             ):
         tests.addTests(loader.loadTestsFromName(modname))
 
-    # GTK/Glib is way too old there
-    if 'TRAVIS' not in os.environ:
-        for modname in (
-                'qubespolicy.tests.gtkhelpers',
-                'qubespolicy.tests.rpcconfirmation',
-                ):
-            tests.addTests(loader.loadTestsFromName(modname))
+    for modname in (
+            'qubespolicy.tests.gtkhelpers',
+            'qubespolicy.tests.rpcconfirmation',
+            ):
+        tests.addTests(loader.loadTestsFromName(modname))
 
     tests.addTests(loader.discover(
         os.path.join(os.path.dirname(__file__), 'tools')))