Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tests: Integrate unit tests into setup.py

We *only* run unit tests here, because we want to avoid running
heavyweight backend specific tests during package installation (which
probably will fail anyway).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information...
commit 464230602d2f37ac6f6ed0f5a5945d52ab7e914a 1 parent f110e87
@aszlig aszlig authored
Showing with 21 additions and 3 deletions.
  1. +1 −1  release.nix
  2. +20 −2 setup.py
View
2  release.nix
@@ -77,7 +77,7 @@ rec {
export PATH=$(pwd)/scripts:$PATH
'';
- doCheck = false;
+ doCheck = true;
postInstall =
''
View
22 setup.py
@@ -1,5 +1,22 @@
-from distutils.core import setup
-import glob
+import sys
+import subprocess
+
+from distutils.core import setup, Command
+
+
+class TestCommand(Command):
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ ret = subprocess.call([sys.executable, 'tests.py', 'tests/unit'])
+ raise SystemExit(ret)
+
setup(name='nixops',
version='@version@',
@@ -9,4 +26,5 @@
author_email='eelco.dolstra@logicblox.com',
scripts=['scripts/nixops'],
packages=['nixops', 'nixops.resources', 'nixops.backends'],
+ cmdclass={'test': TestCommand}
)
Please sign in to comment.
Something went wrong with that request. Please try again.