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
{{ message }}
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
Pulling time stamps out of a PostgreSQL database puts them in the following format:
TIMESTAMP WITH TIME ZONE(6) 2018-06-27 10:05:09.647832-05
TIMESTAMP WITH TIME ZONE(0) 2018-01-01 00:00:00-06
Many times I use assertDataSetsEqual to compare data with time stamps. Often, the engineer responsible for the code will not have taken into account the database's time zone, and as such the test data will be an hour off. In this case, the table diff will not generate useful output:
Failed asserting that
+---------------------------+
| foo |
+---------------------------+
| col |
+---------------------------+
| 2018-06-27 16:58:23-09 |
+---------------------------+
is equal to expected (table diff enabled)
+---------------------------+
| foo |
+---------------------------+
| col |
+---------------------------+
| '2018-06-27 15:58:23' != |
+---------------------------+
If the columns were adjustable somehow it would be easier to get useful test output, but they're not adjustable.
The "hack" I implemented locally is to pass in the column width via environment variable and just reference $_ENV inside AbstractTable - but I'm sure you could come up with something much better.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.
Current table diff output is set to 20 characters. All I want is a way to adjust this width.
Specific use case:
Pulling time stamps out of a PostgreSQL database puts them in the following format:
Many times I use
assertDataSetsEqual
to compare data with time stamps. Often, the engineer responsible for the code will not have taken into account the database's time zone, and as such the test data will be an hour off. In this case, the table diff will not generate useful output:If the columns were adjustable somehow it would be easier to get useful test output, but they're not adjustable.
The "hack" I implemented locally is to pass in the column width via environment variable and just reference
$_ENV
insideAbstractTable
- but I'm sure you could come up with something much better.The text was updated successfully, but these errors were encountered: