Bug#1139439: dh-elpa: integration tests

Xiyue Deng <[email protected]> Mon, 08 Jun 2026 18:36:13 -0700
Newsgroups gmane.linux.debian.devel.emacsen
Message-ID <87mrx4ijg2.fsf__20034.5743609191$1780969055$gmane$org@debian-qemu>
Package: dh-elpa
Version: 2.1.9
Severity: wishlist

I have modified and adapted the integration tests from dh-make-elpa to
work in dh-elpa. The tests work in a similar fashion as dh-make-elpa: in
a template repo that provides a minimal-ish set of files required for
dh_elpa command, run the command, and compare the output with an
expected repository, and check whether there are any diff. I hope this
provides a way to easily verify changes to the dh_elpa (and dh-elpa.el)
utility, especially debian/*.substvars to check whether the generated
"misc:Depends" and "elpa:Depends" are expected.

During implementation, I found some limitation of how the "dh_elpa"
command works and used some workarounds to make it work.

* The "dh_elpa" perl script uses global path that assumes a installed
  dh-elpa is available. However, the build time test needs to run from
  the source tree. As a result I extended the dh_elpa script to allow
  referencing files from the source tree (as well as other tweaks) to
  make it work during build time. The changes are guarded by a
  "--test-source-root" parameter.

* For multiple file packages, dh_elpa will create a tarball which cannot
  be compared with "diff" directly (which bremner had warned me before).
  For the time being, I just skip the tarball files as the unpacked
  directory is also available in the generated templates so their
  contents are still part of the comparisons.

I hope the diff tests can give more confidence when modifying dh_elpa,
especially for testing ideas like in Bug#1138884.

The changes are in an "integration-test" branch[1], and the diff against
master branch can be seen here[2]. An overview of how the tests work can
be found at the README.org[3].

Reviews and suggestions welcome!

[1] https://salsa.debian.org/emacsen-team/dh-elpa/-/tree/integration-test?ref_type=heads
[2] https://salsa.debian.org/emacsen-team/dh-elpa/-/compare/master...integration-test?from_project_id=18920
[3] https://salsa.debian.org/emacsen-team/dh-elpa/-/blob/integration-test/t/README.org?ref_type=heads

-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (200, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 7.0.10+deb14-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dh-elpa depends on:
ii  debhelper               13.32
ii  emacs                   1:30.2+1-3
ii  emacs-gtk [emacs]       1:30.2+1-3
ii  libarray-utils-perl     0.5-3
ii  libconfig-tiny-perl     2.30-1
ii  libdebian-source-perl   0.133
ii  libdpkg-perl            1.23.7
ii  libfile-find-rule-perl  0.35-1
ii  libtext-glob-perl       0.11-3
ii  perl                    5.40.1-8

dh-elpa recommends no packages.

dh-elpa suggests no packages.

-- no debconf information

-- 
Regards,
Xiyue Deng
signature.asc (application/pgp-signature, 861 B)
-----BEGIN PGP SIGNATURE-----

iQJHBAEBCgAxFiEEiKQfd6o81mjI+LWALell7WOCXJMFAmonbg0THG1hbnBoaXpA
ZGViaWFuLm9yZwAKCRAt6WXtY4Jck9WNEACbhTw7wzTVk7GaOZYp2t1B6H7W0CA6
gUw+9gCVihs316vnBrDOrN2EYi3UyQ61Hq0KbR+BNTf8g1O7ze1EyCjZBmedAFee
EYSWejvb3K4I2bWEydYfogEunj+s+/FQm6yqWp1fCp2tbIKxM5SywKnrDMi/RtYO
GOrRIuH8QWiY/pVO/Hctc319IJ1LfS6NhBzUTEMPJiGVsm4Mw9Tp7+xeF27PIiUM
S1MIX1GawWhHBJoxPNpYU2YzF1jfgGSjCK8bjR82wA03UmvgCSTJbgrhJNpwL8DJ
1Z+lwT34jMHBfQKYuL+WFWKebcYCg0N8Ilerbm+xtnShyJbRBN5GegTX4nTKgMc8
xz/6HW0xKfjTKHVDpydcKP95yaXU4on5bxyQo9bQKacSgbrvhKU7NKyEHFqzkjoi
LXG2S2sXLgd1w25NzS2ovouYZoSB01LRQrDJ3XdISVA1aiwLoVkUuWWT0B1V6/c9
cRBV56GcM6LyBh4tBeJ7/2063tstjmm/Rvj9s0ldwSqCUd0wfEmetmm5L8MQYkva
Y/OIanHbbg91NWBguddasvPJGiz9tOihYPRvdHlXIJmzPie8U333sNaLTUdBH2SV
VpxBwgr2B7++sLbYd344HWiPRfdjEuFP5vaUYXhAU3jaw30KAebuu5QUWmM91h55
96umLzyKszYwuA==
=fnuu
-----END PGP SIGNATURE-----