Ejemplo n.º 1
0
 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)
Ejemplo n.º 3
0
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()
Ejemplo n.º 4
0
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()
Ejemplo n.º 5
0
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()
Ejemplo n.º 6
0
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()
Ejemplo n.º 7
0
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()
Ejemplo n.º 8
0
 def configure_from_command_line(self):
     """Configure this instance using the command line arguments."""
     self._config = parser.parse_command_line()
Ejemplo n.º 9
0
 def test_run(self):
     subcommand_obj = _parser.parse_command_line(['run', '--suite=my_suite', 'my_test.js'])
     self.assertTrue(hasattr(subcommand_obj, 'execute'))
Ejemplo n.º 10
0
 def test_list_suites(self):
     subcommand_obj = _parser.parse_command_line(['list-suites'])
     self.assertTrue(hasattr(subcommand_obj, 'execute'))
Ejemplo n.º 11
0
 def test_find_suites(self):
     subcommand_obj = _parser.parse_command_line(['find-suites', '--suites=my_suite'])
     self.assertTrue(hasattr(subcommand_obj, 'execute'))
Ejemplo n.º 12
0
 def configure_from_command_line(self):
     """Configure this instance using the command line arguments."""
     self._config = parser.parse_command_line()
Ejemplo n.º 13
0
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()