Example #1
0
    def test_run_test_environment_task(self):
        """
        Test that we can start tests in the test environment
        """
        test_id = '34fef34fsdf'

        name = 'livetest-pythonserver-{}'.format(test_id)

        container = GunicornDockerRunner(
            name=name, image='adsabs/pythonsimpleserver:v1.0.0')
        container.start()

        run_test_in_environment(test_id=test_id,
                                test_services=['adsrex'],
                                api_name=name)
 def setUp(self):
     """
     Setup the tests
     """
     self.name = 'livetest-adsws-pythonsimpleserver-{}'.format(gen_salt(5))
     self.builder = GunicornDockerRunner(
         image='adsabs/pythonsimpleserver:v1.0.0',
         name=self.name,
     )
     self.builder.start()
     info = self.builder.client.port(
         self.builder.container['Id'],
         80
     )[0]
     self.host = info['HostIp']
     self.port = info['HostPort']
Example #3
0
    def setUp(self, mocked):
        instance = mocked.return_value
        instance.create_container.return_value = {'Id': 'mocked'}
        instance.port.return_value = [{
            'HostIp': '127.0.0.1',
            'HostPort': 1234
        }]
        instance.containers.return_value = [{
            u'Command':
            u'/entrypoint.sh redis-server',
            u'Created':
            1443632967,
            u'Id':
            u'mocked',
            u'Image':
            u'redis',
            u'Labels': {},
            u'Names': [u'/livetest-redis-tLJpZ'],
            u'Ports': [{
                u'PrivatePort': 6379,
                u'Type': u'tcp'
            }],
            u'Status':
            u'Up About a minute'
        }]
        instance.create_host_config.return_value = {
            'PortBindings': {
                '80/tcp': [{
                    'HostPort': '',
                    'HostIp': ''
                }]
            },
            'NetworkMode': 'host'
        }

        self.instance = instance
        self.environment = dict(consul_host='localhost', consul_port=8500)
        self.builder = GunicornDockerRunner(network_mode="host",
                                            environment=self.environment)
Example #4
0
 def setUp(self):
     self.name = 'livetest-gunicorn-{}'.format(gen_salt(5))
     self.builder = GunicornDockerRunner(
         image='adsabs/pythonsimpleserver:v1.0.0',
         name=self.name,
     )