You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
backdating is tricky without a good way to "freeze time"
The DB uses epoch time stamps to record time (because SQLite doesn't have a native concept of Dates or Times... at least not as far as a data type).
We need tests that confirm that starting & stopping of a task, and the creation of interruptions using the relative and absolute formats
Examples:
hey start at 4:30 @proj +task
hey stop at 5:30
hey bob at 13:50
hey bob at 1:51
hey start 4 minutes ago
hey stop 3 minutes ago
The problem is that without the ability to freeze time it becomes difficult to test the time you're expecting in the db. You have to start testing for ranges. For example, create the thing, get the current epoch time, and then test that the started_at column contains a number within 2 seconds of the current epoch time you recorded.
This is because you could create a thing, and in the millisecond between creation and reading you've crossed into the next second, and now the numbers aren't the same.
Once we have / create that then we can do the simple math of taking the current epoch time, subtracting N minutes worth of seconds, and comparing that to the backdated time shoved in the db.
The text was updated successfully, but these errors were encountered:
this has been mostly addressed with unit tests after some refactoring instead of bash_unit tests. There are bash_unit tests to sanity check that the various backdating forms don't blow up. the unit tests make sure that the actual math is right.
backdating is tricky without a good way to "freeze time"
The DB uses epoch time stamps to record time (because SQLite doesn't have a native concept of Dates or Times... at least not as far as a data type).
We need tests that confirm that starting & stopping of a task, and the creation of interruptions using the relative and absolute formats
Examples:
The problem is that without the ability to freeze time it becomes difficult to test the time you're expecting in the db. You have to start testing for ranges. For example, create the thing, get the current epoch time, and then test that the
started_at
column contains a number within 2 seconds of the current epoch time you recorded.This is because you could create a thing, and in the millisecond between creation and reading you've crossed into the next second, and now the numbers aren't the same.
So, we a new
assert
function. I've filed a feature request ticket against bash_unit.Once we have / create that then we can do the simple math of taking the current epoch time, subtracting N minutes worth of seconds, and comparing that to the backdated time shoved in the db.
The text was updated successfully, but these errors were encountered: