def test_filter_temporarily_disabled_tests(self): parser.parse_command_line() test_file_explorer = MockTestFileExplorer() test_file_explorer.tags = { "dir/subdir1/test11.js": ["tag1", "tag2", "__TEMPORARILY_DISABLED__"], "dir/subdir1/test12.js": ["tag3"], "dir/subdir2/test21.js": ["tag2", "tag4"] } config = {"roots": ["dir/subdir1/*.js", "dir/subdir2/*.js"]} selected, excluded = selector.filter_tests("js_test", config, test_file_explorer) self.assertEqual(["dir/subdir1/test11.js"], excluded) self.assertEqual(["dir/subdir1/test12.js", "dir/subdir2/test21.js"], selected)
def test_filter_temporarily_disabled_tests(self): parser.parse_command_line(sys.argv[1:]) test_file_explorer = MockTestFileExplorer() test_file_explorer.tags = { "dir/subdir1/test11.js": ["tag1", "tag2", "__TEMPORARILY_DISABLED__"], "dir/subdir1/test12.js": ["tag3"], "dir/subdir2/test21.js": ["tag2", "tag4"] } config = {"roots": ["dir/subdir1/*.js", "dir/subdir2/*.js"]} selected, excluded = selector.filter_tests("js_test", config, test_file_explorer) self.assertEqual(["dir/subdir1/test11.js"], excluded) self.assertEqual(["dir/subdir1/test12.js", "dir/subdir2/test21.js"], selected)
def _analyze_pids(logger, pids): """Analyze the PIDs spawned by the current resmoke process.""" # If 'test_analysis' is specified, we will just write the pids out to a file and kill them # Instead of running analysis. This option will only be specified in resmoke selftests. if 'test_analysis' in config.INTERNAL_PARAMS: with open(os.path.join(config.DBPATH_PREFIX, "test_analysis.txt"), "w") as analysis_file: analysis_file.write("\n".join([str(pid) for pid in pids])) for pid in pids: try: proc = psutil.Process(pid) logger.info("Killing process pid %d", pid) proc.kill() except psutil.NoSuchProcess: # Process has already terminated. pass return hang_analyzer_args = [ 'hang-analyzer', '-o', 'file', '-o', 'stdout', '-k', '-d', ','.join([str(p) for p in pids]) ] if not os.getenv('ASAN_OPTIONS'): hang_analyzer_args.append('-c') _hang_analyzer = parser.parse_command_line(hang_analyzer_args, logger=logger) _hang_analyzer.execute()
def main(argv): """ Execute Main function for resmoke. :param argv: sys.argv :return: None """ __start_time = time.time() subcommand = parser.parse_command_line(argv[1:], start_time=__start_time) subcommand.execute()
def _analyze_pids(logger, pids): """Analyze the PIDs spawned by the current resmoke process.""" hang_analyzer_args = [ 'hang-analyzer', '-o', 'file', '-o', 'stdout', '-k', '-d', ','.join([str(p) for p in pids]) ] if not os.getenv('ASAN_OPTIONS'): hang_analyzer_args.append('-c') _hang_analyzer = parser.parse_command_line(hang_analyzer_args, logger=logger) _hang_analyzer.execute()
def main(argv): """ Execute Main function for resmoke. :param argv: sys.argv :return: None """ __start_time = time.time() subcommand = parser.parse_command_line( argv[1:], start_time=__start_time, usage="Resmoke is MongoDB's correctness testing orchestrator.\n" "For more information, see the help message for each subcommand.\n" "For example: resmoke.py run -h\n") subcommand.execute()
def main(argv): """ Execute Main function for resmoke. :param argv: sys.argv :return: None """ __start_time = time.time() subcommand = parser.parse_command_line( argv[1:], start_time=__start_time, usage="Resmoke is MongoDB's correctness testing orchestrator.\n" "For more information, see the help message for each subcommand.\n" "For example: resmoke.py run -h\n" "Note: bisect and setup-multiversion subcommands have been moved to db-contrib-tool (https://github.com/10gen/db-contrib-tool#readme).\n" ) subcommand.execute()
def configure_from_command_line(self): """Configure this instance using the command line arguments.""" self._config = parser.parse_command_line()
def test_run(self): subcommand_obj = _parser.parse_command_line(['run', '--suite=my_suite', 'my_test.js']) self.assertTrue(hasattr(subcommand_obj, 'execute'))
def test_list_suites(self): subcommand_obj = _parser.parse_command_line(['list-suites']) self.assertTrue(hasattr(subcommand_obj, 'execute'))
def test_find_suites(self): subcommand_obj = _parser.parse_command_line(['find-suites', '--suites=my_suite']) self.assertTrue(hasattr(subcommand_obj, 'execute'))
def main(): """Execute Main function for resmoke.""" __start_time = time.time() subcommand = parser.parse_command_line(sys.argv[1:], start_time=__start_time) subcommand.execute()