Merge pull request #12356 from AlanCoding/copytree_neo

Replace git shallow clone with shutil.copytree
This commit is contained in:
Alan Rominger
2022-08-17 10:07:28 -04:00
committed by GitHub
2 changed files with 229 additions and 259 deletions

View File

@@ -474,7 +474,7 @@ class TestGenericRun:
task.model.objects.get = mock.Mock(return_value=job)
task.build_private_data_files = mock.Mock(side_effect=OSError())
with mock.patch('awx.main.tasks.jobs.copy_tree'):
with mock.patch('awx.main.tasks.jobs.shutil.copytree'):
with pytest.raises(Exception):
task.run(1)
@@ -496,7 +496,7 @@ class TestGenericRun:
task.model.objects.get = mock.Mock(return_value=job)
task.build_private_data_files = mock.Mock()
with mock.patch('awx.main.tasks.jobs.copy_tree'):
with mock.patch('awx.main.tasks.jobs.shutil.copytree'):
with pytest.raises(Exception):
task.run(1)
@@ -1946,7 +1946,7 @@ def test_job_run_no_ee(mock_me):
task.update_model = mock.Mock(return_value=job)
task.model.objects.get = mock.Mock(return_value=job)
with mock.patch('awx.main.tasks.jobs.copy_tree'):
with mock.patch('awx.main.tasks.jobs.shutil.copytree'):
with pytest.raises(RuntimeError) as e:
task.pre_run_hook(job, private_data_dir)