Skip to content

Commit 4642306

Browse files
committed
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 <[email protected]>
1 parent f110e87 commit 4642306

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

release.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ rec {
7777
export PATH=$(pwd)/scripts:$PATH
7878
'';
7979

80-
doCheck = false;
80+
doCheck = true;
8181

8282
postInstall =
8383
''

setup.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
from distutils.core import setup
2-
import glob
1+
import sys
2+
import subprocess
3+
4+
from distutils.core import setup, Command
5+
6+
7+
class TestCommand(Command):
8+
user_options = []
9+
10+
def initialize_options(self):
11+
pass
12+
13+
def finalize_options(self):
14+
pass
15+
16+
def run(self):
17+
ret = subprocess.call([sys.executable, 'tests.py', 'tests/unit'])
18+
raise SystemExit(ret)
19+
320

421
setup(name='nixops',
522
version='@version@',
@@ -9,4 +26,5 @@
926
author_email='[email protected]',
1027
scripts=['scripts/nixops'],
1128
packages=['nixops', 'nixops.resources', 'nixops.backends'],
29+
cmdclass={'test': TestCommand}
1230
)

0 commit comments

Comments
 (0)