Skip to content

MIM-2712 Update pubsub tools - #4718

Merged
chrzaszcz merged 2 commits into
feature/pubsubfrom
update-pubsub-tools
May 15, 2026
Merged

MIM-2712 Update pubsub tools#4718
chrzaszcz merged 2 commits into
feature/pubsubfrom
update-pubsub-tools

Conversation

@chrzaszcz

@chrzaszcz chrzaszcz commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

This PR updates the big-test PubSub helpers to the newer Escalus PubSub API and aligns the affected suites with the new helper contract.

The main goal is to make the test utilities work cleanly with the newer stanza builders while keeping negative-path testing and corner-case coverage practical.

Notes:

What changed

pubsub_tools

  • Switched to the updated escalus_pubsub_stanza API
  • Added explicit recipient routing when sending IQs
  • Added support for generic malformed PubSub requests for negative tests
  • Added retrieval of selected items
  • Improved error checking, including PubSub-specific error conditions
  • Added support for custom request shaping and options such as subscriber_jid
  • Simplified publish request construction
  • Using 2-tuples (without type) consistently for data forms - this weakens a check in pubsub_old_SUITE, but it is for the sake of simplicity.

Updated suites

The following suites were adjusted to stay compatible with the helper changes:

  • pep_old_SUITE
  • pubsub_old_SUITE
  • pubsub_s2s_SUITE
  • push_pubsub_SUITE
  • push_integration_SUITE
  • gdpr_SUITE

Why

The new PEP work depends on a more capable and less fragile PubSub test helper layer.

This PR prepares that ground by:

  • aligning helper code with the newer Escalus API,
  • reducing custom stanza-building in suites,
  • making negative-path PubSub tests easier to express,
  • and keeping existing PubSub/PEP/push/GDPR tests working with the new helper contract.

@mongoose-im

mongoose-im commented May 14, 2026

Copy link
Copy Markdown
Collaborator

CircleCI results for a646832


small_tests_legacy / small_tests / 0183d94
Reports root / small


small_tests_latest / small_tests / 0183d94
Reports root / small


small_tests_latest_arm64 / small_tests / 0183d94
Reports root / small


ldap_mnesia_latest / ldap_mnesia / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 2275 / Failed: 0 / User-skipped: 1490 / Auto-skipped: 0


internal_mnesia_latest / internal_mnesia / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 18 / Failed: 0 / User-skipped: 0 / Auto-skipped: 0


dynamic_domains_pgsql_cets_legacy / pgsql_cets / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5034 / Failed: 0 / User-skipped: 232 / Auto-skipped: 0


dynamic_domains_pgsql_cets_latest / pgsql_cets / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5034 / Failed: 0 / User-skipped: 232 / Auto-skipped: 0


pgsql_cets_legacy / pgsql_cets / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5349 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


pgsql_redis_latest / pgsql_redis / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5482 / Failed: 0 / User-skipped: 325 / Auto-skipped: 0


pgsql_cets_latest / pgsql_cets / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5349 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


cockroachdb_cets_latest / cockroachdb_cets / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5349 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


elasticsearch_and_cassandra_mnesia_latest / elasticsearch_and_cassandra_mnesia / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 3093 / Failed: 0 / User-skipped: 1367 / Auto-skipped: 0

mongoose_elasticsearch_SUITE:end_per_suite
{error,
  {{badrpc,
     {'EXIT',
       {#{what => event_already_registered,
        event_name => wpool_global_queue_lengths,
        labels => #{pool_type => elastic,pool_tag => default}},
        [{mongoose_instrument,set_up,3,
           [{file,
            "/home/circleci/project/src/instrument/mongoose_instrument.erl"},
          {line,110}]},
         {lists,foreach_1,2,[{file,"lists.erl"},{line,2641}]},
         {mongoose_wpool,start,5,
           [{file,
            "/home/circleci/project/src/wpool/mongoose_wpool.erl"},
          {line,162}]},
         {mongoose_wpool,'-start_configured_pools/3-lc$^1/1-1-',1,
           [{file,
            "/home/circleci/project/src/wpool/mongoose_wpool.erl"},
          {line,129}]},
         {mongoose_wpool,start_configured_pools,1,[]}]}}},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},
       mongoose_wpool,start_configured_pools,
       [[#{scope => global,tag => default,type => elastic,
         opts =>
           #{strategy => best_worker,workers => 10,
           call_timeout => 5000},
         conn_opts => #{port => 9200,host => <<"localhost">>}}]]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1393}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}...

Report log


mysql_cets_latest / mysql_cets / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5347 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0


pgsql_mnesia_latest / pgsql_mnesia / 0183d94
Status: 🟢 Passed
Reports root/ big
OK: 5516 / Failed: 0 / User-skipped: 291 / Auto-skipped: 0

@chrzaszcz
chrzaszcz force-pushed the update-pubsub-tools branch 2 times, most recently from 60b9a42 to 6bffeb1 Compare May 14, 2026 12:09
@chrzaszcz chrzaszcz changed the title Update pubsub tools MIM-2712 Update pubsub tools May 14, 2026
@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.90%. Comparing base (30d85c0) to head (0183d94).
⚠️ Report is 5 commits behind head on feature/pubsub.

Additional details and impacted files
@@                Coverage Diff                 @@
##           feature/pubsub    #4718      +/-   ##
==================================================
+ Coverage           85.87%   85.90%   +0.03%     
==================================================
  Files                 541      541              
  Lines               32504    32504              
==================================================
+ Hits                27912    27922      +10     
+ Misses               4592     4582      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Use the updated Escalus API (escalus_pubsub_stanza)
- Allow sending generic pubsub requests to test error conditions
- Automatically check incoming notifications without assuming an order
- Simplify creation of publish requests
- Allow retrieving selected items
- Add detailed error checking
- Simplify form handlign by always using 2-tuples for fields (w/o type)
- Allow setting custom options like subscriber_jid test corner cases

Also, update existing tests to stay compatible with the helpers.
Updates to old PEP/PubSub tests are minimal on purpose, because these
suites will be removed.
@chrzaszcz
chrzaszcz force-pushed the update-pubsub-tools branch 2 times, most recently from 93b187a to 3f8e7eb Compare May 14, 2026 13:35
@chrzaszcz
chrzaszcz marked this pull request as ready for review May 15, 2026 06:18
@pawlooss1
pawlooss1 self-requested a review May 15, 2026 11:49

@pawlooss1 pawlooss1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I've also merged esl/escalus#290, so you can amend the version upgrade commit and merge this PR.

@chrzaszcz
chrzaszcz force-pushed the update-pubsub-tools branch from 3f8e7eb to 0183d94 Compare May 15, 2026 12:43
@chrzaszcz
chrzaszcz merged commit 57029bc into feature/pubsub May 15, 2026
4 checks passed
@chrzaszcz
chrzaszcz deleted the update-pubsub-tools branch May 15, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants