[pmg-devel] [PATCH pmg-api 0/3] enable building with sbuild, by refactoring tests

Stoiko Ivanov s.ivanov at proxmox.com
Fri Jan 2 21:31:58 CET 2026


Building pmg-api in sbuild is currently not possible, due to 2 issues:
* the format_date_header tests in test_util.pl implicitly assume a
  CET/CEST timezone (patch 1/3)
* most other tests in pmg-api are integration-tests - they create postgres
  databases, dump them, start services, and expect syslog to work.
  this is changed by skipping the tests conditionally (with the condition
  evaluating to true in an sbuild environment)

I considered reworking the tests on the database to output a stable text file
for comparison (the output of `pmgdb dump` would work), but the RuleDB
code is tightly coupled to writing to the database - changing that would
amount to a far larger refactoring of pmg-api. So instead leave the
default build calls most of us working with pmg-api as they are and skip
the tests in sbuild (or by setting an environment variable).

checking out autopkgtests for the other tests is probably a good idea -
but should not prevent us from having a working sbuild target for pmg-api.

Stoiko Ivanov (3):
  tests: test_utils: do not rely on system timezone
  tests: make test nature explicit
  tests: conditionally skip integration tests

 src/tests/Makefile      | 32 +++++++++++++++++++-------------
 src/tests/test_utils.pl |  5 ++++-
 2 files changed, 23 insertions(+), 14 deletions(-)

-- 
2.47.3





More information about the pmg-devel mailing list