From 4b7f4f04e39779c3496855ea46fff565c360a4d5 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 2 Nov 2026 02:14:11 +0100 Subject: Prepare a versioning mechanism for the tracker that works from tarballs --- tests/integration/test_stats.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py index 46e9c64..7b778d3 100644 --- a/tests/integration/test_stats.py +++ b/tests/integration/test_stats.py @@ -55,9 +55,10 @@ class StatsShape(TrackerTestCase): self.assertIsNotNone(root.find("torrents/count_mutex")) self.assertIsNotNone(root.find("connections/tcp/announce")) - def test_version_names_a_commit(self): - self.assertIn(b"opentracker", self.tracker.stats("version").lower() + b"opentracker") - self.assertRegex(self.tracker.stats("version"), rb"https?://") + def test_version_names_the_release(self): + # A build from a checkout appends what git describe said, a build from + # a tarball has nothing to append, so the commit is optional here. + self.assertRegex(self.tracker.stats("version"), rb"^opentracker \d+\.\d+\.\d+( \(\S+\))?\n$") class StatsCount(TrackerTestCase): -- cgit v1.3