diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2023-01-28 06:40:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-01-28 07:19:57 +0000 |
commit | deaca4f6d2dfced173ce19c15a19577672a41b6b (patch) | |
tree | eb3acf9ada534e034c18ecf666d30cbd8ebc07b0 | |
parent | c0c24156d6899b5cac38a5c8f0ebc797a5bd566c (diff) | |
download | mongo-deaca4f6d2dfced173ce19c15a19577672a41b6b.tar.gz |
SERVER-73424 disable generating reports for mongo tidy check unittests.
-rwxr-xr-x | buildscripts/clang_tidy.py | 11 | ||||
-rw-r--r-- | src/mongo/tools/mongo_tidy_checks/tests/MongoTidyCheck_unittest.py | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/buildscripts/clang_tidy.py b/buildscripts/clang_tidy.py index 93fddeb02b6..9bcd0ae993c 100755 --- a/buildscripts/clang_tidy.py +++ b/buildscripts/clang_tidy.py @@ -137,6 +137,8 @@ def main(): help="Log errors to console") parser.add_argument("-l", "--log-file", type=str, default="clang_tidy", help="clang tidy log from evergreen") + parser.add_argument("--disable-reporting", action='store_true', default=False, + help="Disable generating the report file for evergreen perf.send") parser.add_argument("-m", "--check-module", type=str, default="build/install/lib/libmongo_tidy_checks.so", help="Path to load the custom mongo checks module.") @@ -221,10 +223,11 @@ def main(): subprocess.run(["tar", "-czvf", args.output_dir + ".tgz", args.output_dir], check=False) # create report and dump to report.json - error_file_contents = __dedup_errors(clang_tidy_errors_futures) - report = make_report(args.log_file, error_file_contents, 1 if failed_files > 0 else 0) - try_combine_reports(report) - put_report(report) + if not args.disable_reporting: + error_file_contents = __dedup_errors(clang_tidy_errors_futures) + report = make_report(args.log_file, error_file_contents, 1 if failed_files > 0 else 0) + try_combine_reports(report) + put_report(report) return failed_files diff --git a/src/mongo/tools/mongo_tidy_checks/tests/MongoTidyCheck_unittest.py b/src/mongo/tools/mongo_tidy_checks/tests/MongoTidyCheck_unittest.py index 99ce4906d31..4af199d2a91 100644 --- a/src/mongo/tools/mongo_tidy_checks/tests/MongoTidyCheck_unittest.py +++ b/src/mongo/tools/mongo_tidy_checks/tests/MongoTidyCheck_unittest.py @@ -51,7 +51,7 @@ class MongoTidyTests(unittest.TestCase): else: print(msg) self.fail() - + with open(f'{os.path.splitext(self.compile_db)[0]}.results', 'w') as results: results.write(msg) @@ -65,12 +65,13 @@ class MongoTidyTests(unittest.TestCase): self.cmd = [ sys.executable, 'buildscripts/clang_tidy.py', + '--disable-reporting', f'--check-module={self.TIDY_MODULE}', f'--output-dir={os.path.join(os.path.dirname(compiledb), self._testMethodName + "_out")}', f'--compile-commands={self.compile_db}', ] else: - raise(f"ERROR: did not findh matching compiledb for {self._testMethodName}") + raise (f"ERROR: did not findh matching compiledb for {self._testMethodName}") def tearDown(self): if self.config_file: @@ -84,7 +85,7 @@ class MongoTidyTests(unittest.TestCase): Checks: '-*,mongo-test-check' WarningsAsErrors: '*' """)) - + self.expected_output = "ran mongo-test-check!" self.run_clang_tidy() |