Conversation
MrCreosote
left a comment
There was a problem hiding this comment.
Mostly looks pretty reasonable. I have a few questions re error handling and some internal api suggestions
|
Oh, there's a couple of checklist things that aren't checked or marked as N/A, missed that |
MrCreosote
left a comment
There was a problem hiding this comment.
Couple questions on the new stuff
MrCreosote
left a comment
There was a problem hiding this comment.
couple questions on the new stuff
|
Well that's weird, not quite sure what happened there |
MrCreosote
left a comment
There was a problem hiding this comment.
Taking a look at the newer changes
|
Working on tests and coverage |
|
This pull request introduces 1 alert when merging 9be3578 into 3150622 - view on LGTM.com new alerts:
|
| ) | ||
| except Exception as e: | ||
| logging.info( | ||
| logging.error( |
There was a problem hiding this comment.
Removed extra info from logs
| def test_status_change(self): | ||
|
|
||
| with self.assertRaisesRegexp( | ||
| with self.assertRaisesRegex( |
| "hex string" | ||
| ) | ||
| with self.assertRaisesRegexp(RetryFailureException, errmsg): | ||
| with self.assertRaisesRegex(RetryFailureException, errmsg): |
| from lib.execution_engine2.exceptions import InvalidStatusTransitionException | ||
| from lib.execution_engine2.sdk.SDKMethodRunner import SDKMethodRunner | ||
| from lib.execution_engine2.utils.CondorTuples import SubmissionInfo | ||
| from execution_engine2.db.models.models import Job, Status, TerminatedCode |
MrCreosote
left a comment
There was a problem hiding this comment.
code seems fine but the tests aren't passing, so I assume there's more work there to do and haven't looked at them yet
|
Tests are done, not sure why that one failed all of a sudden on github actions. It's been failing locally on my machine for months but not on github actions. It was a bad test because the underlying functionality is actually wrong and the test is flaky depending on where you run it |
|
Interesting, the tests passed consistently on my machine when I was doing ee2 work. |
|
Note to self: New behaviors are
|
|
Further note to self: there are API to DB integration tests that exercise |
MrCreosote
left a comment
There was a problem hiding this comment.
Looks good, just a few minor changes and some unit tests that I think should be pretty easy
| yield self.me_connection | ||
|
|
||
| def insert_jobs(self, jobs_to_insert: List[Job]) -> List[ObjectId]: | ||
| """ |
There was a problem hiding this comment.
There aren't any unit tests for this function
There was a problem hiding this comment.
Ok, wrote a basic test
There was a problem hiding this comment.
It tests that the method returns job IDs, but not that the jobs are actually correctly inserted to the DB. If this were me writing the tests I'd retrieve the jobs either via the MongoUtil API or directly from mongo and ensure the data was what I expected
There was a problem hiding this comment.
Alright, added that, but not quite sure if that's what you had in mind
There was a problem hiding this comment.
it is, except the problem is that equality on Job objects only tests the _id, not any other fields. So the insert method could completely trash the incoming Job object and save it and the test will still pass. I'd update to use the assert_job_equal method from EE2RunJob_test.py (maybe that should be moved to a utility class at some point)
There was a problem hiding this comment.
Alright well how about using
for i, retrieved_job in enumerate(retrieved_jobs):
assert jobs_to_insert[i].to_json() == retrieved_job.to_json()
assert jobs_to_insert[i].to_mongo() == retrieved_job.to_mongo()
assert jobs_to_insert[i].to_dbref() == retrieved_job.to_dbref()
There was a problem hiding this comment.
Bah, realized that the modify command isn't updating the "updated" timestamp
Description of PR purpose/changes
Testing Instructions
Dev Checklist:
Updating Version and Release Notes (if applicable)