-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding default order on id to CakeTestModel, to ensure correct order.…
… Postgres can return results in any order it considers appropriate if none specified
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
05940ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit broke the build. Removing the constructor fixes the failing tests, but I'm sure you had a reason for the change. http://ci.cakephp.org:8080/job/CakePHP%202.0%20-%20MySQL/413/ Is where the build started failing.
05940ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was supposed to fix the ordering problems we get from time to time and makes few tests fail. I proposed changing it to a beforeFind or even override the find method.
05940ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are either of you getting fails yourselves with those 3 tests with 2.0 ? I don't, also somewhat hard to see how this change could cause the errors reported - they are all missing table errors.
EDIT: I'm all for this functional change (however implemented) - the tests are riddled with assumptions that dbs return results in id ascending order if no order is specified, and that means they simply break if you are not using mysql (and sometimes even if you are).
05940ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got two fails every time I run AllTests:
FixtureTaskTest.testImportRecordsNoEscaping
andFormHelperTest.testCheckboxDisabling
.Running those individually works.
05940ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
05940ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, guys. Yes individually tests pass. I am working on a fix which includes moving this form constructor to beforeFind, to ensure correct ordering. Sometimes tests fail because the find results are incorrectly ordered. I have setup postgres now, so i can ensure the fix wont break postgres either. I wasnt able to test with postgres before. I was suprised by the fact, that mysql and sqlite accept ORDER BY, where postgres doesnt: example query:
SELECT MAX("AfterTree"."rght") AS "rght" FROM "after_trees" AS "AfterTree" WHERE 1 = 1 AND "AfterTree"."id" <> 8 ORDER BY "AfterTree"."id" ASC LIMIT 1
I will work on it tonight to get the test passing again, and include the fix for correct ordering