mirror of
https://github.com/dart-lang/sdk
synced 2024-10-02 23:24:42 +00:00
[presubmit] Remove check to keep _2 suites in sync
We have disabled most legacy testing and keeping the old suites in sync is no longer worth the effort. Change-Id: Id2f60ef558225bfc16836ad9c11e4c5819717b45 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315401 Auto-Submit: Alexander Thomas <athom@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
parent
43db92d9ed
commit
1cfcb4feaa
46
PRESUBMIT.py
46
PRESUBMIT.py
|
@ -29,51 +29,6 @@ def is_dart_file(path):
|
|||
return path.endswith('.dart')
|
||||
|
||||
|
||||
def _CheckNnbdTestSync(input_api, output_api):
|
||||
"""Make sure that any forked SDK tests are kept in sync. If a CL touches
|
||||
a test, the test's counterpart (if it exists at all) should be in the CL
|
||||
too.
|
||||
"""
|
||||
DIRS = [
|
||||
"tests/co19", "tests/corelib", "tests/ffi", "tests/language",
|
||||
"tests/lib", "tests/standalone", "runtime/tests/vm/dart"
|
||||
]
|
||||
|
||||
files = [git_file.LocalPath() for git_file in input_api.AffectedTextFiles()]
|
||||
unsynchronized = []
|
||||
for file in files:
|
||||
if file.endswith('.status'): continue
|
||||
|
||||
for dir in DIRS:
|
||||
legacy_dir = "{}_2/".format(dir)
|
||||
nnbd_dir = "{}/".format(dir)
|
||||
|
||||
counterpart = None
|
||||
if file.startswith(legacy_dir):
|
||||
counterpart = file.replace(legacy_dir, nnbd_dir)
|
||||
elif file.startswith(nnbd_dir):
|
||||
counterpart = file.replace(nnbd_dir, legacy_dir)
|
||||
|
||||
if counterpart:
|
||||
# Changed one file with a potential counterpart.
|
||||
if counterpart not in files:
|
||||
missing = '' if os.path.exists(
|
||||
counterpart) else ' (missing)'
|
||||
unsynchronized.append("- {} -> {}{}".format(
|
||||
file, counterpart, missing))
|
||||
break
|
||||
|
||||
if unsynchronized:
|
||||
return [
|
||||
output_api.PresubmitPromptWarning(
|
||||
'Make sure to keep the forked legacy and NNBD tests in sync.\n'
|
||||
'You may need to synchronize these files:\n' +
|
||||
'\n'.join(unsynchronized))
|
||||
]
|
||||
|
||||
return []
|
||||
|
||||
|
||||
def _CheckFormat(input_api,
|
||||
identification,
|
||||
extension,
|
||||
|
@ -384,7 +339,6 @@ def _CheckCopyrightYear(input_api, output_api):
|
|||
|
||||
def _CommonChecks(input_api, output_api):
|
||||
results = []
|
||||
results.extend(_CheckNnbdTestSync(input_api, output_api))
|
||||
results.extend(_CheckValidHostsInDEPS(input_api, output_api))
|
||||
results.extend(_CheckDartFormat(input_api, output_api))
|
||||
results.extend(_CheckStatusFiles(input_api, output_api))
|
||||
|
|
Loading…
Reference in a new issue