• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pycasbin / postgresql-watcher / 9952714706
78%

Build:
DEFAULT BRANCH: master
Ran 16 Jul 2024 07:39AM UTC
Jobs 1
Files 4
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Jul 2024 07:38AM UTC coverage: 78.017% (+3.5%) from 74.528%
9952714706

push

github

web-flow
fix: fixed `should_reload` behaviour, close PostgreSQL connections, block until `PostgresqlWatcher` is ready, refactorings (#29)

* chore: updated dev requirements

* chore: format code with black

* chore: updated .gitignore

* fix: type hint, multiprocessing.Pipe is a Callable and not a type

* fix: make Watcher.should_reload return value consistent

* fix: Handle Connection and Process objects consistenly and close them before creating new ones

* feat: Customize the postgres channel name

* chore: Some code reorg
       - Make PostgresqlWatcher.create_subscription_process a private method
       - Rename casbin_subscription to _casbin_channel_subscription

* docs: added doc string for PostgresqlWatcher.update

* refactor: PostgresqlWatcher.set_update_callback

* refactor!: Rename 'start_process' flag to 'start_listening'

* docs: Added doc string to PostgresqlWatcher.__init__

* fix: Added proper destructor for PostgresqlWatcher

* chore: fix type hints and proper handling of the channel_name argument and its default value

* test: fix tests

      decrease select timeout to one second in child Process
      remove infinite timout in PostgresqlWatcher.should_reload
      create a new watcher instance for every test case

* feat: Setup logging module for unit tests

* fix: typo

* feat: channel subscription with proper resource cleanup

      Moved channel subscription function to separate file and added context
      manager for the connection, that handles SIGINT, SIGTERM for proper resource
      cleanup

* chore: removed unnecessary tests

* feat: Wait for Process to be ready to receive messages from PostgreSQL

* test: multiple instances of the watcher

* test: make sure every test case uses its own channel

* test: no update

* refactor: moved code into with block

* feat: automaticall call the update handler if it is provided

* refactor: sorted imports

* docs: updated README

* refactor: improved readibility

* refactor: resolve a potentia... (continued)

145 of 191 new or added lines in 4 files covered. (75.92%)

1 existing line in 1 file now uncovered.

181 of 232 relevant lines covered (78.02%)

0.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
95.51
6.32% tests/test_postgresql_watcher.py
7
88.51
22.33% postgresql_watcher/watcher.py
37
32.73
postgresql_watcher/casbin_channel_subscription.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
88.51
22.33% postgresql_watcher/watcher.py
Jobs
ID Job ID Ran Files Coverage
1 9952714706.1 16 Jul 2024 07:39AM UTC 4
78.02
GitHub Action Run
Source Files on build 9952714706
  • Tree
  • List 4
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8382db4d on github
  • Prev Build on master (#9770717470)
  • Next Build on master (#9960039308)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc