Ejemplo n.º 1
0
def requires_image(image):
    """Decorator for checking docker image existance.
    Image existence is cached on first check.
    """
    if image not in _images:
        _images[image] = docker.image_exists(image)

    return skipIf(not(_images[image]), u'requires the {} image'.format(image))
Ejemplo n.º 2
0
def requires_image(image):
    """Decorator for checking docker image existence.

    Image existence is cached on first check.
    """
    if image not in _images:
        _images[image] = docker.image_exists(image)

    return skipIf(not(_images[image]), u'requires the {} image'.format(image))
Ejemplo n.º 3
0
    def test_execute__install_plugins_cleanup_image_on_failure(self):
        custom_dir = root_dir + '/tests/fixtures/eslint_custom'
        tool = Eslint(self.problems, {
            'config': 'invalid.json',
            'install_plugins': True,
            'fixer': True
        }, custom_dir)
        target = 'has_errors.js'
        tool.process_files([target])

        problems = self.problems.all()
        eq_(1, len(problems))
        assert_in('Cannot find module', problems[0].body)

        ok_(docker.image_exists('nodejs'), 'original image is present')
        assert_not_in('eslint', docker.images(), 'no eslint image remains')
Ejemplo n.º 4
0
    def test_execute__install_plugins(self):
        custom_dir = root_dir + '/tests/fixtures/eslint_custom'
        tool = Eslint(self.problems, {
            'config': 'config.json',
            'install_plugins': True,
            'fixer': True
        }, custom_dir)
        target = 'has_errors.js'
        tool.process_files([target])

        problems = self.problems.all()
        eq_(2, len(problems), 'Should find errors')
        assert_in('Unexpected var', problems[0].body)

        ok_(docker.image_exists('nodejs'), 'original image is present')
        assert_not_in('eslint', docker.images(), 'no eslint image remains')
Ejemplo n.º 5
0
    def test_execute__install_plugins_cleanup_image_on_failure(self):
        custom_dir = root_dir + '/tests/fixtures/eslint_custom'
        tool = Eslint(self.problems, {
            'config': 'invalid.json',
            'install_plugins': True,
            'fixer': True
        }, custom_dir)
        target = 'has_errors.js'
        tool.process_files([target])

        problems = self.problems.all()
        self.assertEqual(1, len(problems))
        self.assertIn('Cannot find module', problems[0].body)

        self.assertTrue(docker.image_exists('eslint'),
                        'original image is present')
        for image in docker.images():
            self.assertNotIn('eslint-', image, 'no eslint image remains')
Ejemplo n.º 6
0
    def test_execute__install_plugins_cleanup_image_on_failure(self):
        custom_dir = root_dir + '/tests/fixtures/eslint_custom'
        tool = Eslint(self.problems, {
            'config': 'invalid.json',
            'install_plugins': True,
            'fixer': True
        }, custom_dir)
        target = 'has_errors.js'
        tool.process_files([target])

        problems = self.problems.all()
        self.assertEqual(1, len(problems))
        self.assertIn('invalid-rules', problems[0].body)
        self.assertIn('output the following error', problems[0].body)

        self.assertTrue(docker.image_exists('eslint'),
                        'original image is present')
        for image in docker.images():
            self.assertNotIn('eslint-', image, 'no eslint image remains')
Ejemplo n.º 7
0
    def test_execute__install_plugins(self):
        custom_dir = root_dir + '/tests/fixtures/eslint_custom'
        tool = Eslint(self.problems, {
            'config': 'config.json',
            'install_plugins': True,
            'fixer': True
        }, custom_dir)
        target = 'has_errors.js'
        tool.process_files([target])

        problems = self.problems.all()
        self.assertEqual(2, len(problems), 'Should find errors')
        self.assertIn('Unexpected var', problems[0].body)

        self.assertTrue(docker.image_exists('nodejs'),
                        'original image is present')

        for image in docker.images():
            self.assertNotIn('eslint-', image, 'no eslint image remains')
Ejemplo n.º 8
0
 def test_image_exists__no_exist(self):
     self.assertFalse(docker.image_exists('nevergonnaexist:tacos'))
Ejemplo n.º 9
0
 def check_dependencies(self):
     """
     See if ruby image exists
     """
     return docker.image_exists('ruby2')
Ejemplo n.º 10
0
 def check_dependencies(self):
     """
     See if the gpg image exists
     """
     return docker.image_exists('gpg')
Ejemplo n.º 11
0
 def check_dependencies(self):
     """
     See if the gpg image exists
     """
     return docker.image_exists('gpg')
Ejemplo n.º 12
0
 def check_dependencies(self):
     """See if the nodejs image exists
     """
     return docker.image_exists('nodejs')
Ejemplo n.º 13
0
 def check_dependencies(self):
     """
     See if the python2 image exists
     """
     return docker.image_exists('python2')
Ejemplo n.º 14
0
 def check_dependencies(self):
     """
     See if python image is available
     """
     return docker.image_exists('python2')
Ejemplo n.º 15
0
 def check_dependencies(self):
     """
     See if python2 or python3 image exists
     """
     return docker.image_exists('python2') or docker.image_exists('python3')
Ejemplo n.º 16
0
 def check_dependencies(self):
     """
     See if python2 container exists
     """
     return docker.image_exists('python2')
Ejemplo n.º 17
0
 def check_dependencies(self):
     """
     See if nodejs container exists
     """
     return docker.image_exists('nodejs')
Ejemplo n.º 18
0
 def check_dependencies(self):
     """
     See if ruby image exists
     """
     return docker.image_exists('ruby2')
Ejemplo n.º 19
0
 def check_dependencies(self):
     return docker.image_exists('nodejs')
Ejemplo n.º 20
0
 def test_image_exists__no_exist(self):
     self.assertFalse(docker.image_exists('nevergonnaexist:tacos'))
Ejemplo n.º 21
0
 def check_dependencies(self):
     """See if the nodejs image exists
     """
     return docker.image_exists('eslint')
Ejemplo n.º 22
0
 def check_dependencies(self):
     """
     See if swiftlint is on the system path.
     """
     return docker.image_exists('swiftlint')
Ejemplo n.º 23
0
 def check_dependencies(self):
     """
     See if standard is on the system path.
     """
     return docker.image_exists('nodejs')
Ejemplo n.º 24
0
 def check_dependencies(self):
     """
     See if credo image exists
     """
     return docker.image_exists('credo')
Ejemplo n.º 25
0
 def check_dependencies(self):
     """
     See if foodcritic is on the PATH
     """
     return docker.image_exists('ruby2')
Ejemplo n.º 26
0
 def check_dependencies(self):
     """
     See if foodcritic is on the PATH
     """
     return docker.image_exists('ruby2')
Ejemplo n.º 27
0
 def check_dependencies(self):
     """
     See if python2 image is installed
     """
     return docker.image_exists('python2')
Ejemplo n.º 28
0
 def check_dependencies(self):
     """
     See if golint image exists
     """
     return docker.image_exists('golint')
Ejemplo n.º 29
0
 def check_dependencies(self):
     """
     See if nodejs image exists
     """
     return docker.image_exists('nodejs')
Ejemplo n.º 30
0
 def check_dependencies(self):
     """
     See if python image is available
     """
     return docker.image_exists('python2')
Ejemplo n.º 31
0
 def check_dependencies(self):
     """
     See if checkstyle image exists
     """
     return docker.image_exists('checkstyle')
Ejemplo n.º 32
0
 def check_dependencies(self):
     """
     See if PHPCS is on the system path.
     """
     return docker.image_exists('phpcs')
Ejemplo n.º 33
0
 def check_dependencies(self):
     """
     See if luacheck image exists
     """
     return docker.image_exists('luacheck')
Ejemplo n.º 34
0
 def check_dependencies(self):
     """
     See if credo image exists
     """
     return docker.image_exists('credo')
Ejemplo n.º 35
0
 def check_dependencies(self):
     return docker.image_exists('credo')
Ejemplo n.º 36
0
 def check_dependencies(self):
     """
     See if checkstyle image exists
     """
     return docker.image_exists('checkstyle')
Ejemplo n.º 37
0
 def check_dependencies(self):
     """
     See if python2 image is installed
     """
     return docker.image_exists('python2')
Ejemplo n.º 38
0
 def check_dependencies(self):
     """
     See if the php container exists
     """
     return docker.image_exists('php')
Ejemplo n.º 39
0
 def check_dependencies(self):
     return docker.image_exists('luacheck')
Ejemplo n.º 40
0
 def check_dependencies(self):
     """
     See if swiftlint is on the system path.
     """
     return docker.image_exists('swiftlint')
Ejemplo n.º 41
0
 def check_dependencies(self):
     return docker.image_exists('python2')
Ejemplo n.º 42
0
 def check_dependencies(self):
     """
     See if the python2 image exists
     """
     return docker.image_exists('python2')
Ejemplo n.º 43
0
 def check_dependencies(self):
     """
     See if PHPCS is on the system path.
     """
     return docker.image_exists('phpcs')