Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Flask-Sockets with aiohttp for testing #1012

Merged

Conversation

WilliamBergamin
Copy link
Contributor

This PR bring the logic from slack-sdk #1445 to bolt python

Flask-Sockets is deprecated and it won't receive any fixes in the future, so it seems reasonable to replace it with some up-to-date library.
aiohttp has been chosen since it was already presented as an optional requirement.

Category (place an x in each of the [ ])

  • 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 (place an x in each [ ])

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.

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f150cfd) 91.76% compared to head (3a8f641) 91.76%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1012   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files         181      181           
  Lines        6312     6312           
=======================================
  Hits         5792     5792           
  Misses        520      520           

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

@@ -23,7 +23,7 @@ jobs:
run: |
pip install -U pip
pip install -r requirements.txt
pip install -r requirements/testing_without_asyncio.txt
Copy link
Member

Choose a reason for hiding this comment

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

Can you revert this change? This part intentionally does not have aiohttp to detect unexectedly having aiohttp depedency to the core part (as the following name "Run tests without aiohttp" indicate)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've reverted this change but aoihttp will be required to run pytest tests/adapter_tests/socket_mode/, we can try using another synchronous library or move the CI step Run tests for Socket Mode adapters after Run tests for HTTP Mode adapters (asyncio-based libraries) let me know what you think

Copy link
Member

@seratch seratch Jan 16, 2024

Choose a reason for hiding this comment

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

pytest tests/adapter_tests/socket_mode/

Sorry, I should have clearly mentioned this but adding aiohttp for these tests is totally fine(indeed using a sync solution is ideal though). My concern was about tests under slack_sdk etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh I see, I've update the ci tests and dependencies to make them pass, let me know if we prefer a sync approach to this?

Copy link
Member

Choose a reason for hiding this comment

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

Thank you! The only risk is that we may unintentionally add aiohttp imports to the non-asyncio Socket Mode adapters. Thus, making the changes only to the adapter tests should be safe enough. We can detect such in code reviews.

@seratch seratch added this to the 1.18.2 milestone Jan 12, 2024
@seratch seratch merged commit 4b086cf into slackapi:main Jan 17, 2024
12 checks passed
@seratch seratch modified the milestones: 1.18.2, 1.19.0 May 8, 2024
Sign up for free to 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.

2 participants