From 737309c88898a5f7384f3bd32e4711d68f8a466a Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Tue, 6 Jan 2026 19:54:36 +0300 Subject: [PATCH] fix(tests): complete migration to content-based stubbing in functional tests --- CONTRIBUTING.md | 4 ++-- ci-build.sh | 3 --- tests/functionaltests/test_receipts.c | 5 +++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 91dbe9a0..1c66e27f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -146,7 +146,7 @@ Historically the functional test suite relied on stabber's id based helpers like * Reordering internal requests produced hard-to-debug race conditions when an `id` no longer matched. * Parallel additions of new features could shift which stanzas received a given id causing unrelated test failures. -We are incrementally migrating to content based stubbing using direct sends (`stbbr_send`) and query hooks (`stbbr_for_query`). Instead of tying a response to a predicted id we now send the required server stanzas explicitly after initiating actions. Example (see `tests/functionaltests/proftest.c`): +We have migrated to content based stubbing using direct sends (`stbbr_send`) and query hooks (`stbbr_for_query`). Instead of tying a response to a predicted id we now send the required server stanzas explicitly after initiating actions. Example (see `tests/functionaltests/proftest.c`): ```c // Old brittle approach @@ -170,5 +170,5 @@ Guidelines when writing new functional tests: 4. Keep assertions tolerant of ordering when possible; rely on `prof_output_regex()` matches rather than hard-coded positions. 5. If timing flakiness appears, temporarily raise `prof_timeout()` around the critical expectation and reset it immediately afterwards. -During the migration it's acceptable for a test file to mix old and new styles; opportunistically refactor brittle sections when touching a test for other reasons. +The migration from `stbbr_for_id` is complete. All functional tests now use content-based stubbing. When adding new tests, follow the guidelines above. diff --git a/ci-build.sh b/ci-build.sh index b31bc521..0a3defb8 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -45,7 +45,6 @@ ARCH="$(uname | tr '[:upper:]' '[:lower:]')" case "$ARCH" in linux*) # Reduced set of configurations for faster CI - # Uncomment additional configurations for more thorough testing tests=( # 1. Full build (all features enabled) "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp @@ -66,7 +65,6 @@ case "$ARCH" in ;; darwin*) # Reduced set of configurations for faster CI - # Uncomment additional configurations for more thorough testing tests=( # 1. Full build (all features enabled) "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp @@ -93,7 +91,6 @@ case "$ARCH" in CC="egcc -std=gnu99 -fexec-charset=UTF-8" # Reduced set of configurations for faster CI - # Uncomment additional configurations for more thorough testing tests=( # 1. Full build (all features enabled) "--enable-notifications --enable-icons-and-clipboard --enable-otr --enable-pgp diff --git a/tests/functionaltests/test_receipts.c b/tests/functionaltests/test_receipts.c index 702e74c5..9a173a7f 100644 --- a/tests/functionaltests/test_receipts.c +++ b/tests/functionaltests/test_receipts.c @@ -30,8 +30,9 @@ send_receipt_request(void **state) prof_connect(); - stbbr_for_id("prof_caps_4", - "" + // Register disco#info response for capabilities query (receipts support) + stbbr_for_query("http://jabber.org/protocol/disco#info", + "" "" "" ""