There's a start with VersioncontrolRepositoryUnitTestingTestCase, but that needs expansion to do more than just CRUD (and to really do all CRUD, well), AND exercise the various additional methods we have/want on a VersioncontrolRepository object.

Then, we need to write similarly complete tests for all of our entities. Probably best to do these all in one fell swoop - will be faster to do and more consistent that way. This could reasonably be broken out into separate issues for each of the tests, but this can act as a meta-issue for that for now.

Comments

sdboyer’s picture

Note that these should all use the framework introduced in #960406: Introduce new testing framework, and do as much in VersioncontrolTestCase::BACKENDS_ALL mode as possible.

marvil07’s picture

Status: Active » Postponed

Postponing until #879858: Unify entity C(R)UD gets in since IMHO it would be easier to do this after.

marvil07’s picture

Status: Postponed » Fixed

update: bad issue

marvil07’s picture

Status: Fixed » Active
Issue tags: -git sprint 4 +git sprint 5

sorry, I wrote a comment and changed status by error in the bad issue, so, re-opening and moving to right tags

sdboyer’s picture

Issue tags: +git sprint 4

For historical accuracy of the backlog, it's important that we maintain all the tags for all the sprints in which we ever thought we'd do this.

marvil07’s picture

Title: Create tests that exercise CRUD & methods on all our entities » Define which tests to create to exercise CRUD & methods on all our entities
sdboyer’s picture

Status: Active » Fixed

OK, here's a set of guidelines I think CRUD tests should strive for, in descending order of importance.

  1. Tests must do super-basic save verification, ensuring that all the data that's supposed to go into the db goes in properly. That especially means the nested insertions of dependent objects. To greatest extent possible, this should be verified to work independent of the loaders (so running direct db queries).
  2. Tests must verify that deletion works appropriately, particularly recursive deletion.
  3. Any $options that can be set for any kind of CRUD operation - so loading with the controllers or saving/deleting with the entities themselves - must be tested and verified to work as intended.
  4. We need to test $conditions on controllers. Not every possible condition, though; only each unique condition-handling logic path. Per controller. So we need just one check for all straight field filters (i.e., $query->condition($alias . $field_name, $value)), and then additional checks for any sort of condition that follows an alternate path.
  5. Tests should aggressively search for cache inconsistencies/misses, as the immaturity of VersioncontrolEntity::cacheGet generally makes me think we could see a fair number of those, and that's potentially really bad.

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -git sprint 4, -git sprint 5

Automatically closed -- issue fixed for 2 weeks with no activity.