Merge ~sergiodj/ubuntu/+source/mosh:ubuntu/devel into ubuntu/+source/mosh:ubuntu/devel

Proposed by Sergio Durigan Junior
Status: Superseded
Proposed branch: ~sergiodj/ubuntu/+source/mosh:ubuntu/devel
Merge into: ubuntu/+source/mosh:ubuntu/devel
Diff against target: 88 lines (+56/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/tests/control (+3/-0)
debian/tests/upstream-tests (+44/-0)
Reviewer Review Type Date Requested Status
Robie Basak Pending
Canonical Server packageset reviewers Pending
Canonical Server Reporter Pending
Review via email: mp+439344@code.launchpad.net

This proposal has been superseded by a proposal from 2023-03-22.

Description of the change

This MP implements mosh's dep8 test, as required by the MIR team in order to proceed with the process.

This dep8 test runs mosh's upstream testsuite. Unfortunately, there are a few idiosyncrasies that we have to overcome, so this script is a bit hacky.

- The testsuite contains hardcoded references to mosh's binaries, and will always try to use the locally-built ones. So we have to patch it and make it use the system-wide mosh instead.

- The testsuite contains a few .c files that are built for testing, and they expect the software to have been built before. So we need to build the package during the dep8 test.

- Logging is somewhat poorly done, so it's not always easy to extract useful info from it.

Nevertheless, I think this is a step in the right direction. I intend to also submit this to Debian.

autopkgtest [16:18:50]: @@@@@@@@@@@@@@@@@@@@ summary
upstream-tests PASS

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you so much Sergio, this is much more than a small first step!

Revision history for this message
Robie Basak (racb) wrote :

This looks great, thanks!

According to the autopkgtest spec, changing the source tree is not permitted, so I'll add a commit to take a copy first.

One inline comment - I'll add a commit for that, too.

So I have a couple of changes to this to propose back to you, and a separate smoke dep8 test to add. I'll submit my own MP that builds on your commits, and then supersede this one.

Personally I think the name debian/tests/upstream-tests has a redundant "tests" in there. I'd use debian/tests/upstream instead. Admittedly upstream-tests is the name the hello package uses. But it doesn't matter :)

Unmerged commits

57a8c1a... by Sergio Durigan Junior

changelog

aeb215d... by Sergio Durigan Junior

update-maintainer

bf3b6d1... by Sergio Durigan Junior

  * d/t/upstream-tests: New dep8 test which runs the upstream test
    suite against a system mosh.

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 af36f16..f2b7532 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+mosh (1.4.0-1ubuntu1) lunar; urgency=medium
7+
8+ * d/t/upstream-tests: New dep8 test which runs the upstream test
9+ suite against a system mosh.
10+
11+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Tue, 21 Mar 2023 15:56:42 -0400
12+
13 mosh (1.4.0-1build1) lunar; urgency=medium
14
15 * Rebuild against new libprotobuf32.
16diff --git a/debian/control b/debian/control
17index 6908e92..ea7df0e 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: mosh
22 Section: net
23 Priority: optional
24-Maintainer: Keith Winstein <keithw@mit.edu>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Keith Winstein <keithw@mit.edu>
27 Uploaders: Alex Chernyakhovsky <achernya@debian.org>, Benjamin Barenblat <bbaren@debian.org>
28 Build-Depends: debhelper-compat (= 12), protobuf-compiler, libprotobuf-dev, pkg-config, libutempter-dev, zlib1g-dev, libncurses5-dev, libssl-dev, bash-completion, locales <!nocheck>, tmux <!nocheck>, less <!nocheck>
29 Rules-Requires-Root: binary-targets
30diff --git a/debian/tests/control b/debian/tests/control
31new file mode 100644
32index 0000000..1596a19
33--- /dev/null
34+++ b/debian/tests/control
35@@ -0,0 +1,3 @@
36+Tests: upstream-tests
37+Depends: @, @builddeps@
38+Restrictions: allow-stderr
39diff --git a/debian/tests/upstream-tests b/debian/tests/upstream-tests
40new file mode 100755
41index 0000000..7694e09
42--- /dev/null
43+++ b/debian/tests/upstream-tests
44@@ -0,0 +1,44 @@
45+#!/bin/bash
46+
47+set -e
48+
49+# Build mosh. We need to do this because some of the test programs
50+# expect to link against libraries built here.
51+#
52+# We could use "Restrictions: build-needed" on d/t/control, but that'd
53+# also invoke dh_auto_test which only wastes our time.
54+echo "I: Building mosh"
55+./debian/rules override_dh_auto_configure
56+make -j$(nproc)
57+
58+# Remove all possible local mosh binaries that could confuse the test
59+# suite.
60+echo "I: Removing all locally-built mosh binaries"
61+rm -fv \
62+ scripts/mosh \
63+ src/frontend/mosh-client \
64+ src/frontend/mosh-server \
65+ src/tests/mosh-client \
66+ src/tests/mosh-server
67+
68+# Adjust mosh's test scripts to use mosh-{client,server} from the
69+# system.
70+echo "I: Adjusting mosh's test suite to use the system-installed mosh binaries"
71+find src/tests/ -type f | xargs sed -i \
72+ -e 's@ --client=.\?[^ ]*\/mosh-client.\? @ --client=/usr/bin/mosh-client @' \
73+ -e 's@ --server=.\?[^ ]*\/mosh-server.\? @ --server=/usr/bin/mosh-server @' \
74+ -e 's@\.\.\/\.\.\/scripts\/mosh@/usr/bin/mosh@' \
75+ -e 's@export MOSH_CLIENT=.*@export MOSH_CLIENT="/usr/bin/mosh-client"@' \
76+ -e 's@export MOSH_SERVER=.*@export MOSH_SERVER="/usr/bin/mosh-server"@'
77+
78+echo "I: Running tests"
79+if ! make check; then
80+ echo "E: Testsuite failed to run:"
81+ if [ -f src/tests/test-suite.log ]; then
82+ echo
83+ cat src/tests/test-suite.log
84+ fi
85+ exit 1
86+fi
87+
88+exit 0

Subscribers

People subscribed via source and target branches