/
SConscript
76 lines (64 loc) · 2.69 KB
/
SConscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*- mode: python; -*-
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
Import('SandeshEnv')
env = SandeshEnv.Clone();
test_depend_modules = [
'__init__.py',
'test_utils.py',
'sandesh_req_impl.py'
]
test_depend_modules_rules = []
for module in test_depend_modules:
test_depend_modules_rules.append(
env.Install('', File(module).srcnode()))
test_modules = [
'sandesh_encode_decode_test.py',
'sandesh_msg_test.py',
'sandesh_session_test.py',
'sandesh_trace_test.py',
'sandesh_http_test.py',
'sandesh_uve_alarm_test.py',
'conn_info_test.py',
'sandesh_stats_test.py',
'work_queue_test.py'
]
test_modules_rules = []
for module in test_modules:
test_modules_rules.append(
env.Install('', File(module).srcnode()))
env.Depends(test_modules_rules, test_depend_modules_rules)
gen_test_pkg = env.SandeshGenPy('encode_decode_test.sandesh')
gen_test_pkg += env.SandeshGenPy('msg_test.sandesh')
gen_test_pkg += env.SandeshGenPy('sandesh_http_test.sandesh')
gen_test_pkg += env.SandeshGenPy('uve_alarm_test.sandesh')
gen_test_pkg += env.SandeshGenPy('#tools/sandesh/library/common/sandesh_alarm_base.sandesh')
gen_test_pkg += env.SandeshGenPy('#controller/src/base/test/connection_info_test.sandesh')
gen_test_pkg += env.SandeshGenPy('#controller/src/base/sandesh/process_info.sandesh', 'gen_py/connection_info_test/', False)
env.Depends(test_modules_rules, gen_test_pkg)
venv = env.setup_venv('pysandesh_test', 'pysandesh_test')
env['env_venv'] = venv
pip_pkgs = ['greenlet==0.4.1', 'gevent==1.1a2', 'eventlet==0.9.17',
'testtools==0.9.21', 'geventhttpclient==1.0a', 'bottle==0.11.6',
'mock==1.0.1']
sandesh_pkgs = [
env['TOP']+'/sandesh/common',
env['TOP']+'/tools/sandesh/library/python'
]
env.Requires(env['pysandesh_test'],
env['TOP']+'/tools/sandesh/library/python/dist/sandesh-0.1dev.tar.gz')
env.Requires(env['pysandesh_test'],
env['TOP']+'/sandesh/common/dist/')
_deps = []
_deps += env.venv_add_pip_pkg(venv, pip_pkgs)
_deps += env.venv_add_build_pkg(venv, map(lambda x: Dir(x).abspath, sandesh_pkgs))
pysandesh_ut = env.PyTestSuite('sandesh-py-test', test_modules, venv=env['env_venv'])
for d in _deps:
env.Requires(pysandesh_ut, d.name)
env.Depends(pysandesh_ut, test_depend_modules_rules)
env.Depends(pysandesh_ut, test_modules_rules)
env.Depends(pysandesh_ut, gen_test_pkg)
env.Alias('sandesh:pysandesh_test', pysandesh_ut)
Return('pysandesh_ut')