Exemplo n.º 1
0
    def setUp(self):
        if not os.getenv("DUSTY_ALLOW_INTEGRATION_TESTS"):
            raise RuntimeError(
                "You must set the env var DUSTY_ALLOW_INTEGRATION_TESTS to run integration tests. "
                "This may affect your local config, do not run integration tests on your actual "
                "machine unless you know what you're doing!"
            )
        self.handler = DustyClientTestingSocketHandler()
        client_logger.addHandler(self.handler)
        self.previous_config = get_config()
        self._clear_stdout()
        self.overridden_specs_path = tempfile.mkdtemp()
        write_default_config()
        save_config_value(constants.CONFIG_SETUP_KEY, True)
        save_config_value(constants.CONFIG_SPECS_REPO_KEY, "github.com/gamechanger/dusty-example-specs")

        self.tests_user = os.getenv("DUSTY_INTEGRATION_TESTS_USER", self.current_user)
        save_config_value(constants.CONFIG_MAC_USERNAME_KEY, self.tests_user)

        override_repo(get_specs_repo().remote_path, self.overridden_specs_path)
        self.fake_local_repo_location = "/tmp/fake-repo"
        self._set_up_fake_local_repo("/tmp/fake-repo")
        self._clear_stdout()
        self.exec_docker_processes = []
        reset_memoize_cache()
Exemplo n.º 2
0
    def setUp(self):
        self.temp_config_path = tempfile.mkstemp()[1]
        self.temp_specs_path = tempfile.mkdtemp()
        self.temp_repos_path = tempfile.mkdtemp()

        constants.CONFIG_PATH = self.temp_config_path
        write_default_config()
        save_config_value(constants.CONFIG_SPECS_REPO_KEY, 'github.com/org/dusty-specs')
        override_repo(get_specs_repo().remote_path, self.temp_specs_path)
        basic_specs_fixture()

        self.client_output = []
        self.capture_handler = TestCaptureHandler(self.client_output)
        logging.getLogger(constants.SOCKET_LOGGER_NAME).addHandler(self.capture_handler)
Exemplo n.º 3
0
    def setUp(self):
        self.temp_config_path = tempfile.mkstemp()[1]
        self.temp_specs_path = tempfile.mkdtemp()
        self.temp_repos_path = tempfile.mkdtemp()

        constants.CONFIG_PATH = self.temp_config_path
        write_default_config()
        save_config_value(constants.CONFIG_SPECS_REPO_KEY, 'github.com/org/dusty-specs')
        override_repo(get_specs_repo().remote_path, self.temp_specs_path)
        basic_specs_fixture()

        self.client_output = []
        self.capture_handler = TestCaptureHandler(self.client_output)
        logging.getLogger(constants.SOCKET_LOGGER_NAME).addHandler(self.capture_handler)
        reset_memoize_cache()
Exemplo n.º 4
0
 def setUp(self):
     if not os.getenv('DUSTY_ALLOW_INTEGRATION_TESTS'):
         raise RuntimeError('You must set the env var DUSTY_ALLOW_INTEGRATION_TESTS to run integration tests. '
                            'This may affect your local config, do not run integration tests on your actual '
                            "machine unless you know what you're doing!")
     self.previous_config = get_config()
     self._clear_stdout()
     self.overridden_specs_path = tempfile.mkdtemp()
     write_default_config()
     save_config_value(constants.CONFIG_SETUP_KEY, True)
     save_config_value(constants.CONFIG_SPECS_REPO_KEY, 'github.com/gamechanger/example-dusty-specs')
     save_config_value(constants.CONFIG_MAC_USERNAME_KEY, self.current_user)
     override_repo(get_specs_repo().remote_path, self.overridden_specs_path)
     self._set_up_fake_local_repo()
     self._clear_stdout()
Exemplo n.º 5
0
    def setUp(self):
        if not os.getenv('DUSTY_ALLOW_INTEGRATION_TESTS'):
            raise RuntimeError('You must set the env var DUSTY_ALLOW_INTEGRATION_TESTS to run integration tests. '
                               'This may affect your local config, do not run integration tests on your actual '
                               "machine unless you know what you're doing!")
        self.handler = DustyClientTestingSocketHandler()
        client_logger.addHandler(self.handler)
        self.previous_config = get_config()
        self._clear_stdout()
        self.overridden_specs_path = tempfile.mkdtemp()
        write_default_config()
        save_config_value(constants.CONFIG_SETUP_KEY, True)
        save_config_value(constants.CONFIG_SPECS_REPO_KEY, 'github.com/gamechanger/dusty-example-specs')

        self.tests_user = os.getenv('DUSTY_INTEGRATION_TESTS_USER', self.current_user)
        save_config_value(constants.CONFIG_MAC_USERNAME_KEY, self.tests_user)

        override_repo(get_specs_repo().remote_path, self.overridden_specs_path)
        self.fake_local_repo_location = '/tmp/fake-repo'
        self._set_up_fake_local_repo('/tmp/fake-repo')
        self._clear_stdout()
        self.exec_docker_processes = []
        reset_memoize_cache()