SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
# -*- mode: python -*-
|
|
|
|
#
|
|
|
|
# This SConscript file describes the build rules for smoke tests (scons smoke,
|
|
|
|
# e.g.)
|
|
|
|
|
|
|
|
import os
|
2012-02-17 03:49:02 +01:00
|
|
|
from buildscripts import utils
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
|
|
|
|
Import( "has_option env shellEnv testEnv" )
|
|
|
|
|
|
|
|
def add_exe( v ):
|
|
|
|
return "${PROGPREFIX}%s${PROGSUFFIX}" % v
|
|
|
|
|
|
|
|
smokeEnv = testEnv.Clone()
|
|
|
|
smokeEnv['ENV']['PATH']=os.environ['PATH']
|
2012-02-27 20:38:33 +01:00
|
|
|
|
|
|
|
# copy in any envrionment variables beginning with MONGO_; these
|
|
|
|
# are used by buildscripts/buildlogger.py
|
|
|
|
for name, value in os.environ.items():
|
|
|
|
if name.startswith('MONGO_'):
|
|
|
|
smokeEnv['ENV'][name] = value
|
|
|
|
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
smokeEnv.Alias( "dummySmokeSideEffect", [], [] )
|
|
|
|
|
|
|
|
smokeFlags = []
|
|
|
|
|
|
|
|
# Ugh. Frobbing the smokeFlags must precede using them to construct
|
|
|
|
# actions, I think.
|
|
|
|
if has_option( 'smokedbprefix'):
|
|
|
|
smokeFlags += ['--smoke-db-prefix', GetOption( 'smokedbprefix')]
|
|
|
|
|
|
|
|
if 'startMongodSmallOplog' in COMMAND_LINE_TARGETS:
|
|
|
|
smokeFlags += ["--small-oplog"]
|
|
|
|
|
2012-02-11 04:08:13 +01:00
|
|
|
if has_option('smokeauth'):
|
|
|
|
smokeFlags += ['--auth']
|
|
|
|
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
def addTest(name, deps, actions):
|
|
|
|
smokeEnv.Alias( name, deps, actions )
|
|
|
|
smokeEnv.AlwaysBuild( name )
|
|
|
|
# Prevent smoke tests from running in parallel
|
|
|
|
smokeEnv.SideEffect( "dummySmokeSideEffect", name )
|
|
|
|
|
2012-02-24 14:00:56 +01:00
|
|
|
def addSmoketest( name, deps, extraSmokeArgs=[] ):
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
# Convert from smoke to test, smokeJs to js, and foo to foo
|
|
|
|
target = name
|
|
|
|
if name.startswith("smoke"):
|
|
|
|
if name == "smoke":
|
|
|
|
target = File("test").path
|
|
|
|
else:
|
|
|
|
target = name[5].lower() + name[6:]
|
|
|
|
|
2012-02-24 14:00:56 +01:00
|
|
|
smokeArgs = smokeFlags + [target] + extraSmokeArgs
|
2012-02-23 23:28:59 +01:00
|
|
|
addTest(name, deps, utils.run_smoke_command(*smokeArgs))
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
|
2012-09-13 17:49:26 +02:00
|
|
|
def addSmokeSuite( name, suitefile, needMongod=False ):
|
2012-07-10 17:12:35 +02:00
|
|
|
# Add a smoketest target which invokes smoke.py with
|
|
|
|
# --from-file, and passes the named suitefile as the
|
|
|
|
# command line argument.
|
|
|
|
|
|
|
|
# resolve an initial # in the suitefile
|
|
|
|
suitefile = str(env.File(suitefile))
|
|
|
|
|
2012-09-13 17:49:26 +02:00
|
|
|
smoke_args = ['--mode', 'files', '--from-file', suitefile]
|
|
|
|
if not needMongod:
|
|
|
|
smoke_args.append('--dont-start-mongod')
|
|
|
|
addTest(name, [suitefile], utils.run_smoke_command(*smoke_args))
|
2012-07-10 17:12:35 +02:00
|
|
|
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
addSmoketest( "smoke", [ add_exe( "test" ), add_exe( "mongod" ), add_exe( "mongo" ) ] )
|
|
|
|
addSmoketest( "smokePerf", [ add_exe("perftest") ] )
|
2013-05-22 03:07:48 +02:00
|
|
|
|
|
|
|
smokeClientDeps = [
|
|
|
|
add_exe('firstExample'),
|
|
|
|
add_exe('rsExample'),
|
|
|
|
add_exe('secondExample'),
|
|
|
|
add_exe('whereExample'),
|
|
|
|
add_exe('authTest'),
|
|
|
|
add_exe('httpClientTest'),
|
|
|
|
add_exe('clientTest'),
|
|
|
|
]
|
|
|
|
if has_option("sharedclient"):
|
|
|
|
smokeClientDeps += [ "sharedclient/" + name for name in smokeClientDeps ]
|
|
|
|
smokeClientDeps += [add_exe('bsondemo')]
|
|
|
|
smokeClientDeps += [add_exe('mongod'), add_exe('mongo')]
|
|
|
|
smokeClient = addSmoketest( "smokeClient", smokeClientDeps )
|
|
|
|
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
addSmoketest( "mongosTest", [ add_exe( 'mongos' ) ])
|
2012-07-10 17:12:35 +02:00
|
|
|
addSmokeSuite( "smokeCppUnittests", "$UNITTEST_LIST" )
|
|
|
|
addSmokeSuite( "smokeModuleTests", "$MODULETEST_LIST" )
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
|
|
|
|
# These tests require the mongo shell
|
|
|
|
if shellEnv is not None:
|
2012-03-20 15:22:08 +01:00
|
|
|
addSmoketest( "smokeJs", [add_exe("mongo"), add_exe("mongod")] )
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
addSmoketest( "smokeClone", [ add_exe("mongo"), add_exe("mongod") ] )
|
|
|
|
addSmoketest( "smokeRepl", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
|
|
|
|
addSmoketest( "smokeReplSets", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
|
|
|
|
addSmoketest( "smokeDur", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe('mongorestore') ] )
|
|
|
|
addSmoketest( "smokeDisk", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongodump" ), add_exe( "mongorestore" ) ] )
|
|
|
|
addSmoketest( "smokeAuth", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
|
|
|
|
addSmoketest( "smokeParallel", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
|
2012-05-09 02:16:40 +02:00
|
|
|
addSmoketest( "smokeSharding", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongos"), add_exe('mongofiles') ] )
|
2012-03-20 15:22:08 +01:00
|
|
|
addSmoketest( "smokeJsPerf", [ add_exe("mongo"), add_exe("mongod") ] )
|
2012-05-01 17:12:42 +02:00
|
|
|
addSmoketest( "smokeJsSlowNightly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
|
|
|
addSmoketest( "smokeJsSlowWeekly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
2012-03-20 15:22:08 +01:00
|
|
|
addSmoketest( "smokeQuota", [ add_exe("mongo"), add_exe("mongod") ] )
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
addSmoketest( "smokeTool", [ add_exe( "mongo" ), add_exe("mongod"), add_exe("mongos"), "tools" ] )
|
2012-07-10 23:14:18 +02:00
|
|
|
addSmoketest( "smokeAggregation", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
2012-07-16 20:51:16 +02:00
|
|
|
addSmoketest( "smokeMultiVersion", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
2012-10-29 20:24:44 +01:00
|
|
|
addSmoketest( "smokeFailPoint", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
2013-10-07 20:21:46 +02:00
|
|
|
addSmoketest( "smokeSsl", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongos"), "tools" ],
|
2013-09-25 22:42:45 +02:00
|
|
|
['--use-ssl','--use-x509'] )
|
2012-07-16 20:51:16 +02:00
|
|
|
|
2012-02-24 14:00:56 +01:00
|
|
|
addSmoketest( "smokeFailingTests", [ add_exe( "mongo" ), add_exe( "mongod" ) ], ['--only-old-fails', '--continue-on-failure'] )
|
|
|
|
addSmoketest( "smokeResetFails", [ add_exe( "mongo" ), add_exe( "mongod" ) ], ['--reset-old-fails'] )
|
2012-02-24 05:34:35 +01:00
|
|
|
|
SCons updates to support variant directories.
This patch is a reorganization of our build files, which brings them slightly
closer in line with standard SCons organization.
In particular, the SConstruct file sets up the various "build environment"
objects, by examining the local system and command line parameters. Then, it
delegates to some SConscript files, which describe build rules, like how to
compile "mongod" from source.
Typically, you would create several SConscript files for a project this large,
after breaking the project into logical sub projects, such as "platform
abstraction", "data manager", "query optimizer", etc. That will be future work.
For now, we only separate out the special rules for executing smoke tests into
SConscript.smoke. Pretty much all other build rules are in src/mongo/SConscript.
"tools" are placed in site_scons/site_tools.
This patch also includes better support for building and tracking dependencies
among static libraries ("libdeps" and "MergeLibrary"), and some incumbent, minor
restructuring.
This patch introduces a "warning" message from SCons about framework.o having
two rules that generate it. It is harmless, for now, and will be removed in
future work.
Future work also includes eliminating use of the SCons "Glob" utility, and
restructuring the source code into sensible components.
2012-01-04 20:30:29 +01:00
|
|
|
smokeEnv.Alias( "startMongodSmallOplog", [add_exe("mongod")], [] );
|
|
|
|
smokeEnv.AlwaysBuild( "startMongodSmallOplog" );
|
|
|
|
smokeEnv.SideEffect( "dummySmokeSideEffect", "startMongodSmallOplog" )
|
|
|
|
|
|
|
|
def addMongodReqTargets( env, target, source ):
|
|
|
|
mongodReqTargets = [ "smokeClient", "smokeJs" ]
|
|
|
|
for target in mongodReqTargets:
|
|
|
|
smokeEnv.Depends( target, "startMongod" )
|
|
|
|
smokeEnv.Depends( "smokeAll", target )
|
|
|
|
|
|
|
|
smokeEnv.Alias( "addMongodReqTargets", [], [addMongodReqTargets] )
|
|
|
|
smokeEnv.AlwaysBuild( "addMongodReqTargets" )
|
|
|
|
|
|
|
|
smokeEnv.Alias( "smokeAll", [ "smoke", "mongosTest", "smokeClone", "smokeRepl", "addMongodReqTargets", "smokeDisk", "smokeAuth", "smokeSharding", "smokeTool" ] )
|
|
|
|
smokeEnv.AlwaysBuild( "smokeAll" )
|
|
|
|
|
|
|
|
def addMongodReqNoJsTargets( env, target, source ):
|
|
|
|
mongodReqTargets = [ "smokeClient" ]
|
|
|
|
for target in mongodReqTargets:
|
|
|
|
smokeEnv.Depends( target, "startMongod" )
|
|
|
|
smokeEnv.Depends( "smokeAllNoJs", target )
|
|
|
|
|
|
|
|
smokeEnv.Alias( "addMongodReqNoJsTargets", [], [addMongodReqNoJsTargets] )
|
|
|
|
smokeEnv.AlwaysBuild( "addMongodReqNoJsTargets" )
|
|
|
|
|
|
|
|
smokeEnv.Alias( "smokeAllNoJs", [ "smoke", "mongosTest", "addMongodReqNoJsTargets" ] )
|
|
|
|
smokeEnv.AlwaysBuild( "smokeAllNoJs" )
|
|
|
|
|
|
|
|
def run_shell_tests(env, target, source):
|
|
|
|
from buildscripts import test_shell
|
|
|
|
test_shell.mongo_path = windows and "mongo.exe" or "mongo"
|
|
|
|
test_shell.run_tests()
|
|
|
|
|
|
|
|
env.Alias("test_shell", [], [run_shell_tests])
|
|
|
|
env.AlwaysBuild("test_shell")
|