Merge ~athos-ribeiro/ubuntu/+source/crmsh:dep8-timestamp-fail into ubuntu/+source/crmsh:ubuntu/devel

Proposed by Athos Ribeiro
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 187b35faf59bde57d079b79b4f4b6efd4a854d2d
Proposed branch: ~athos-ribeiro/ubuntu/+source/crmsh:dep8-timestamp-fail
Merge into: ubuntu/+source/crmsh:ubuntu/devel
Diff against target: 64 lines (+42/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/fix-findln-by-timestamp-test.patch (+34/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Andreas Hasenack Approve
Canonical Server packageset reviewers Pending
Canonical Server Reporter Pending
Review via email: mp+464044@code.launchpad.net

Description of the change

Fix unit tests which are failing during autopkgtest runs.

PPA: https://launchpad.net/~athos-ribeiro/+archive/ubuntu/crmsh-dep8/+packages

To post a comment you must log in.
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

This was forwarded to Debian through the Debian bug linked in the LP bug we are fixing with this MP.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Ok, the pacekamer.log file used in the test has no year in its timestamps:

Apr 03 13:03:34 15sp1-1 pacemaker-controld [1948] (do_state_transition) notice: State transition S_TRANSITION_ENGINE -> S_IDLE | input=I_TE_SUCCESS cause=C_FSA_INTERNAL origin=notify_crmd
Apr 03 13:18:34 15sp1-1 pacemaker-controld [1948] (crm_timer_popped) info: Cluster Recheck Timer (I_PE_CALC) just popped (900000ms)

+1

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: athos-ribeiro, ahasenack
Uploaders: athos-ribeiro, ahasenack
MP auto-approved

review: Approve
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

FWIW, this is the dep8 test run results for the PPA linked above:

* Results:
  - crmsh/4.6.0-1ubuntu2~ppa1
    + ✅ crmsh on noble for amd64 @ 10.04.24 21:42:43 Log️ 🗒️
    + ✅ crmsh on noble for arm64 @ 10.04.24 21:24:46 Log️ 🗒️
    + ✅ crmsh on noble for armhf @ 10.04.24 20:44:19 Log️ 🗒️
    + ✅ crmsh on noble for i386 @ 10.04.24 21:17:10 Log️ 🗒️
    + ✅ crmsh on noble for ppc64el @ 10.04.24 20:48:21 Log️ 🗒️
    + ✅ crmsh on noble for s390x @ 10.04.24 21:06:27 Log️ 🗒️

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Uploaded. Thanks, Andreas!

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 a3772b9..11dfed4 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+crmsh (4.6.0-1ubuntu2) noble; urgency=medium
7+
8+ - d/p/fix-findln-by-timestamp-test.patch: fix failing unit test.
9+ (Closes: #1068562) (LP: #2060536)
10+
11+ -- Athos Ribeiro <athos.ribeiro@canonical.com> Wed, 10 Apr 2024 16:14:45 -0300
12+
13 crmsh (4.6.0-1ubuntu1) noble; urgency=medium
14
15 * Merge with Debian; remaining changes:
16diff --git a/debian/patches/fix-findln-by-timestamp-test.patch b/debian/patches/fix-findln-by-timestamp-test.patch
17new file mode 100644
18index 0000000..14e996c
19--- /dev/null
20+++ b/debian/patches/fix-findln-by-timestamp-test.patch
21@@ -0,0 +1,34 @@
22+From ee77de8e8b2f9820303d9d049ad39ccf9fcc6ba3 Mon Sep 17 00:00:00 2001
23+From: xin liang <xliang@suse.com>
24+Date: Sun, 7 Apr 2024 09:46:13 +0800
25+Subject: [PATCH] Dev: unittest: Adjust unit test
26+
27+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068562
28+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/crmsh/+bug/2060536
29+Forwarded: https://github.com/ClusterLabs/crmsh/pull/1379/commits/ee77de8e8b2f9820303d9d049ad39ccf9fcc6ba3
30+Last-Update: 2024-04-10
31+---
32+ test/unittests/test_report_utils.py | 5 +++--
33+ 1 file changed, 3 insertions(+), 2 deletions(-)
34+
35+--- a/test/unittests/test_report_utils.py
36++++ b/test/unittests/test_report_utils.py
37+@@ -816,7 +816,8 @@
38+
39+ def test_findln_by_timestamp(self):
40+ target_time = "Apr 03 13:10"
41+- target_time_stamp = crmutils.parse_to_timestamp(target_time+' 2023')
42++ this_year = datetime.datetime.now().year
43++ target_time_stamp = crmutils.parse_to_timestamp(target_time+' '+str(this_year))
44+ with open('pacemaker.log') as f:
45+ data = f.read()
46+ constants.STAMP_TYPE = utils.determin_log_format(data)
47+@@ -828,7 +829,7 @@
48+ assert result_pre_line_stamp < target_time_stamp
49+
50+ target_time = "Apr 03 11:01:19"
51+- target_time_stamp = crmutils.parse_to_timestamp(target_time+' 2023')
52++ target_time_stamp = crmutils.parse_to_timestamp(target_time+' '+str(this_year))
53+ result_line = utils.findln_by_timestamp(data, target_time_stamp, pacemaker_file_path)
54+ result_time = ' '.join(data.split('\n')[result_line-1].split()[:3])
55+ self.assertEqual(result_time, target_time)
56diff --git a/debian/patches/series b/debian/patches/series
57index b77d82f..9a8e2ee 100644
58--- a/debian/patches/series
59+++ b/debian/patches/series
60@@ -15,3 +15,4 @@
61 0019-Remove-news-adoc.patch
62 0020-Replace-distutils.patch
63 0021-Fix-bootstrap-bash.patch
64+fix-findln-by-timestamp-test.patch

Subscribers

People subscribed via source and target branches