|
|
@ -219,7 +219,8 @@ class JobResult(object): |
|
|
|
class Job(object): |
|
|
|
class Job(object): |
|
|
|
"""Manages one job.""" |
|
|
|
"""Manages one job.""" |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, spec, newline_on_success, travis, add_env): |
|
|
|
def __init__(self, spec, newline_on_success, travis, add_env, |
|
|
|
|
|
|
|
quiet_success=False): |
|
|
|
self._spec = spec |
|
|
|
self._spec = spec |
|
|
|
self._newline_on_success = newline_on_success |
|
|
|
self._newline_on_success = newline_on_success |
|
|
|
self._travis = travis |
|
|
|
self._travis = travis |
|
|
@ -227,6 +228,8 @@ class Job(object): |
|
|
|
self._retries = 0 |
|
|
|
self._retries = 0 |
|
|
|
self._timeout_retries = 0 |
|
|
|
self._timeout_retries = 0 |
|
|
|
self._suppress_failure_message = False |
|
|
|
self._suppress_failure_message = False |
|
|
|
|
|
|
|
self._quiet_success = quiet_success |
|
|
|
|
|
|
|
if not self._quiet_success: |
|
|
|
message('START', spec.shortname, do_newline=self._travis) |
|
|
|
message('START', spec.shortname, do_newline=self._travis) |
|
|
|
self.result = JobResult() |
|
|
|
self.result = JobResult() |
|
|
|
self.start() |
|
|
|
self.start() |
|
|
@ -302,6 +305,7 @@ class Job(object): |
|
|
|
if real > 0.5: |
|
|
|
if real > 0.5: |
|
|
|
cores = (user + sys) / real |
|
|
|
cores = (user + sys) / real |
|
|
|
measurement = '; cpu_cost=%.01f; estimated=%.01f' % (cores, self._spec.cpu_cost) |
|
|
|
measurement = '; cpu_cost=%.01f; estimated=%.01f' % (cores, self._spec.cpu_cost) |
|
|
|
|
|
|
|
if not self._quiet_success: |
|
|
|
message('PASSED', '%s [time=%.1fsec; retries=%d:%d%s]' % ( |
|
|
|
message('PASSED', '%s [time=%.1fsec; retries=%d:%d%s]' % ( |
|
|
|
self._spec.shortname, elapsed, self._retries, self._timeout_retries, measurement), |
|
|
|
self._spec.shortname, elapsed, self._retries, self._timeout_retries, measurement), |
|
|
|
stdout() if self._spec.verbose_success else None, |
|
|
|
stdout() if self._spec.verbose_success else None, |
|
|
@ -341,7 +345,7 @@ class Jobset(object): |
|
|
|
"""Manages one run of jobs.""" |
|
|
|
"""Manages one run of jobs.""" |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, check_cancelled, maxjobs, newline_on_success, travis, |
|
|
|
def __init__(self, check_cancelled, maxjobs, newline_on_success, travis, |
|
|
|
stop_on_failure, add_env): |
|
|
|
stop_on_failure, add_env, quiet_success): |
|
|
|
self._running = set() |
|
|
|
self._running = set() |
|
|
|
self._check_cancelled = check_cancelled |
|
|
|
self._check_cancelled = check_cancelled |
|
|
|
self._cancelled = False |
|
|
|
self._cancelled = False |
|
|
@ -352,6 +356,7 @@ class Jobset(object): |
|
|
|
self._travis = travis |
|
|
|
self._travis = travis |
|
|
|
self._stop_on_failure = stop_on_failure |
|
|
|
self._stop_on_failure = stop_on_failure |
|
|
|
self._add_env = add_env |
|
|
|
self._add_env = add_env |
|
|
|
|
|
|
|
self._quiet_success = quiet_success |
|
|
|
self.resultset = {} |
|
|
|
self.resultset = {} |
|
|
|
self._remaining = None |
|
|
|
self._remaining = None |
|
|
|
self._start_time = time.time() |
|
|
|
self._start_time = time.time() |
|
|
@ -380,7 +385,8 @@ class Jobset(object): |
|
|
|
job = Job(spec, |
|
|
|
job = Job(spec, |
|
|
|
self._newline_on_success, |
|
|
|
self._newline_on_success, |
|
|
|
self._travis, |
|
|
|
self._travis, |
|
|
|
self._add_env) |
|
|
|
self._add_env, |
|
|
|
|
|
|
|
self._quiet_success) |
|
|
|
self._running.add(job) |
|
|
|
self._running.add(job) |
|
|
|
if job.GetSpec().shortname not in self.resultset: |
|
|
|
if job.GetSpec().shortname not in self.resultset: |
|
|
|
self.resultset[job.GetSpec().shortname] = [] |
|
|
|
self.resultset[job.GetSpec().shortname] = [] |
|
|
@ -403,6 +409,7 @@ class Jobset(object): |
|
|
|
break |
|
|
|
break |
|
|
|
for job in dead: |
|
|
|
for job in dead: |
|
|
|
self._completed += 1 |
|
|
|
self._completed += 1 |
|
|
|
|
|
|
|
if not self._quiet_success or job.result.state != 'PASSED': |
|
|
|
self.resultset[job.GetSpec().shortname].append(job.result) |
|
|
|
self.resultset[job.GetSpec().shortname].append(job.result) |
|
|
|
self._running.remove(job) |
|
|
|
self._running.remove(job) |
|
|
|
if dead: return |
|
|
|
if dead: return |
|
|
@ -463,7 +470,8 @@ def run(cmdlines, |
|
|
|
infinite_runs=False, |
|
|
|
infinite_runs=False, |
|
|
|
stop_on_failure=False, |
|
|
|
stop_on_failure=False, |
|
|
|
add_env={}, |
|
|
|
add_env={}, |
|
|
|
skip_jobs=False): |
|
|
|
skip_jobs=False, |
|
|
|
|
|
|
|
quiet_success=False): |
|
|
|
if skip_jobs: |
|
|
|
if skip_jobs: |
|
|
|
results = {} |
|
|
|
results = {} |
|
|
|
skipped_job_result = JobResult() |
|
|
|
skipped_job_result = JobResult() |
|
|
@ -474,7 +482,8 @@ def run(cmdlines, |
|
|
|
return results |
|
|
|
return results |
|
|
|
js = Jobset(check_cancelled, |
|
|
|
js = Jobset(check_cancelled, |
|
|
|
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS, |
|
|
|
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS, |
|
|
|
newline_on_success, travis, stop_on_failure, add_env) |
|
|
|
newline_on_success, travis, stop_on_failure, add_env, |
|
|
|
|
|
|
|
quiet_success) |
|
|
|
for cmdline, remaining in tag_remaining(cmdlines): |
|
|
|
for cmdline, remaining in tag_remaining(cmdlines): |
|
|
|
if not js.start(cmdline): |
|
|
|
if not js.start(cmdline): |
|
|
|
break |
|
|
|
break |
|
|
|