-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(cmd): add maintenance info #984
Conversation
bd50190
to
07a990f
Compare
5ca164b
to
3e7794e
Compare
a6211cd
to
da03861
Compare
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.
Just a tiny nitpick
As I participated in the dev, should we ask for a second reviewer ?
db/maintenance/info.go
Outdated
|
||
nextMaintenanceWindowStartingDate, nextMaintenanceWindowEndingDate := getNextLocalMaintenanceWindow(time.Now(), database.MaintenanceWindow, maintenanceInfo.Status) | ||
|
||
// we are in the range |
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 think this comment is misplaced right ?
Co-authored-by: Cédric Thomas <[email protected]>
da03861
to
5538524
Compare
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.
it could be a parameterized test here, the test methods look really the same so it's hard to differentiate what they do
@@ -0,0 +1,194 @@ | |||
package maintenance |
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.
suggestion: make a parameterized test here
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 think the test names with the nested structure is a good representation enough, but having a test table can make the tests a bit more clearer
f1dbe24
to
fcf64d7
Compare
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.
LGTM
fcf64d7
to
68d1e8b
Compare
db/maintenance/info_test.go
Outdated
"when the maintenance window is ongoing": { | ||
maintenanceTimeData: dateOfTheWeekUTC(time.Wednesday, 7), | ||
expectedMaintenanceRunTime: func(maintenanceData time.Time, maintenanceType scalingo.MaintenanceStatus) time.Time { | ||
if maintenanceType == scalingo.MaintenanceStatusScheduled { |
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.
question (non-blocking): do you really need to put conditions on your test setup? it makes the test a bit harder to read and understand
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.
Without adding more complexity (which wouldn't help for readability) I don't see what would be better, would you have a suggestion for this?
68d1e8b
to
d5fb53a
Compare
a95f584
to
a58b9a2
Compare
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.
after removing the "expected" field when it's not actually expected, LGTM!
a58b9a2
to
1001143
Compare
1001143
to
272f536
Compare
Fixes: #969