| |
@@ -171,6 +171,26 @@
|
| |
helpers.AnyStringWith('freshmaker-rpms-foo-docker'),
|
| |
commit='commit', logger=log, ssh=False)
|
| |
|
| |
+ def test_generate_os_error(self):
|
| |
+ self.clone_distgit_repo.side_effect = OSError(
|
| |
+ "Got an error (128) from git: fatal: reference is not a tree: "
|
| |
+ "4d42e2009cec70d871c65de821396cd750d523f1")
|
| |
+
|
| |
+ image = ContainerImage.create({"brew": {"build": "nvr"}})
|
| |
+ ret = image._get_additional_data_from_distgit(
|
| |
+ "rpms/foo-docker", "branch", "commit")
|
| |
+ self.assertEqual(ret["generate_pulp_repos"], False)
|
| |
+
|
| |
+ self.assertEqual(
|
| |
+ image["error"],
|
| |
+ "Error while cloning dist-git repo: Got an error (128) from git: "
|
| |
+ "fatal: reference is not a tree: 4d42e2009cec70d871c65de821396cd750d523f1")
|
| |
+
|
| |
+ self.clone_distgit_repo.assert_called_once_with(
|
| |
+ 'rpms', 'foo-docker',
|
| |
+ helpers.AnyStringWith('freshmaker-rpms-foo-docker'),
|
| |
+ commit='commit', logger=log, ssh=False)
|
| |
+
|
| |
def test_generate_no_namespace(self):
|
| |
self.path_exists.return_value = True
|
| |
self.patched_open.side_effect = [
|
| |
This exception can be handled in case the dist-git commit from which the container
image has been built does not exist in dist-git anymore. This is probably an issue
in the workflow or dist-git itself, but Freshmaker should handle that.
Before this commit, Freshmaker marked whole Event as failed.
After this commit, it will only mark particular container image build as failed, but
it will still rebuild the other images.