Skip to content

Commit

Permalink
Workflow triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
danielebriggi committed May 24, 2024
1 parent 22724e4 commit 79e2711
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ name: Test and Release

on:
push:
pull_request:
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -40,7 +39,11 @@ jobs:
SQLITE_DB: ${{ vars.SQLITE_DB }}
SQLITE_PORT: ${{ vars.SQLITE_PORT }}
run: |
pytest -v src/tests
pytest --cov -v src/tests
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ main.dSYM/
.env
*.pyc
*.pyo
.coverage

.DS_Store

Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
typing-extensions==4.1.1
pytest==7.0.1
pytest-mock==3.6.1
pytest-cov==4.0.0
coverage==6.2
python-dotenv==0.20.0
lz4==3.1.10
bump2version==1.0.1
Expand Down
6 changes: 3 additions & 3 deletions src/sqlitecloud/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ def _internal_pubsub_thread(self, connection: SQCloudConnect) -> None:
ready_to_read, _, errors = select.select(
[connection.pubsub_socket], [], []
)
# eg, no data to read
if len(ready_to_read) == 0:
continue
# eg, if the socket is closed
if len(errors) > 0:
break
# eg, no data to read
if len(ready_to_read) == 0:
continue

data = connection.pubsub_socket.recv(blen)
if not data:
Expand Down
4 changes: 2 additions & 2 deletions src/tests/integration/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def assert_callback(conn, result, data):
pubsub2 = SqliteCloudPubSub()
pubsub2.notify_channel(connection2, channel, "message-in-a-bottle")

client.disconnect(connection2)

# wait for callback to be called
flag.wait(30)

assert callback_called

client.disconnect(connection2)

def test_listen_table_for_update(self, sqlitecloud_connection):
connection, client = sqlitecloud_connection

Expand Down

0 comments on commit 79e2711

Please sign in to comment.