Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: expect_tests/pipeline.py

Issue 892363002: Actually added pretest support (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests@master
Patch Set: Yet another small fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/expect_tests » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import imp 6 import imp
7 import inspect 7 import inspect
8 import logging 8 import logging
9 import multiprocessing 9 import multiprocessing
10 import os 10 import os
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 This function is meant to be run as a dedicated process. Calling it twice 392 This function is meant to be run as a dedicated process. Calling it twice
393 in the same process is not supported. 393 in the same process is not supported.
394 394
395 Args: 395 Args:
396 cover_ctx: 396 cover_ctx:
397 kill_switch (multiprocessing.Event): 397 kill_switch (multiprocessing.Event):
398 result_queue (multiprocessing.Queue): 398 result_queue (multiprocessing.Queue):
399 opts: output of argparse.ArgumentParser.parse_args (see main.py) 399 opts: output of argparse.ArgumentParser.parse_args (see main.py)
400 processing_context (ProcessingContext): the task to perform. 400 processing_context (ProcessingContext): the task to perform.
401 """ 401 """
402 pretest_filename = os.path.join(processing_context.cwd, '.expect_tests.py')
agable 2015/02/03 04:23:48 In the documentation you committed previously, you
agable 2015/02/03 04:27:59 Also, this implementation requires the same .expec
403 if os.path.isfile(pretest_filename):
404 execfile(pretest_filename)
405
402 sys.path.insert(0, processing_context.cwd) 406 sys.path.insert(0, processing_context.cwd)
403 407
404 # This flag is set when test generation has finished. 408 # This flag is set when test generation has finished.
405 test_gen_finished = multiprocessing.Event() 409 test_gen_finished = multiprocessing.Event()
406 test_queue = multiprocessing.Queue() 410 test_queue = multiprocessing.Queue()
407 411
408 with TempDir() as temp_dir: 412 with TempDir() as temp_dir:
409 test_gen_args = ( 413 test_gen_args = (
410 processing_context.testing_contexts, test_queue, result_queue, opts, 414 processing_context.testing_contexts, test_queue, result_queue, opts,
411 kill_switch, cover_ctx, temp_dir 415 kill_switch, cover_ctx, temp_dir
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 526
523 if procs: 527 if procs:
524 error = opts.handler.result_stage_loop(opts, generate_objects(procs)) 528 error = opts.handler.result_stage_loop(opts, generate_objects(procs))
525 except ResultStageAbort: 529 except ResultStageAbort:
526 pass 530 pass
527 531
528 if not kill_switch.is_set() and not result_queue.empty(): 532 if not kill_switch.is_set() and not result_queue.empty():
529 error = True 533 error = True
530 534
531 return error, kill_switch.is_set() 535 return error, kill_switch.is_set()
OLDNEW
« no previous file with comments | « no previous file | scripts/expect_tests » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698