Fearless Fool wrote:
> In the spirit of peace love and understanding, I'll start by saying that 
> I appreciate Marnen's philosophy, and I agree that "if the test has any 
> potential of touching the database, it is *absolutely necessary all the 
> time* to reset the DB to a known state."
> 
> But in my application, I have a few huge tables that are used 
> exclusively as reference data, are required for running any meaningful 
> tests and are never modified by the application.
> 
> For example, one is a TimeDimension table with one entry per hour for 10 
> years (that's 85K+ rows).  Each row is a "highly decorated TimeStamp" 
> which maps a timestamp to day of week as a string, whether or not it's a 
> holiday and 17 other columns of dimensional goodness.  It would take a 
> LONG time to set it up and tear it down for each test.

But you don't need to do that.  For any given test, I'll bet that you 
don't need more than 2 or 3 TimeDimension records.  And you can create 
those on the fly.  You don't need 85,000 records of data to test with.

Actually, you probably don't need them to deploy with either, but that's 
another issue.

[...]
> [Before you ask why the heck a giant table is preferable to simply using 
> the functions associated with Date and Time, I'll refer to you to:
>   http://www.ralphkimball.com/html/booksDWT2.html
>   http://philip.greenspun.com/sql/data-warehousing.html
> ]

Skimmed the Greenspun.  I don't buy it at all, particularly not for date 
information.  You may need fact tables for some things, but your 
TimeDimension seems to be along the lines of
| x | y | sum |
| 1 | 1 |   2 |
| 1 | 2 |   3 |

But I don't want to lose the primary topic here...

[...]
> But in this case, it really makes sense to preload the db with large 
> static tables. 

No, it really doesn't.  It really only makes sense to create a few 
representative records for your actual tests.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to