From f43ff0eff2921f223086afdb8dde400b16f51447 Mon Sep 17 00:00:00 2001 From: Stefano Noferi Date: Tue, 6 Oct 2026 13:44:55 +0200 Subject: [PATCH] test(domains): mark the IBAN long-run timing test as a benchmark test_matching_time_on_long_runs checks a 50 ms budget for the IBAN matcher and the regex PII redactor on 64k characters. On the macOS runner of the v0.13.1 admina-core release it measured 51.6 ms for the redactor on the "IT60 " run, and the publish job was skipped until the job was rerun. The test carries the benchmark marker, so CI (-m "not benchmark") leaves it out; the other tests of the file still run. The other tests with a time limit stay in CI: the pattern-pack and probe tests assert that a quadratic pattern goes over the budget, the linear probe measures about 0.6 ms against 50 ms, the Presidio test has a 5 s limit and the prescanned-tag test measures 2 to 77 ms against 0.5 s. --- CHANGELOG.md | 7 +++++++ tests/test_iban_it.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a61be35..39ee24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,13 @@ stability commitment. See [ROADMAP.md](ROADMAP.md) for planned milestones. ## [Unreleased] +### Notes + +- `tests/test_iban_it.py::test_matching_time_on_long_runs` (a 50 ms budget + on 64k characters) carries the `benchmark` marker and is excluded from CI, + as the timing tests of `tests/test_firewall_pattern_timing.py` are. It + runs with `pytest -m benchmark tests/test_iban_it.py`. + ## [0.13.1] — 2026-10-06 Patch release: the compose file of `admina init` binds the dashboard, OTEL diff --git a/tests/test_iban_it.py b/tests/test_iban_it.py index 05c8919..8ac9563 100644 --- a/tests/test_iban_it.py +++ b/tests/test_iban_it.py @@ -208,6 +208,9 @@ def test_card_and_phone_numbers_in_one_text(regex_only): # ── Matching time on long inputs ────────────────────────────── +# A time budget on 64k characters: run with `pytest -m benchmark` (CI runs +# -m "not benchmark"; shared runners vary between runs). +@pytest.mark.benchmark @pytest.mark.parametrize("unit", ["IT60", "IT60 ", "IT60X", "IT60 X", "A1 ", "1 ", "+39 3"]) def test_matching_time_on_long_runs(regex_only, unit): from types import SimpleNamespace