Closed kyleam closed 6 months ago
@kyleam is this blocking this version of review from getting into the next mpn? (I e how urgent is this)
is this blocking this version of review from getting into the next mpn?
No.
is this blocking this version of review from getting into the next mpn?
No.
@kyleam Ok, that's good to know, thanks for bringing this to our attention.
@michaelmcd18 i can review the PR for this issue whenever it's ready
Great idea @kyleam, we'll implement this:
Instead you could avoid converting to a date. Subtract the POSIXct value in dirSummaryRes from Sys.time(), and assert that the time difference is under N seconds. N should be large enough that, if it were to be reached, it'd be an indication that something was going very wrong with the test run (say 120 seconds in this case?).
Depending on the local time zone and current time, the below test failure can be triggered:
svn info --xml
returns the date in UTC (e.g., "2023-12-05T14:04:27.050339Z"), andsvnInfo()
parses that to aPOSIXct
object. (There's some other processing that goes on downstream, but this is the only processing that matters.)a test in
test-dirSummary.R
converts that value withas.Date()
and expects it to be equal toSys.Date()
That expectation is invalid because
Sys.Date()
is the current day for the current time zone.One fix would be to replace the
Sys.Date()
value with a date for UTC (sayformat(Sys.time(), "%Y-%m-%d", tz = "UTC")
). However, that would leave a harder-to-hit failure: if the test is executed right at the boundary of a day change, with thesvnInfo
call before and theSys.time()
call for the assertion after, the results would not match.Instead you could avoid converting to a date. Subtract the
POSIXct
value indirSummaryRes
fromSys.time()
, and assert that the time difference is underN
seconds.N
should be large enough that, if it were to be reached, it'd be an indication that something was going very wrong with the test run (say 120 seconds in this case?).cc: @andersone1 @michaelmcd18