select results randomisation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Medium
|
Unassigned |
Bug Description
One feature that has been very helpful for Launchpad development is the ability to tell the ORM to randomise the ordering of the results of a SELECT query (still subject to the ordering requested). This prevents people from writing tests that rely on the natural ordering of a result set, which is usually consistent for testing but not so in produciton.
We currently implement this in sqlobject by extending the list of "ORDER BY" clauses to end with "RANDOM()", which achieves the desired results with PostgreSQL. We only turn this on when running the test suite because the additional sorting would be a performance problem with the larger data set used in production.
It'd be nice to maintain this feature when we move to Storm.
Related branches
- No reviews requested
- Diff: 219 lines (has conflicts)
Changed in storm: | |
importance: | Undecided → Medium |
Looks nice and simple. I just wonder about the way that result randomization is enabled. Having
a method on the Store means that we'll have to call it on all the stores we create, which sounds
good when we want isolation between stores, but at the same time I wonder how we'll enable
it for debugging in a practical way. Specifically for the use case you mention, having an
environment variable might be an easier way to enable it.
What do you think?