Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Feature request: Adjustable column widths in table diff output #213

Open
h3xx opened this issue Jun 27, 2018 · 1 comment
Open

Feature request: Adjustable column widths in table diff output #213

h3xx opened this issue Jun 27, 2018 · 1 comment

Comments

@h3xx
Copy link

h3xx commented Jun 27, 2018

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:

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.

@stale
Copy link

stale bot commented Sep 8, 2018

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.

@stale stale bot added stale and removed stale labels Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant