Esempio n. 1
0
 def setUp(self):
     super(GitlabProducerTestCase, self).setUp()
     init_repositories(self.settings)
     (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
     add_repository(self.settings, 'common', 'site', bare)
     self.site_bare = bare
     gitlabproducer.config['settings'] = self.settings
     self.app = gitlabproducer.test_client()
Esempio n. 2
0
 def setUp(self):
     super(GitlabProducerTestCase, self).setUp()
     init_repositories()
     (bare, user) = create_fake_repository(self.sandbox_path, ['qa'])
     add_repository('common', 'site', bare)
     self.site_bare = bare
     gitlabproducer.config['settings'] = Settings()
     self.app = gitlabproducer.test_client()
Esempio n. 3
0
    def setUp(self):
        super(UpdateTest, self).setUp()

        ensure_environment(self.settings, 'production', 'master')
        ensure_environment(self.settings, 'qa', 'qa')

        init_repositories(self.settings)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'site', bare)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'hieradata', bare)

        self.lock = JensLockFactory.makeLock(self.settings)
Esempio n. 4
0
    def setUp(self):
        super(UpdateTest, self).setUp()

        ensure_environment(self.settings, 'production', 'master')
        ensure_environment(self.settings, 'qa', 'qa')

        init_repositories(self.settings)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'site', bare)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'hieradata', bare)

        self.lock = JensLockFactory.makeLock(self.settings)
Esempio n. 5
0
    def test_broken_repository_does_not_create_anything_and_recovers(self):
        self._jens_update()

        path = "/tmp/foobroken"
        add_repository(self.settings, 'modules', 'broken', path)
        self._create_fake_module('newguy', ['qa'])

        repositories_deltas = self._jens_update(errorsExpected=True,
            errorRegexp='foobroken')

        self.assertNotBare('modules/broken')
        self.assertBare('modules/newguy')
        self.assertFalse('broken' in repositories_deltas['modules']['new'])
        self.assertTrue('newguy' in repositories_deltas['modules']['new'])
        for branch in MANDATORY_BRANCHES:
            self.assertNotClone('modules/broken/%s' % branch)
            self.assertClone('modules/newguy/%s' % branch)
        self.assertEnvironmentLinks("production")
        self.assertEnvironmentLinks("qa")
        self.assertEnvironmentOverrideDoesntExist("production", 'modules/broken')
        self.assertEnvironmentOverride("production", 'modules/newguy', 'master')
Esempio n. 6
0
    def test_broken_repository_does_not_create_anything_and_recovers(self):
        self._jens_update()

        path = "/tmp/foobroken"
        add_repository(self.settings, 'modules', 'broken', path)
        self._create_fake_module('newguy', ['qa'])

        repositories_deltas = self._jens_update(errorsExpected=True,
            errorRegexp='foobroken')

        self.assertNotBare('modules/broken')
        self.assertBare('modules/newguy')
        self.assertFalse('broken' in repositories_deltas['modules']['new'])
        self.assertTrue('newguy' in repositories_deltas['modules']['new'])
        for branch in MANDATORY_BRANCHES:
            self.assertNotClone('modules/broken/%s' % branch)
            self.assertClone('modules/newguy/%s' % branch)
        self.assertEnvironmentLinks("production")
        self.assertEnvironmentLinks("qa")
        self.assertEnvironmentOverrideDoesntExist("production", 'modules/broken')
        self.assertEnvironmentOverride("production", 'modules/newguy', 'master')
Esempio n. 7
0
 def _create_fake_hostgroup(self, hostgroup, branches=[]):
     (bare, user) = create_fake_repository(self.settings, self.sandbox_path, branches)
     add_repository(self.settings, 'hostgroups', hostgroup, bare)
     return user
Esempio n. 8
0
 def _create_fake_module(self, modulename, branches=[]):
     (bare, user) = create_fake_repository(self.settings, self.sandbox_path, branches)
     add_repository(self.settings, 'modules', modulename, bare)
     return user
Esempio n. 9
0
 def _create_fake_hostgroup(self, hostgroup, branches=[]):
     (bare, user) = create_fake_repository(self.settings, self.sandbox_path, branches)
     add_repository(self.settings, 'hostgroups', hostgroup, bare)
     return user
Esempio n. 10
0
 def _create_fake_module(self, modulename, branches=[]):
     (bare, user) = create_fake_repository(self.settings, self.sandbox_path, branches)
     add_repository(self.settings, 'modules', modulename, bare)
     return user