Skip to content

Commit

Permalink
GH CI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanarijit committed Dec 19, 2023
1 parent 217c960 commit d9ee5ca
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
env:
POSTGRES_DB: defaultdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
redis:
image: redis
ports:
Expand All @@ -33,7 +34,11 @@ jobs:
cache-dependency-path: "**/requirements_dev.txt"
- name: Run tests
run: |
export SETTINGS_DIR=.
pip install -r requirements_dev.txt
pip install -e .
gunicorn tests.service:__hug_wsgi__ -D
pre-commit run --all-files
nosetests -sxv tests
uvicorn fastapi_tests.service:app --port 5000 &
# pre-commit run --all-files TODO: check what's wrong in CI
pytest tests
pytest fastapi_tests
5 changes: 3 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Ready to contribute? Here's how to set up `apphelpers` for local development.

$ mkvirtualenv apphelpers
$ cd apphelpers/
$ python setup.py develop
$ pip install -e .
$ pip install -r requirements_dev.txt

4. Create a branch for local development::

Expand Down Expand Up @@ -119,7 +120,7 @@ Tips
To run a subset of tests::


$ python -m unittest tests.test_apphelpers
$ pytest ./tests/test_rest.py

Deploying
---------
Expand Down
1 change: 1 addition & 0 deletions default_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DEBUG = True
DB_NAME = "defaultdb"
DB_USER = "postgres"
DB_PASS = "postgres"

SESSIONSDB_HOST = "127.0.0.1"
SESSIONSDB_PORT = 6379
Expand Down
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ types-requests
types-pytz
types-redis
redis
loguru
12 changes: 6 additions & 6 deletions tests/test_peewee.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import settings
from peewee import TextField

from apphelpers.db.peewee import (
create_base_model,
create_pgdb_pool,
dbtransaction,
)
from apphelpers.db.peewee import create_base_model, create_pgdb_pool, dbtransaction

db = create_pgdb_pool(database=settings.DB_NAME, user=settings.DB_USER)
db = create_pgdb_pool(
database=settings.DB_NAME,
user=settings.DB_USER,
password=settings.DB_PASS,
)
BaseModel = create_base_model(db)
dbtransaction = dbtransaction(db)

Expand Down

0 comments on commit d9ee5ca

Please sign in to comment.