-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move test_stop_running into test_job_queue #3709
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3709 +/- ##
==========================================
- Coverage 63.34% 63.33% -0.02%
==========================================
Files 597 597
Lines 46243 46243
Branches 4144 4144
==========================================
- Hits 29293 29288 -5
- Misses 15662 15666 +4
- Partials 1288 1289 +1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
The test has nothing to do with EnkfSimulationRunner.
bc93420
to
b5c15bb
Compare
for i in range(5): | ||
assert job_list[i].status == JobStatusType.JOB_QUEUE_DONE | ||
assert queue.snapshot()[i] == str(JobStatusType.JOB_QUEUE_DONE) | ||
|
||
for i in range(5, 8): | ||
assert job_list[i].status == JobStatusType.JOB_QUEUE_FAILED | ||
assert queue.snapshot()[i] == str(JobStatusType.JOB_QUEUE_FAILED) | ||
|
||
for i in range(8, 10): | ||
assert job_list[i].status == JobStatusType.JOB_QUEUE_RUNNING | ||
assert queue.snapshot()[i] == str(JobStatusType.JOB_QUEUE_RUNNING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a better assert:
for i in range(5): | |
assert job_list[i].status == JobStatusType.JOB_QUEUE_DONE | |
assert queue.snapshot()[i] == str(JobStatusType.JOB_QUEUE_DONE) | |
for i in range(5, 8): | |
assert job_list[i].status == JobStatusType.JOB_QUEUE_FAILED | |
assert queue.snapshot()[i] == str(JobStatusType.JOB_QUEUE_FAILED) | |
for i in range(8, 10): | |
assert job_list[i].status == JobStatusType.JOB_QUEUE_RUNNING | |
assert queue.snapshot()[i] == str(JobStatusType.JOB_QUEUE_RUNNING) | |
result = [(job.status, item) for (job, item) in zip(job_list, queue.snapshot())] | |
assert result == [ | |
(JobStatusType(name="JOB_QUEUE_DONE", value=32), 0), | |
(JobStatusType(name="JOB_QUEUE_DONE", value=32), 1), | |
(JobStatusType(name="JOB_QUEUE_DONE", value=32), 2), | |
(JobStatusType(name="JOB_QUEUE_DONE", value=32), 3), | |
(JobStatusType(name="JOB_QUEUE_DONE", value=32), 4), | |
(JobStatusType(name="JOB_QUEUE_FAILED", value=8192), 5), | |
(JobStatusType(name="JOB_QUEUE_FAILED", value=8192), 6), | |
(JobStatusType(name="JOB_QUEUE_FAILED", value=8192), 7), | |
(JobStatusType(name="JOB_QUEUE_RUNNING", value=16), 8), | |
(JobStatusType(name="JOB_QUEUE_RUNNING", value=16), 9), | |
] |
know you are only moving this code, so do it if you agree. The advantage is one assert instead of many, so the feedback on failure is hopefully better.
Pre review checklist
Adding labels helps the maintainers when writing release notes. This is the list of release note labels.