Merge ~mitchburton/ubuntu/+source/landscape-client:2084586-add-python3-yaml-dep-plucky into ubuntu/+source/landscape-client:ubuntu/plucky-devel

Proposed by Mitch Burton
Status: Merged
Merged at revision: 86dde36a21aec6621d141e858d36a7fc9af75669
Proposed branch: ~mitchburton/ubuntu/+source/landscape-client:2084586-add-python3-yaml-dep-plucky
Merge into: ubuntu/+source/landscape-client:ubuntu/plucky-devel
Diff against target: 88 lines (+56/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/fix-plucky-tests.patch (+46/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Lukas Märdian (community) Approve
Canonical Server Reporter Pending
git-ubuntu import Pending
Review via email: mp+477532@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mitch Burton (mitchburton) wrote :

I can split this into two merge requests if that' better - one for the unit test fixes and one for the python3-yaml dep addition.

Revision history for this message
Mitch Burton (mitchburton) wrote :
Revision history for this message
Lukas Märdian (slyon) wrote :

LGTM. I can confirm this matches the changes merged upstream, except for some minimal changes in the comments (and existing context), i.e.:

1/ landscape/client/broker/tests/test_transport.py (context):
   message_api=b"X.Y" vs message_api="X.Y"

2/ landscape/lib/testing.py
   # Required for failures to get GC'd and properly flushed.
   # Twisted did this for us in versions < 24.10.
   VS
   # Required for some failures to get GC'd properly flushed.
   # Twisted did this in versions < 24.10, but now we have to.

LGTM. Sponsoring into Plucky.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 9fdb054..82fa383 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+landscape-client (24.08-0ubuntu3) plucky; urgency=medium
7+
8+ * d/control: add python3-yaml dependency to landscape-client (LP: #2084586)
9+ * d/p/fix-plucky-tests.patch: fix unit tests on Twisted >= 24.10
10+
11+ -- Mitch Burton <mitch.burton@canonical.com> Fri, 29 Nov 2024 14:18:44 -0800
12+
13 landscape-client (24.08-0ubuntu2) oracular; urgency=medium
14
15 * d/t/control: add unit tests
16diff --git a/debian/control b/debian/control
17index 3a859a6..de262c9 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -42,7 +42,8 @@ Depends: ${python3:Depends}, ${misc:Depends}, ${extra:Depends},
21 ${shlibs:Depends},
22 landscape-common (= ${binary:Version}),
23 python3-pycurl,
24- python3-dbus
25+ python3-dbus,
26+ python3-yaml
27 Description: Landscape administration system client
28 Landscape is a web-based tool for managing Ubuntu systems. This
29 package is necessary if you want your machine to be managed in a
30diff --git a/debian/patches/fix-plucky-tests.patch b/debian/patches/fix-plucky-tests.patch
31new file mode 100644
32index 0000000..8d3cc72
33--- /dev/null
34+++ b/debian/patches/fix-plucky-tests.patch
35@@ -0,0 +1,46 @@
36+Description: Fix unit tests on Twisted >= 24.10
37+Author: Mitch Burton <mitch.burton@canonical.com>
38+Origin: https://github.com/canonical/landscape-client/pull/290
39+Last-Update: 2024-11-29
40+---
41+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
42+--- a/landscape/lib/testing.py
43++++ b/landscape/lib/testing.py
44+@@ -685,7 +685,15 @@
45+ # because the call might cancel it!
46+ call._data = self.call_later(seconds, fake)._data
47+ try:
48+- f(*args, **kwargs)
49++ deferred = f(*args, **kwargs)
50++
51++ if (
52++ hasattr(deferred, "result")
53++ and isinstance(deferred.result, Failure)
54++ ):
55++ # Required for some failures to get GC'd properly flushed.
56++ # Twisted did this in versions < 24.10, but now we have to.
57++ deferred.result.cleanFailure()
58+ except Exception:
59+ if call.active:
60+ self.cancel_call(call)
61+--- a/landscape/client/broker/tests/test_transport.py
62++++ b/landscape/client/broker/tests/test_transport.py
63+@@ -193,16 +193,10 @@
64+ message_api="X.Y",
65+ )
66+
67+- def got_result(ignored):
68++ def got_result(failure):
69+ self.assertIs(r.request, None)
70+ self.assertIs(r.content, None)
71+- logfile_value = self.logfile.getvalue()
72+- # pycurl error messages vary by version.
73+- # First is for <= noble, second for > noble.
74+- self.assertTrue(
75+- "server certificate verification failed" in logfile_value
76+- or "SSL certificate problem" in logfile_value,
77+- )
78++ self.assertEqual(failure.value.error_code, 60)
79+
80+ result.addErrback(got_result)
81+ return result
82diff --git a/debian/patches/series b/debian/patches/series
83index 051c373..0b133d7 100644
84--- a/debian/patches/series
85+++ b/debian/patches/series
86@@ -1 +1,2 @@
87 fix-landscape-client-manpage.patch
88+fix-plucky-tests.patch

Subscribers

People subscribed via source and target branches