diff options
-rw-r--r-- | SConstruct | 12 | ||||
-rw-r--r-- | etc/evergreen.yml | 22 | ||||
-rw-r--r-- | site_scons/site_tools/mongo_integrationtest.py | 50 |
3 files changed, 82 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index c23a19762fb..26fcc887a3b 100644 --- a/SConstruct +++ b/SConstruct @@ -564,7 +564,13 @@ def decide_platform_tools(): def variable_tools_converter(val): tool_list = shlex.split(val) return tool_list + [ - "jsheader", "mergelib", "mongo_unittest", "textfile", "distsrc", "gziptool" + "distsrc", + "gziptool", + "jsheader", + "mergelib", + "mongo_integrationtest", + "mongo_unittest", + "textfile", ] def variable_distsrc_converter(val): @@ -811,6 +817,8 @@ envDict = dict(BUILD_ROOT=buildDir, # TODO: Move unittests.txt to $BUILD_DIR, but that requires # changes to MCI. UNITTEST_LIST='$BUILD_ROOT/unittests.txt', + INTEGRATION_TEST_ALIAS='integration_tests', + INTEGRATION_TEST_LIST='$BUILD_ROOT/integration_tests.txt', CONFIGUREDIR=sconsDataDir.Dir('sconf_temp'), CONFIGURELOG=sconsDataDir.File('config.log'), INSTALL_DIR=installDir, @@ -2457,4 +2465,4 @@ env.Alias("distsrc", "distsrc-tgz") env.SConscript('src/SConscript', variant_dir='$BUILD_DIR', duplicate=False) -env.Alias('all', ['core', 'tools', 'dbtest', 'unittests']) +env.Alias('all', ['core', 'tools', 'dbtest', 'unittests', 'integration_tests']) diff --git a/etc/evergreen.yml b/etc/evergreen.yml index f3a41b3a742..175ebe0d1af 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -297,6 +297,8 @@ tasks: - "./**.pdb" - "./**.msi" - "./etc/*san.suppressions" + - "./build/integration_tests/**" + - "./build/integration_tests.txt" exclude_files: - "*_test.pdb" - func: "upload debugsymbols" @@ -608,6 +610,22 @@ tasks: resmoke_args: --suites=gle_auth_basics_passthrough --shellWriteMode=commands --storageEngine=wiredTiger - <<: *task_template + name: integration_tests_standalone + commands: + - func: "do setup" + - func: "run tests" + vars: + resmoke_args: --suites=integration_tests_standalone + +- <<: *task_template + name: integration_tests_replset + commands: + - func: "do setup" + - func: "run tests" + vars: + resmoke_args: --suites=integration_tests_replset + +- <<: *task_template name: sharding_gle_auth_basics_passthrough commands: - func: "do setup" @@ -1595,6 +1613,8 @@ buildvariants: - name: gle_auth_basics_passthrough_WT - name: gle_auth_basics_passthrough_write_cmd - name: gle_auth_basics_passthrough_write_cmd_WT + - name: integration_tests_standalone + - name: integration_tests_replset - name: sharding_gle_auth_basics_passthrough - name: sharding_gle_auth_basics_passthrough_WT - name: sharding_gle_auth_basics_passthrough_write_cmd @@ -2429,6 +2449,8 @@ buildvariants: - name: disk - name: durability - name: failpoints + - name: integration_tests_standalone + - name: integration_tests_replset - name: jsCore - name: jsCore_WT - name: jsCore_compatibility diff --git a/site_scons/site_tools/mongo_integrationtest.py b/site_scons/site_tools/mongo_integrationtest.py new file mode 100644 index 00000000000..ad87ef8c0f8 --- /dev/null +++ b/site_scons/site_tools/mongo_integrationtest.py @@ -0,0 +1,50 @@ +"""Pseudo-builders for building and registering integration tests. +""" + +def exists(env): + return True + +def register_integration_test(env, test): + installed_test = env.Install("#/build/integration_tests/", test) + env['INTEGRATION_TEST_LIST_ENV']._IntegrationTestList('$INTEGRATION_TEST_LIST', installed_test) + +def integration_test_list_builder_action(env, target, source): + print "Generating " + str(target[0]) + ofile = open(str(target[0]), 'wb') + try: + for s in source: + print '\t' + str(s) + ofile.write('%s\n' % s) + finally: + ofile.close() + +def build_cpp_integration_test(env, target, source, **kwargs): + libdeps = kwargs.get('LIBDEPS', []) + libdeps.append( '$BUILD_DIR/mongo/unittest/integration_test_main' ) + + includeCrutch = True + if "NO_CRUTCH" in kwargs: + includeCrutch = not kwargs["NO_CRUTCH"] + + if includeCrutch: + libdeps.append( '$BUILD_DIR/mongo/unittest/unittest_crutch' ) + + kwargs['LIBDEPS'] = libdeps + + result = env.Program(target, source, **kwargs) + env.RegisterIntegrationTest(result[0]) + return result + +def generate(env): + # Capture the top level env so we can use it to generate the integration test list file + # indepenently of which environment CppUnitTest was called in. Otherwise we will get "Two + # different env" warnings for the unit_test_list_builder_action. + env['INTEGRATION_TEST_LIST_ENV'] = env; + integration_test_list_builder = env.Builder( + action=env.Action(integration_test_list_builder_action, "Generating $TARGET"), + multi=True) + env.Append(BUILDERS=dict(_IntegrationTestList=integration_test_list_builder)) + env.AddMethod(register_integration_test, 'RegisterIntegrationTest') + env.AddMethod(build_cpp_integration_test, 'CppIntegrationTest') + env.Alias('$INTEGRATION_TEST_ALIAS', "#/build/integration_tests/") + env.Alias('$INTEGRATION_TEST_ALIAS', '$INTEGRATION_TEST_LIST') |