tests/fsmonitor-run-tests.py
author Matt Harbison <matt_harbison@yahoo.com>
Thu, 19 Sep 2024 21:03:10 -0400
changeset 51883 1edac12af730
parent 51703 ca7bde5dbafb
permissions -rwxr-xr-x
vfs: modernize the detection of the main thread There weren't a lot of good choices when py27 was supported, but starting with py34, `threading.main_thread()` is available. This gets us away from an undocumented, internal symbol, and drops a pytype suppression statement. It is also apparently no longer reliable after a process fork.[1][2] [1] https://stackoverflow.com/a/23207116 [2] https://github.com/python/cpython/blob/v3.6.3/Lib/threading.py#L1334
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45830
c102b704edb5 global: use python3 in shebangs
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44448
diff changeset
     1
#!/usr/bin/env python3
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     2
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     3
# fsmonitor-run-tests.py - Run Mercurial tests with fsmonitor enabled
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     4
#
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     5
# Copyright 2017 Facebook, Inc.
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     6
#
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     7
# This software may be used and distributed according to the terms of the
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     8
# GNU General Public License version 2 or any later version.
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
     9
#
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    10
# This is a wrapper around run-tests.py that spins up an isolated instance of
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    11
# Watchman and runs the Mercurial tests against it. This ensures that the global
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    12
# version of Watchman isn't affected by anything this test does.
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    13
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    14
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    15
import argparse
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    16
import contextlib
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    17
import json
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    18
import os
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    19
import shutil
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    20
import subprocess
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    21
import sys
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    22
import tempfile
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    23
import uuid
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    24
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    25
osenvironb = getattr(os, 'environb', os.environ)
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    26
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    27
if sys.version_info > (3, 5, 0):
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    28
    PYTHON3 = True
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    29
44448
55c443fcb4fc tests: rename _bytespath() to _sys2bytes() and _strpath() to _sys2str()
Manuel Jacob <me@manueljacob.de>
parents: 43076
diff changeset
    30
    def _sys2bytes(p):
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    31
        return p.encode('utf-8')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    32
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    33
elif sys.version_info >= (3, 0, 0):
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    34
    print(
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    35
        '%s is only supported on Python 3.5+ and 2.7, not %s'
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    36
        % (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3]))
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    37
    )
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    38
    sys.exit(70)  # EX_SOFTWARE from `man 3 sysexit`
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    39
else:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    40
    PYTHON3 = False
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    41
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    42
    # In python 2.x, path operations are generally done using
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    43
    # bytestrings by default, so we don't have to do any extra
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    44
    # fiddling there. We define the wrapper functions anyway just to
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    45
    # help keep code consistent between platforms.
