Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add job start and end time #30
base: main
Are you sure you want to change the base?
Add job start and end time #30
Changes from 4 commits
0090c20
8f6c4e4
91b02d8
d4ba34c
eba6676
5ca5385
87cf4e3
303a176
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'd rather keep the previous form, so that if anything is added to the dict, you are aware that a test needs changing.
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.
I will update this. Would need to look a bit more into mocking the
start_time
andend_time
of the jobs during tests, since a dict comparison will require the exactstart_time
andend_time
of the container/pods. Or maybe a different solution.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.
Ah, that makes sense.
What about removing the time fields from the dict under test, and testing these separately? That would both allow us to test the full response, and allow proper time comparison.
Or use a time-freezing testing library (there must exist one).
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.
I tried using
freezegun
to set a specific time during testing, but since we are talking to the kubernetes/docker APIs and not using the datetime module, this solution did not work. I will do a bit more digging. The first solution should also work though, but it might be better to see if there are alternative solutions.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.
Ah, that totally makes sense! I'm not for mocking the result in the component under test, so let's fix this in the testing part.