I think this is the sort of thing that's easier to write unit tests for
than integration tests. We have some tests here
https://github.com/mozilla-b2g/gaia/blob/master/apps/calendar/test/unit/db_test.js#L193for
our calendar data migrations. Most of them happen like this

setup(function() {
  // 1. Write some data to IDB.
  // 2. Open a later version.
});

test('data should look right after opening a new version', function() {
  // Fetch data from IDB and make sure it looks right.
});

Happy to help out if any apps need some guidance/example code.


On Fri, Dec 13, 2013 at 11:55 AM, Jonas Sicking <[email protected]> wrote:

> On Dec 13, 2013 9:03 AM, "Dietrich Ayala" <[email protected]> wrote:
> > Any time a schema or public datastructure changes in a backwards
> > incompatible way, the patch should come with a unit test that mocks
> > the old data and tests the migration path.
>
> Do we have ways for integration tests to create a profile using an old
> schema?
>
> One thing that would be great if someone could set up is infrastructure
> which creates copies a 1.0.1 profile which contains lots of data into a
> gaia profile and then starts a latest build using that profile. We can then
> test if the expected data is still there and works as expected.
>
> Then we can do the same thing with 1.1, 1.2, 1.3 etc profiles.
>
> This triggers the most important code paths, I.e. the ones our users are
> going to hit.
>
> Note that we don't have to test all combinations. Like 1.0.1 to 1.2 etc. As
> long as we test migrating all old releases to the current release we should
> be golden.
>
> / Jonas
> _______________________________________________
> dev-gaia mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-gaia
>



-- 
Best,
Gareth
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to