44448
55c443fcb4fc tests: rename _bytespath() to _sys2bytes() and _strpath() to _sys2str()
Manuel Jacob <me@manueljacob.de>
parents: 43076
diff changeset
    46
    def _sys2bytes(p):
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    47
        return p
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    48
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    49
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    50
def getparser():
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    51
    """Obtain the argument parser used by the CLI."""
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    52
    parser = argparse.ArgumentParser(
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    53
        description='Run tests with fsmonitor enabled.',
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    54
        epilog='Unrecognized options are passed to run-tests.py.',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    55
    )
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    56
    # - keep these sorted
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    57
    # - none of these options should conflict with any in run-tests.py
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    58
    parser.add_argument(
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    59
        '--keep-fsmonitor-tmpdir',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    60
        action='store_true',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    61
        help='keep temporary directory with fsmonitor state',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    62
    )
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    63
    parser.add_argument(
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    64
        '--watchman',
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    65
        help='location of watchman binary (default: watchman in PATH)',
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    66
        default='watchman',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    67
    )
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    68
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    69
    return parser
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    70
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    71
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    72
@contextlib.contextmanager
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    73
def watchman(args):
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    74
    basedir = tempfile.mkdtemp(prefix='hg-fsmonitor')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    75
    try:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    76
        # Much of this configuration is borrowed from Watchman's test harness.
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    77
        cfgfile = os.path.join(basedir, 'config.json')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    78
        # TODO: allow setting a config
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    79
        with open(cfgfile, 'w') as f:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    80
            f.write(json.dumps({}))
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    81
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    82
        logfile = os.path.join(basedir, 'log')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    83
        clilogfile = os.path.join(basedir, 'cli-log')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    84
        if os.name == 'nt':
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    85
            sockfile = '\\\\.\\pipe\\watchman-test-%s' % uuid.uuid4().hex
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    86
        else:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    87
            sockfile = os.path.join(basedir, 'sock')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    88
        pidfile = os.path.join(basedir, 'pid')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    89
        statefile = os.path.join(basedir, 'state')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    90
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    91
        argv = [
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    92
            args.watchman,
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    93
            '--sockname',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    94
            sockfile,
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    95
            '--logfile',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    96
            logfile,
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    97
            '--pidfile',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    98
            pidfile,
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
    99
            '--statefile',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   100
            statefile,
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   101
            '--foreground',
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   102
            '--log-level=2',  # debug logging for watchman
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   103
        ]
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   104
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   105
        envb = osenvironb.copy()
44448
55c443fcb4fc tests: rename _bytespath() to _sys2bytes() and _strpath() to _sys2str()
Manuel Jacob <me@manueljacob.de>
parents: 43076
diff changeset
   106
        envb[b'WATCHMAN_CONFIG_FILE'] = _sys2bytes(cfgfile)
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   107
        with open(clilogfile, 'wb') as f:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   108
            proc = subprocess.Popen(
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   109
                argv, env=envb, stdin=None, stdout=f, stderr=f
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   110
            )
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   111
            try:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   112
                yield sockfile
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   113
            finally:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   114
                proc.terminate()
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   115
                proc.kill()
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   116
    finally:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   117
        if args.keep_fsmonitor_tmpdir:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   118
            print('fsmonitor dir available at %s' % basedir)
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   119
        else:
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   120
            shutil.rmtree(basedir, ignore_errors=True)
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   121
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   122
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   123
def run():
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   124
    parser = getparser()
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   125
    args, runtestsargv = parser.parse_known_args()
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   126
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   127
    with watchman(args) as sockfile:
44448
55c443fcb4fc tests: rename _bytespath() to _sys2bytes() and _strpath() to _sys2str()
Manuel Jacob <me@manueljacob.de>
parents: 43076
diff changeset
   128
        osenvironb[b'WATCHMAN_SOCK'] = _sys2bytes(sockfile)
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   129
        # Indicate to hghave that we're running with fsmonitor enabled.
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   130
        osenvironb[b'HGFSMONITOR_TESTS'] = b'1'
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   131
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   132
        runtestdir = os.path.dirname(__file__)
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   133
        runtests = os.path.join(runtestdir, 'run-tests.py')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   134
        blacklist = os.path.join(runtestdir, 'blacklists', 'fsmonitor')
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   135
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   136
        runtestsargv.insert(0, runtests)
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   137
        runtestsargv.extend(
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   138
            [
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   139
                '--extra-config',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   140
                'extensions.fsmonitor=',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   141
                # specify fsmonitor.mode=paranoid always in order to force
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   142
                # fsmonitor extension execute "paranoid" code path
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   143
                #
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   144
                # TODO: make fsmonitor-run-tests.py accept specific options
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   145
                '--extra-config',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   146
                'fsmonitor.mode=paranoid',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   147
                '--blacklist',
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   148
                blacklist,
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   149
            ]
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   150
        )
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   151
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   152
        return subprocess.call(runtestsargv)
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   153
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 40208
diff changeset
   154
32769
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   155
if __name__ == '__main__':
efd6e941e933 tests: add a wrapper to run fsmonitor tests
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   156
    sys.exit(run())