Refactor functional tests infrastructure #67

Manually merged
jabber.developer2 merged 6 commits from fix/functional_tests_v2 into master 2026-01-07 10:51:33 +00:00
Collaborator

Description

This PR modernizes the functional test infrastructure by removing the libexpect/tcl dependency and migrating all tests to use the new stabber API with content-based stubbing.

Changes

Docker & Build:

  • Add TERM=xterm-256color to all Dockerfiles for PTY support
  • Fix SSL verification and Arch reflector error handling
  • Enable functional tests unconditionally when stabber/cmocka available

Test Infrastructure:

  • Replace libexpect with native forkpty() implementation
  • Add prof_output_exact() and prof_output_regex() for flexible output matching
  • Improve timeout handling and synchronization

Test Migration (new stabber API):

  • Replace all stbbr_for_id() calls with stbbr_for_query()/stbbr_send()
  • Content-based stubbing matches stanzas by namespace/query instead of ID
  • More reliable and doesn't depend on internal ID generation
  • Use regex assertions for more robust output matching
  • Fix timing issues in chat_session and presence tests

Documentation & CI:

  • Add Valgrind suppressions (prof.supp) for pthread TLS
  • Update ci-build.sh with optimized test configurations
  • Document functional test best practices in CONTRIBUTING.md
  • Complete migration from stbbr_for_id to content-based stubbing

Testing

  • All 69 functional tests pass on Ubuntu
  • All 69 functional tests pass on Arch Linux
  • Valgrind: 0 memory leaks
  • Uses new stabber API: stbbr_for_query(), stbbr_for_presence_to(), stbbr_send()
  • See stabber documentation for API details

Commits

  1. build(docker): add TERM env, fix SSL and reflector handling
  2. build: enable functional tests unconditionally
  3. refactor(tests): replace libexpect with forkpty() for PTY handling
  4. refactor(tests): migrate to content-based stubbing
  5. feat: add Valgrind suppressions and update CI/docs

Resolves #59

### Description This PR modernizes the functional test infrastructure by removing the libexpect/tcl dependency and migrating all tests to use the new [stabber](https://github.com/profanity-im/stabber) API with content-based stubbing. #### Changes **Docker & Build:** - Add `TERM=xterm-256color` to all Dockerfiles for PTY support - Fix SSL verification and Arch reflector error handling - Enable functional tests unconditionally when stabber/cmocka available **Test Infrastructure:** - Replace libexpect with native `forkpty()` implementation - Add `prof_output_exact()` and `prof_output_regex()` for flexible output matching - Improve timeout handling and synchronization **Test Migration (new stabber API):** - Replace all `stbbr_for_id()` calls with `stbbr_for_query()`/`stbbr_send()` - Content-based stubbing matches stanzas by namespace/query instead of ID - More reliable and doesn't depend on internal ID generation - Use regex assertions for more robust output matching - Fix timing issues in chat_session and presence tests **Documentation & CI:** - Add Valgrind suppressions (prof.supp) for pthread TLS - Update ci-build.sh with optimized test configurations - Document functional test best practices in CONTRIBUTING.md - Complete migration from `stbbr_for_id` to content-based stubbing #### Testing - ✅ All 69 functional tests pass on Ubuntu - ✅ All 69 functional tests pass on Arch Linux - ✅ Valgrind: 0 memory leaks #### Related - Uses new stabber API: `stbbr_for_query()`, `stbbr_for_presence_to()`, `stbbr_send()` - See [stabber documentation](https://github.com/profanity-im/stabber) for API details #### Commits 1. `build(docker)`: add TERM env, fix SSL and reflector handling 2. `build`: enable functional tests unconditionally 3. `refactor(tests)`: replace libexpect with forkpty() for PTY handling 4. `refactor(tests)`: migrate to content-based stubbing 5. `feat`: add Valgrind suppressions and update CI/docs Resolves #59
jabber.developer2 added 5 commits 2026-01-06 17:19:20 +00:00
- Add TERM=xterm-256color for PTY support in functional tests
- Disable SSL verification for git clone in restricted networks
- Add error handling for Arch reflector installation
- Remove conditional compilation for functional tests
- Always build with stabber/cmocka when available
- Simplify test configuration in Makefile.am
- Remove dependency on libexpect/tcl
- Implement native PTY handling with forkpty()
- Add prof_output_exact/regex for flexible output matching
- Improve timeout handling and synchronization
feat: add Valgrind suppressions and update CI/docs
Some checks failed
CI Code / Check coding style (pull_request) Has been cancelled
CI Code / Check spelling (pull_request) Has been cancelled
CI Code / Linux (arch) (pull_request) Has been cancelled
CI Code / Linux (ubuntu) (pull_request) Has been cancelled
CI Code / Linux (debian) (pull_request) Has been cancelled
8091544ecd
- Add prof.supp with pthread TLS suppressions
- Update ci-build.sh with test configurations
- Document functional test best practices in CONTRIBUTING.md
jabber.developer2 force-pushed fix/functional_tests_v2 from 8091544ecd to 1f5297f10e 2026-01-06 17:33:01 +00:00 Compare
jabber.developer force-pushed fix/functional_tests_v2 from 1f5297f10e to 64d4f63895 2026-01-07 09:16:24 +00:00 Compare
jabber.developer2 added 1 commit 2026-01-07 10:42:06 +00:00
docs: update CONTRIBUTING.md to clarify functional test guidelines
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Linux (debian) (pull_request) Successful in 1h4m49s
CI Code / Linux (ubuntu) (pull_request) Successful in 1h5m2s
CI Code / Linux (arch) (pull_request) Successful in 1h7m52s
00bc164c27
admin force-pushed fix/functional_tests_v2 from 00bc164c27 to a719f70fda 2026-01-07 10:46:00 +00:00 Compare
admin force-pushed fix/functional_tests_v2 from a719f70fda to a90eef1cb2 2026-01-07 10:46:47 +00:00 Compare
jabber.developer2 manually merged commit a90eef1cb2 into master 2026-01-07 10:51:33 +00:00

Note: The changes were reviewed in #63

Note: The changes were reviewed in #63
Sign in to join this conversation.
No description provided.