[med-svn] [Git][med-team/gfaz][master] 2 commits: Run upstream test suite from examples in autopkgtest

Andreas Tille (@tille) gitlab at salsa.debian.org
Thu Nov 5 08:21:16 GMT 2026



Andreas Tille pushed to branch master at Debian Med / gfaz


Commits:
fa2619d9 by Andreas Tille at 2026-11-05T09:11:23+01:00
Run upstream test suite from examples in autopkgtest

Ship the upstream tests and fixtures as examples in a new gfaz-examples package, install README.test and run-unit-test in its documentation directory, and replace the local smoke test with the Debian Med style run-unit-test autopkgtest that copies the examples to a temporary directory and runs tests/run_all.py against the installed gfaz and python3-gfaz packages.

A small quilt patch lets the regression helpers locate the installed gfaz executable through GFAZ_BIN and makes the binding-suite rerun hint independent of a build tree.

- - - - -
ea4f1ee8 by Andreas Tille at 2026-11-05T09:17:28+01:00
Upload to unstable

- - - - -


11 changed files:

- + debian/README.test
- debian/changelog
- debian/control
- + debian/gfaz-examples.docs
- + debian/gfaz-examples.examples
- + debian/patches/0003-Allow-running-tests-from-installed-examples.patch
- debian/patches/series
- debian/rules
- − debian/tests/command-line
- debian/tests/control
- + debian/tests/run-unit-test


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,15 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+The upstream test suite and its fixtures are installed as examples in
+
+    /usr/share/doc/gfaz-examples/examples
+
+Run
+
+    sh run-unit-test
+
+from this directory to copy the examples to a temporary directory and run
+the complete upstream test suite (tests/run_all.py) against the installed
+gfaz executable and Python module.  The gfaz and python3-gfaz packages are
+installed automatically as dependencies of gfaz-examples.


=====================================
debian/changelog
=====================================
@@ -1,9 +1,11 @@
-gfaz (0.0~git20260915.f1c1b7f-2) UNRELEASED; urgency=medium
+gfaz (0.0~git20260915.f1c1b7f-2) unstable; urgency=medium
 
   * Build shared and static gfaz libraries to enable building vg against
     these
+  * Ship the upstream test suite as examples in a new gfaz-examples
+    package and run it from the autopkgtest run-unit-test script.
 
- -- Andreas Tille <tille at debian.org>  Thu, 05 Nov 2026 15:00:00 +0100
+ -- Andreas Tille <tille at debian.org>  Thu, 05 Nov 2026 09:14:59 +0100
 
 gfaz (0.0~git20260915.f1c1b7f-1) unstable; urgency=medium
 


=====================================
debian/control
=====================================
@@ -45,6 +45,21 @@ Description: Python bindings for the GFAz GFA compressor
  .
  This package contains the gfa_compression Python module.
 
+Package: gfaz-examples
+Section: science
+Architecture: all
+Depends:
+ gfaz,
+ python3-gfaz,
+ ${misc:Depends},
+Description: GFA compression tool based on 2-mer reordering - examples and tests
+ GFAz compresses Graphical Fragment Assembly (GFA) files by reordering
+ segments and encoding paths with a learned grammar on top of Zstandard.
+ .
+ This package contains the upstream test suite and example data.  After
+ installing it, the suite can be run with the run-unit-test script in
+ /usr/share/doc/gfaz-examples.
+
 Package: libgfaz0
 Section: libs
 Architecture: any


=====================================
debian/gfaz-examples.docs
=====================================
@@ -0,0 +1,2 @@
+debian/README.test
+debian/tests/run-unit-test


=====================================
debian/gfaz-examples.examples
=====================================
@@ -0,0 +1,2 @@
+example.gfa
+tests


