Skip to content

chore: improve testing around socket-mode header synthesization - #1499

Merged
WilliamBergamin merged 1 commit into
mainfrom
imporve-unit-testing-around-socket-mode-headers
May 14, 2026
Merged

chore: improve testing around socket-mode header synthesization#1499
WilliamBergamin merged 1 commit into
mainfrom
imporve-unit-testing-around-socket-mode-headers

Conversation

@WilliamBergamin

Copy link
Copy Markdown
Contributor

Summary

  • Renamed build_retry_headers to build_headers in slack_bolt/adapter/socket_mode/internals.py to better reflect that this function synthesizes all HTTP-equivalent headers for Socket Mode requests, not just retry-related ones.
  • Removed the isolated unit test (test_run_bolt_app_propagates_retry_headers) that used a FakeApp mock to verify header propagation, in favor of higher-fidelity integration tests.
  • Added message event handler assertions to the four Socket Mode integration test suites, verify retry headers (x-slack-retry-num, x-slack-retry-reason) are correctly synthesized from the SocketModeRequest and accessible to listeners via req.headers.

Motivation:

The previous test coverage for retry header propagation relied on a mock (FakeApp). By moving this verification into the existing integration tests we get stronger confidence that headers flow end-to-end through the actual framework pipeline.

Testing

Continuous integration test should be sufficient

Category

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@codecov

codecovBot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.30%. Comparing base (c0dd462) to head (838bbae).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@ Coverage Diff @@## main #1499 +/- ##
==========================================
- Coverage 91.34% 91.30% -0.05% 
==========================================
Files 228 228 Lines 7271 7271 ==========================================
- Hits 6642 6639 -3 - Misses 629 632 +3 

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

@zimegzimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@WilliamBergamin Test praies! LGTM! 🧪 ✨

@hello-ashleyintechhello-ashleyintech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀 2 the moon

@WilliamBergamin
WilliamBergamin merged commit b0eda44 into mainMay 14, 2026
16 checks passed
@WilliamBergamin
WilliamBergamin deleted the imporve-unit-testing-around-socket-mode-headers branch May 14, 2026 16:40
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@WilliamBergamin@hello-ashleyintech@zimeg