diff options
author | Richard Samuels <richard.l.samuels@gmail.com> | 2022-05-04 14:53:36 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-04 16:48:59 +0000 |
commit | 329dcc7dd2030455e4cf43b2d3c3d302a373cb46 (patch) | |
tree | 1c715fee6d506b6e37f884040274a3213474b0be /site_scons | |
parent | d1a1aead64827fc55904cdfb39d459d74b5d4214 (diff) | |
download | mongo-329dcc7dd2030455e4cf43b2d3c3d302a373cb46.tar.gz |
SERVER-65339 add namespace to the filename tests
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/mongo_test_execution.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/site_scons/site_tools/mongo_test_execution.py b/site_scons/site_tools/mongo_test_execution.py index 2433e446c8c..10afeca1c0c 100644 --- a/site_scons/site_tools/mongo_test_execution.py +++ b/site_scons/site_tools/mongo_test_execution.py @@ -76,18 +76,31 @@ def generate_test_execution_aliases(env, test): continue source_name = source_base_name[:dot_idx] - if target_name == source_name: - continue - source_command = env.Command( - target=f"#+{source_name}", + # We currently create two types of commands: legacy and verbose + # ex legacy command: cancelable_operation_context_test + # ex verbose command: db_unittest_test_cancelable_operation_context_test + # i.e. Verbose incorporates the name of the unittest binary, while + # legacy only has the source file name. + # We always create the verbose command, but we only create the legacy + # command if there isn't a conflict between the target_name and + # source_name. Legacy commands must be unique + verbose_source_command = env.Command( + target=f"#+{target_name}-{source_name}", source=installed[0], action="$( $ICERUN $) ${SOURCES[0]} -fileNameFilter $TEST_SOURCE_FILE_NAME $UNITTEST_FLAGS", TEST_SOURCE_FILE_NAME=source_name, NINJA_POOL="console", ) - env.Pseudo(source_command) - env.Alias('test-execution-aliases', source_command) + env.Pseudo(verbose_source_command) + env.Alias('test-execution-aliases', verbose_source_command) + + if target_name == source_name: + continue + + alias = env.Alias(f'+{source_name}', verbose_source_command) + if len(alias[0].children()) > 1: + raise SCons.Errors.BuildError(alias[0].children()[0], f"Multiple unit test programs contain a source file named '{source_name}' which would result in an ambiguous test execution alias. Unit test source filenames are required to be globally unique.") proof_generator_command = env.Command( target=[ |