=====================================
debian/patches/0003-Allow-running-tests-from-installed-examples.patch
=====================================
@@ -0,0 +1,51 @@
+Description: Allow running the test suite from installed examples
+ The Debian package ships the upstream test suite as examples.  Let the
+ regression helpers take the gfaz executable from GFAZ_BIN so the suite can
+ run against the installed binary instead of a build tree, and make the
+ final hint about rerunning the binding suite independent of a build tree.
+Origin: Debian
+Forwarded: not-needed
+Last-Update: 2026-11-05
+Assisted-By: DeepSeek V4.1 Flash Free
+
+diff --git a/tests/regression/regression_utils.py b/tests/regression/regression_utils.py
+index 326ab35..6484ddc 100644
+--- a/tests/regression/regression_utils.py
++++ b/tests/regression/regression_utils.py
+@@ -6,7 +6,7 @@ from pathlib import Path
+ 
+ REPO_ROOT = Path(__file__).resolve().parents[2]
+ BUILD_DIR = REPO_ROOT / "build"
+-CLI_PATH = BUILD_DIR / "bin" / "gfaz"
++CLI_PATH = Path(os.environ.get("GFAZ_BIN", BUILD_DIR / "bin" / "gfaz"))
+ 
+ # Exit code the runner (tests/run_all.py) interprets as "skipped, not failed".
+ # Matches the automake convention so CTest/CI can treat it specially too.
+@@ -95,7 +95,7 @@ def ensure_cli_exists(cli_path: Path):
+   if cli_path.exists():
+     return
+   raise FileNotFoundError(
+-      f"CLI binary not found at {cli_path}. Build the project before running regressions."
++      f"CLI binary not found at {cli_path}. Build the project or set GFAZ_BIN."
+   )
+ 
+ 
+diff --git a/tests/run_all.py b/tests/run_all.py
+index 686fb34..0b83152 100644
+--- a/tests/run_all.py
++++ b/tests/run_all.py
+@@ -154,9 +154,12 @@ def main():
+     print("Note: GPU/CUDA roundtrip NOT exercised, and no binding-capable "
+           "interpreter was found, so the CPU binding roundtrip was skipped too.")
+   else:
++    if BUILD_DIR.exists():
++      rerun = f"PYTHONPATH=build {binding_py}"
++    else:
++      rerun = "python3"
+     print("Note: GPU/CUDA roundtrip NOT exercised here. To run it:\n"
+-          f"  PYTHONPATH=build {binding_py} "
+-          "tests/regression/test_compression_regression.py")
++          f"  {rerun} tests/regression/test_compression_regression.py")
+ 
+   sys.exit(1 if nfail else 0)
+ 


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 0001-Use-system-pybind11.patch
 0002-Add-shared-libraries-and-install-rules.patch
+0003-Allow-running-tests-from-installed-examples.patch


=====================================
debian/rules
=====================================
@@ -15,3 +15,6 @@ override_dh_auto_install:
 	install -d debian/tmp/usr/lib/python3/dist-packages
 	install -m755 build/gfa_compression*.so \
 		debian/tmp/usr/lib/python3/dist-packages/
+
+override_dh_installexamples:
+	dh_installexamples -X__pycache__ -X'*.pyc'


=====================================
debian/tests/command-line deleted
=====================================
@@ -1,28 +0,0 @@
-#!/bin/sh
-set -eu
-
-tmp=$(mktemp -d)
-trap 'rm -rf "$tmp"' EXIT
-cd "$tmp"
-
-cat > in.gfa <<'GFA'
-H	VN:Z:1
-S	1	AC	LN:i:2
-S	2	G	LN:i:1
-S	3	TTA	LN:i:3
-S	4	C	LN:i:1
-P	pathA	1+,2+,3+	2M,1M
-P	pathB	1+,3-,4+	*
-W	sampleA	0	chr1	0	6	>1>2>3
-W	sampleB	1	chr2	*	*	>1<3>4
-GFA
-
-gfaz --help >/dev/null
-gfaz compress in.gfa in.gfaz
-gfaz decompress in.gfaz out.gfa
-
-sort in.gfa > expected
-sort out.gfa > got
-diff -u expected got
-
-python3 -c 'import gfa_compression; print(gfa_compression.__doc__.splitlines()[0])'


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
-Tests: command-line
+Tests: run-unit-test
 Depends: @
 Restrictions: allow-stderr


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+pkg=gfaz-examples
+
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "$AUTOPKGTEST_TMP"
+cd "$AUTOPKGTEST_TMP"
+
+export GFAZ_BIN=/usr/bin/gfaz
+python3 tests/run_all.py



View it on GitLab: https://salsa.debian.org/med-team/gfaz/-/compare/d788a74257ccb37aee6d41d7a6a662ba96442189...ea4f1ee8a1ec75bc9c2f98ba77cfea412a59814f

-- 
View it on GitLab: https://salsa.debian.org/med-team/gfaz/-/compare/d788a74257ccb37aee6d41d7a6a662ba96442189...ea4f1ee8a1ec75bc9c2f98ba77cfea412a59814f
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261105/11f1b069/attachment-0001.htm>


More information about the debian-med-commit mailing list