Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
# ./scripts/install.sh
# Installs all project dependencies (testing, optional, and tools)

set -e

script_dir=$(dirname $0)
cd ${script_dir}/..

pip install -U pip

pip install -U -r requirements/testing.txt \
-U -r requirements/optional.txt \
-U -r requirements/tools.txt
pip install -U -r requirements/testing.txt
pip install -U -r requirements/optional.txt
pip install -U -r requirements/tools.txt
2 changes: 0 additions & 2 deletions scripts/run_validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# all: ./scripts/run_validation.sh
# single: ./scripts/run_validation.sh tests/slack_sdk_async/web/test_web_client_coverage.py

set -e
Copy link
Member

Choose a reason for hiding this comment

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

🔭 question: Keeping this would cause this script to exit with error code to break CI I thought? Would this be related to deprecation changes otherwise?


script_dir=`dirname $0`
cd ${script_dir}/..

Expand Down
3 changes: 2 additions & 1 deletion scripts/uninstall_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ pip uninstall -y slack-sdk
PACKAGES=$(pip freeze | grep -v "^-e" | sed 's/@.*//' | sed 's/\=\=.*//')
# uninstall packages without exiting on a failure
for package in $PACKAGES; do
pip uninstall -y $package
pip uninstall -y $package &
done
wait
Copy link
Member

Choose a reason for hiding this comment

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

⏳ praise: TIL that not all must be rushed.

10 changes: 6 additions & 4 deletions tests/rtm/test_rtm_client_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
cleanup_mock_web_api_server,
)

websockets_key = web.AppKey("websockets", list) if hasattr(web, "AppKey") else "websockets"


class TestRTMClientFunctional(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -53,7 +55,7 @@ def tearDown(self):

async def mock_server(self):
app = web.Application()
app["websockets"] = []
app[websockets_key] = []
app.router.add_get("/", self.websocket_handler)
app.on_shutdown.append(self.on_shutdown)
runner = web.AppRunner(app)
Expand All @@ -65,16 +67,16 @@ async def websocket_handler(self, request):
ws = web.WebSocketResponse()
await ws.prepare(request)

request.app["websockets"].append(ws)
request.app[websockets_key].append(ws)
try:
async for msg in ws:
await ws.send_json({"type": "message", "message_sent": msg.json()})
finally:
request.app["websockets"].remove(ws)
request.app[websockets_key].remove(ws)
return ws

async def on_shutdown(self, app):
for ws in set(app["websockets"]):
for ws in set(app[websockets_key]):
await ws.close(code=WSCloseCode.GOING_AWAY, message="Server shutdown")

# -------------------------------------------
Expand Down
10 changes: 2 additions & 8 deletions tests/slack_sdk/socket_mode/mock_socket_mode_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,11 @@ def reset_server_state():
self.reset_server_state = reset_server_state

async def health(request: web.Request):
wr = web.Response()
await wr.prepare(request)
wr.set_status(200)
return wr
return web.Response(status=200)

async def disconnect(request: web.Request):
state["disconnect"] = True
wr = web.Response()
await wr.prepare(request)
wr.set_status(200)
return wr
return web.Response(status=200)

async def link(request):
connected = True
Expand Down
Loading