Package: tracker.debian.org Tags: patch
--- distro_tracker/vendor/debian/tests.py | 30 +++++++++++++++++++++++++++ distro_tracker/vendor/debian/tracker_tasks.py | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/distro_tracker/vendor/debian/tests.py b/distro_tracker/vendor/debian/tests.py index c98fe7f..ca61f23 100644 --- a/distro_tracker/vendor/debian/tests.py +++ b/distro_tracker/vendor/debian/tests.py @@ -4711,6 +4711,36 @@ class UpdateDebciStatusTaskTest(TestCase): self.assertEqual(ActionItem.objects.count(), 0) + def test_lib_package_link(self, mock_requests): + """ + Tests that links to lib packages' log files are correct. + """ + libpackage = SourcePackageName.objects.create(name='libpackage') + json_data = """ + [{ + "run_id": "20140705_143518", + "package": "libpackage", + "version": "3.0-3", + "date": "2014-07-05 17:33:08", + "status": "fail", + "blame": [ ], + "previous_status": "fail", + "duration_seconds": "222", + "duration_human": "0h 3m 42s", + "message": "Tests failed" + }] + """ + set_mock_response(mock_requests, text=json_data) + + self.run_task() + + action_item = libpackage.action_items.all()[0] + action_item_log_url = action_item.extra_data['log'] + log_url = "http://ci.debian.net/data/packages/unstable/amd64/libp/" + \ + "libpackage/latest-autopkgtest/log" + + self.assertEqual(action_item_log_url, log_url) + @mock.patch('distro_tracker.core.utils.http.requests') class UpdateAutoRemovalsStatsTaskTest(TestCase): diff --git a/distro_tracker/vendor/debian/tracker_tasks.py b/distro_tracker/vendor/debian/tracker_tasks.py index 7376cb3..42a266c 100644 --- a/distro_tracker/vendor/debian/tracker_tasks.py +++ b/distro_tracker/vendor/debian/tracker_tasks.py @@ -2085,9 +2085,13 @@ class UpdateDebciStatusTask(BaseTask): severity=ActionItem.SEVERITY_HIGH) package_name = debci_status.get('package') + if package_name[:3] == 'lib': + log_dir = package_name[:4] + else: + log_dir = package_name[:1] url = 'http://ci.debian.net/#package/' + package_name log = 'http://ci.debian.net/data/packages/unstable/amd64/' + \ - package_name[:1] + "/" + package_name + '/latest-autopkgtest/log' + log_dir + "/" + package_name + '/latest-autopkgtest/log' debci_action_item.short_description = self.ITEM_DESCRIPTION.format( debci_url=url, log_url=log) -- 1.9.1 -- To UNSUBSCRIBE, email to debian-qa-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/cal6k_ay1tbcvmiigrhkxa_21vqawprww_aqiwfmdud9kkbf...@mail.gmail.com