Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 140 lines (111 sloc) 5.86 kb
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
1 # -*- mode: python -*-
2 #
3 # This SConscript file describes the build rules for smoke tests (scons smoke,
4 # e.g.)
5
6 import os
31991af ALL smoke.py invocations are done through smoke_command()
Dan Crosta authored
7 from buildscripts import utils
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
8
9 Import( "has_option env shellEnv testEnv" )
10
11 def add_exe( v ):
12 return "${PROGPREFIX}%s${PROGSUFFIX}" % v
13
14 smokeEnv = testEnv.Clone()
15 smokeEnv['ENV']['PATH']=os.environ['PATH']
41db66e add buildlogger (separate test output)
Dan Crosta authored
16
17 # copy in any envrionment variables beginning with MONGO_; these
18 # are used by buildscripts/buildlogger.py
19 for name, value in os.environ.items():
20 if name.startswith('MONGO_'):
21 smokeEnv['ENV'][name] = value
22
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
23 smokeEnv.Alias( "dummySmokeSideEffect", [], [] )
24
25 smokeFlags = []
26
27 # Ugh. Frobbing the smokeFlags must precede using them to construct
28 # actions, I think.
29 if has_option( 'smokedbprefix'):
30 smokeFlags += ['--smoke-db-prefix', GetOption( 'smokedbprefix')]
31
32 if 'startMongodSmallOplog' in COMMAND_LINE_TARGETS:
33 smokeFlags += ["--small-oplog"]
34
b1d52e5 add --smokeauth pass-through to smoke.py --auth
Dan Crosta authored
35 if has_option('smokeauth'):
36 smokeFlags += ['--auth']
37
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
38 def addTest(name, deps, actions):
39 smokeEnv.Alias( name, deps, actions )
40 smokeEnv.AlwaysBuild( name )
41 # Prevent smoke tests from running in parallel
42 smokeEnv.SideEffect( "dummySmokeSideEffect", name )
43
bbace48 BUILDBOT-95: need AlwaysBuild and SideEffect for recent failures
Dan Crosta authored
44 def addSmoketest( name, deps, extraSmokeArgs=[] ):
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
45 # Convert from smoke to test, smokeJs to js, and foo to foo
46 target = name
47 if name.startswith("smoke"):
48 if name == "smoke":
49 target = File("test").path
50 else:
51 target = name[5].lower() + name[6:]
52
bbace48 BUILDBOT-95: need AlwaysBuild and SideEffect for recent failures
Dan Crosta authored
53 smokeArgs = smokeFlags + [target] + extraSmokeArgs
51e9b45 SERVER-5057 safely invoke smoke.py from SConscript.smoke
Dan Crosta authored
54 addTest(name, deps, utils.run_smoke_command(*smokeArgs))
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
55
a6989ad allow db modules to declare scripts that are run as a test suite
Dan Crosta authored
56 def addSmokeSuite( name, suitefile ):
57 # Add a smoketest target which invokes smoke.py with
58 # --from-file, and passes the named suitefile as the
59 # command line argument.
60
61 # resolve an initial # in the suitefile
62 suitefile = str(env.File(suitefile))
63
64 addTest(name, [suitefile],
65 utils.run_smoke_command('--mode', 'files', '--from-file', suitefile))
66
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
67 addSmoketest( "smoke", [ add_exe( "test" ), add_exe( "mongod" ), add_exe( "mongo" ) ] )
68 addSmoketest( "smokePerf", [ add_exe("perftest") ] )
69 addSmoketest( "smokeClient", [
70 add_exe('firstExample'),
71 add_exe('rsExample'),
72 add_exe('secondExample'),
73 add_exe('whereExample'),
74 add_exe('authTest'),
75 add_exe('httpClientTest'),
76 add_exe('bsondemo'),
77 add_exe('clientTest'),
78 ] )
79 addSmoketest( "mongosTest", [ add_exe( 'mongos' ) ])
a6989ad allow db modules to declare scripts that are run as a test suite
Dan Crosta authored
80 addSmokeSuite( "smokeCppUnittests", "$UNITTEST_LIST" )
81 addSmokeSuite( "smokeModuleTests", "$MODULETEST_LIST" )
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
82
83 # These tests require the mongo shell
84 if shellEnv is not None:
2dc4657 BUILDBOT-104 remove startMongod, add mongod dep for most tests
Dan Crosta authored
85 addSmoketest( "smokeJs", [add_exe("mongo"), add_exe("mongod")] )
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
86 addSmoketest( "smokeClone", [ add_exe("mongo"), add_exe("mongod") ] )
87 addSmoketest( "smokeRepl", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
88 addSmoketest( "smokeReplSets", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
89 addSmoketest( "smokeDur", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe('mongorestore') ] )
90 addSmoketest( "smokeDisk", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongodump" ), add_exe( "mongorestore" ) ] )
91 addSmoketest( "smokeAuth", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
92 addSmoketest( "smokeParallel", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
e6617d6 @RedBeard0531 Support GridFS with fs.chunks sharded on {files_id:1, n:1} SERVER-3746
RedBeard0531 authored
93 addSmoketest( "smokeSharding", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongos"), add_exe('mongofiles') ] )
2dc4657 BUILDBOT-104 remove startMongod, add mongod dep for most tests
Dan Crosta authored
94 addSmoketest( "smokeJsPerf", [ add_exe("mongo"), add_exe("mongod") ] )
b216136 @milkie slowNightly/slowWeekly uses mongos
milkie authored
95 addSmoketest( "smokeJsSlowNightly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
96 addSmoketest( "smokeJsSlowWeekly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
2dc4657 BUILDBOT-104 remove startMongod, add mongod dep for most tests
Dan Crosta authored
97 addSmoketest( "smokeQuota", [ add_exe("mongo"), add_exe("mongod") ] )
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
98 addSmoketest( "smokeTool", [ add_exe( "mongo" ), add_exe("mongod"), add_exe("mongos"), "tools" ] )
28abf4c @RedBeard0531 aggregation tests now depend on mongos
RedBeard0531 authored
99 addSmoketest( "smokeAggregation", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
ec9d17b Add multiVersion tests to SConscript.smoke
Greg Studer authored
100 addSmoketest( "smokeMultiVersion", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
101
bbace48 BUILDBOT-95: need AlwaysBuild and SideEffect for recent failures
Dan Crosta authored
102 addSmoketest( "smokeFailingTests", [ add_exe( "mongo" ), add_exe( "mongod" ) ], ['--only-old-fails', '--continue-on-failure'] )
103 addSmoketest( "smokeResetFails", [ add_exe( "mongo" ), add_exe( "mongod" ) ], ['--reset-old-fails'] )
fe8cd5a scons can run smoke.py --only-old-fails and --reset-old-fails
Dan Crosta authored
104
30668e1 @andy10gen SCons updates to support variant directories.
andy10gen authored
105 smokeEnv.Alias( "startMongodSmallOplog", [add_exe("mongod")], [] );
106 smokeEnv.AlwaysBuild( "startMongodSmallOplog" );
107 smokeEnv.SideEffect( "dummySmokeSideEffect", "startMongodSmallOplog" )
108
109 def addMongodReqTargets( env, target, source ):
110 mongodReqTargets = [ "smokeClient", "smokeJs" ]
111 for target in mongodReqTargets:
112 smokeEnv.Depends( target, "startMongod" )
113 smokeEnv.Depends( "smokeAll", target )
114
115 smokeEnv.Alias( "addMongodReqTargets", [], [addMongodReqTargets] )
116 smokeEnv.AlwaysBuild( "addMongodReqTargets" )
117
118 smokeEnv.Alias( "smokeAll", [ "smoke", "mongosTest", "smokeClone", "smokeRepl", "addMongodReqTargets", "smokeDisk", "smokeAuth", "smokeSharding", "smokeTool" ] )
119 smokeEnv.AlwaysBuild( "smokeAll" )
120
121 def addMongodReqNoJsTargets( env, target, source ):
122 mongodReqTargets = [ "smokeClient" ]
123 for target in mongodReqTargets:
124 smokeEnv.Depends( target, "startMongod" )
125 smokeEnv.Depends( "smokeAllNoJs", target )
126
127 smokeEnv.Alias( "addMongodReqNoJsTargets", [], [addMongodReqNoJsTargets] )
128 smokeEnv.AlwaysBuild( "addMongodReqNoJsTargets" )
129
130 smokeEnv.Alias( "smokeAllNoJs", [ "smoke", "mongosTest", "addMongodReqNoJsTargets" ] )
131 smokeEnv.AlwaysBuild( "smokeAllNoJs" )
132
133 def run_shell_tests(env, target, source):
134 from buildscripts import test_shell
135 test_shell.mongo_path = windows and "mongo.exe" or "mongo"
136 test_shell.run_tests()
137
138 env.Alias("test_shell", [], [run_shell_tests])
139 env.AlwaysBuild("test_shell")
Something went wrong with that request. Please try again.