Mikhail Korobov  committed b5c6e4d

Code coverage integration

  • Participants
  • Parent commits 8308d67
  • Branches default

Comments (0)

Files changed (4)

 #misc files
 #os files

File docs/testing.rst

 In order to run tests you'll need `VirtualBox`_ 4.x and a configured OS image.
-Image should:
+Images should:
 * have root user with '123' password
 * have openssh server installed
 Tests can take a long time to run because VM is rolled back to clean
 state before each test.
+In order to get coverage reports, install (``pip install coverage``)
+and the run::
+    cd fab_deploy_tests
+    ./ <OS name> <VM name or uid>
+html reports will be placed in ``htmlcov`` folder.

File fab_deploy_tests/

+coverage run $*
+coverage report --include=`pwd`/../fab_deploy/*
+coverage html --include=`pwd`/../fab_deploy/*

File fab_deploy_tests/

 import subprocess
-from time import sleep
-from os import system
 from functools import partial
 from fabric import state
 from fabric.main import get_hosts
     def start(self):
-        self.startvm() #'--type', 'headless')
+        # headless variant leads to invalid snapshots for some reason
+        # (bug in virtualbox?)
+        # self.startvm('--type', 'headless')
+        self.startvm()
     def stop(self):