def test_migration_after_live_migration(self): set_migration_started('yellow', self.slug, dry_run=True) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue( migration_in_progress('yellow', self.slug, include_dry_runs=True)) # Live migration finishes ... and is completed with normal migration set_migration_started('yellow', self.slug) self.assertTrue(migration_in_progress('yellow', self.slug))
def test_dry_run(self): set_migration_started('yellow', self.slug, True) self.assertFalse(get_migration_complete('yellow', self.slug)) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue(migration_in_progress('yellow', self.slug, True)) self.assertEqual(get_migration_status('yellow', self.slug), MigrationStatus.DRY_RUN) self.assertEqual(get_migration_status('yellow', 'otherslug'), MigrationStatus.NOT_STARTED)
def test_dry_run(self): set_migration_started('yellow', self.slug, True) self.assertFalse(get_migration_complete('yellow', self.slug)) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue(migration_in_progress('yellow', self.slug, True)) self.assertEqual(get_migration_status('yellow', self.slug), MigrationStatus.DRY_RUN) self.assertEqual(get_migration_status('yellow', 'otherslug'), MigrationStatus.NOT_STARTED)
def test_continue_live_migration(self): set_migration_started('yellow', self.slug, dry_run=True) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue( migration_in_progress('yellow', self.slug, include_dry_runs=True)) # Live migration finishes ... and is continued later set_migration_started('yellow', self.slug, dry_run=True) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue( migration_in_progress('yellow', self.slug, include_dry_runs=True))
def test_dry_run(self): set_migration_started('yellow', self.slug, dry_run=True) self.assertFalse(get_migration_complete('yellow', self.slug)) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue(migration_in_progress('yellow', self.slug, True)) self.assertEqual(get_migration_status('yellow', self.slug), MigrationStatus.DRY_RUN) self.assertEqual(get_migration_status('yellow', 'otherslug'), MigrationStatus.NOT_STARTED) progress = self.get_progress('yellow') self.assertIsNotNone(progress.started_on) self.assertLessEqual(progress.started_on, datetime.utcnow())
def test_dry_run(self): set_migration_started('yellow', self.slug, dry_run=True) self.assertFalse(get_migration_complete('yellow', self.slug)) self.assertFalse(migration_in_progress('yellow', self.slug)) self.assertTrue(migration_in_progress('yellow', self.slug, True)) self.assertEqual(get_migration_status('yellow', self.slug), MigrationStatus.DRY_RUN) self.assertEqual(get_migration_status('yellow', 'otherslug'), MigrationStatus.NOT_STARTED) progress = self.get_progress('yellow') self.assertIsNotNone(progress.started_on) self.assertLessEqual(progress.started_on, datetime.utcnow())
def timezone_migration_in_progress(domain): return migration_in_progress(domain, TZMIGRATION_SLUG)
def couch_sql_migration_in_progress(domain, include_dry_runs=True): return migration_in_progress(domain, COUCH_TO_SQL_SLUG, include_dry_runs)
def couch_sql_migration_in_progress(domain, include_dry_runs=True): return migration_in_progress(domain, COUCH_TO_SQL_SLUG, include_dry_runs)
def timezone_migration_in_progress(domain): return migration_in_progress(domain, TZMIGRATION_SLUG)