Exemplo n.º 1
0
    def test_initialize_beam_repo_beam_exists(self):
        FLAGS.beam_location = tempfile.mkdtemp()

        with mock.patch.object(beam_benchmark_helper, '_PrebuildBeam') as mock_prebuild, \
            mock.patch.object(vm_util, 'GenTempDir'):

            mock_spec = mock.MagicMock()
            mock_spec.dpb_service.SERVICE_TYPE = dpb_service.DATAFLOW

            beam_benchmark_helper.InitializeBeamRepo(mock_spec)
            mock_prebuild.assert_called_once()
Exemplo n.º 2
0
    def test_initialize_beam_repo_beam_not_exists(self):
        FLAGS.beam_location = None

        with mock.patch.object(beam_benchmark_helper, '_PrebuildBeam') as mock_prebuild, \
            mock.patch.object(vm_util, 'GenTempDir'), \
            mock.patch.object(vm_util, 'GetTempDir'), \
            mock.patch.object(vm_util, 'IssueCommand') as mock_run:

            mock_spec = mock.MagicMock()
            mock_spec.dpb_service.SERVICE_TYPE = dpb_service.DATAFLOW

            beam_benchmark_helper.InitializeBeamRepo(mock_spec)

            expected_cmd = [
                'git', 'clone', 'https://github.com/apache/beam.git'
            ]
            mock_run.assert_called_once_with(expected_cmd,
                                             cwd=vm_util.GetTempDir())
            mock_prebuild.assert_called_once()
Exemplo n.º 3
0
def Prepare(benchmark_spec):
    beam_benchmark_helper.InitializeBeamRepo(benchmark_spec)
    benchmark_spec.always_call_cleanup = True
    kubernetes_helper.CreateAllFiles(getKubernetesScripts())
    pass
Exemplo n.º 4
0
def Prepare(benchmark_spec):
    beam_benchmark_helper.InitializeBeamRepo(benchmark_spec)
    pass