Skip to content

Commit 6c95586

Browse files
chronos: run vanilla check on run_tests.sh when checking patch issues (#14311)
if vanilla `run_tests.sh` does not work, there is no need to check if `run_tests.sh` patches the repository. Signed-off-by: David Korczynski <[email protected]>
1 parent 301408d commit 6c95586

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

infra/experimental/chronos/manager.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,20 @@ def check_tests(project,
250250
]
251251

252252
if integrity_check or semantic_test:
253+
254+
# Run normal build_test
255+
logger.info('Running normal run_tests.sh for project: %s', project)
256+
docker_cmd_vanilla = docker_cmd[:]
257+
docker_cmd_vanilla.append(f'"{run_tests_cmd}"')
258+
try:
259+
subprocess.check_call(' '.join(docker_cmd_vanilla), shell=True)
260+
logger.info('Successfully ran run_tests.sh for project: %s', project)
261+
except subprocess.CalledProcessError:
262+
logger.info(
263+
'run_tests.sh result failed: Failed to run vanilla run_tests.sh for project: %s',
264+
project)
265+
sys.exit(0)
266+
253267
# First check diffing patch. The approach here is to capture a diff before
254268
# and after applying the patch, and see if there are any changes to e.g. git diff.
255269
logger.info('Checking diffing patch for project: %s', project)
@@ -271,11 +285,12 @@ def check_tests(project,
271285
succeeded_patch = ret_code == 0
272286
logger.info('succeeded patch: %s', succeeded_patch)
273287
if ret_code == 0:
274-
patch_msg = 'run_tests.sh does not patch source control'
288+
patch_msg = 'run_tests.sh result succeeded: does not patch source control'
275289
elif ret_code == 1:
276-
patch_msg = 'run_tests.sh patches source control'
290+
patch_msg = 'run_tests.sh result failed: patches source control'
277291
else:
278-
patch_msg = 'unable to tell if run_tests.sh patches source control'
292+
patch_msg = 'run_tests.sh result uknown: unable to tell if run_tests.sh patches source control'
293+
logger.info('%s', patch_msg)
279294
patch_details = {
280295
'check-name': 'run_tests_patches_diff',
281296
'patch-message': patch_msg

0 commit comments

Comments
 (0)