Skip to content

Commit

Permalink
Merge pull request #127 from ceph/fix-run-unknown
Browse files Browse the repository at this point in the history
Run: Fall back to setting queued status
  • Loading branch information
zmc authored Aug 13, 2024
2 parents 2de3e87 + 298a18f commit 108240f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paddles/models/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def set_status(self, results=None):
# all passing => pass
elif results['pass'] == total:
new_status = 'finished pass'
elif results['queued']:
new_status = 'queued'
# this should not happen
else:
new_status = 'unknown'
Expand Down
7 changes: 7 additions & 0 deletions paddles/tests/models/test_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ def test_run_status_all_dead(self):
#Job(dict(job_id=16, id=16, status='dead'), new_run)
assert new_run.status == 'finished dead'

def test_run_status_one_pass(self):
run_name = "run_status_one_pass"
new_run = Run(run_name)
Job(dict(job_id=15, id=15, status='queued'), new_run)
Job(dict(job_id=50, id=50, status='pass'), new_run)
assert new_run.status == 'queued'

def test_run_user(self):
run_name = "teuthology-2013-12-22_01:00:02-x-x-x-x-x"
new_run = Run(run_name)
Expand Down

0 comments on commit 108240f

Please sign in to comment.