Skip to content

Commit

Permalink
Folder structure added (#2)
Browse files Browse the repository at this point in the history
* Folder structure added

* settings fixed

* Docker Setup (#3)

* Docker Setup

* User model initilised with fyle_rest_auth (#4)

* User model initilised with fyle_rest_auth

* Pytest Setup and flake8 added (#5)

* Pytest Setup and flake8 added

* Workspace APIs Added (#6)

* Workspace APIs Added

* Github action added for tests

* Export Settings APIs
  • Loading branch information
ruuushhh authored Oct 31, 2023
1 parent 4789280 commit e201315
Show file tree
Hide file tree
Showing 73 changed files with 2,240 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = ./venv/*, ms_business_central_api/*, *forms.py, *apps.py,*manage.py,*__init__.py,apps/*/migrations/*.py,*asgi*,*wsgi*,*admin.py,*urls.py,*settings.py, *gunicorn*,
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setup.sh
cache.db
31 changes: 31 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[flake8]
extend-ignore =
# Comparison to true should be 'if cond is true:' or 'if cond:'
E712,
# Comparison to None should be 'cond is None:' (E711)
E711,
# Line break occurred before a binary operator (W503)
W503,
# Missing whitespace after ',', ';', or ':' (E231)
E231,
# Line too long (82 > 79 characters) (E501)
E501,
# E251 unexpected spaces around keyword / parameter equals
E251,
# E502 the backslash is redundant between brackets
E502,
# E128 continuation line under-indented for visual indent
E128,
# E125 continuation line with same indent as next logical line
E125,
# E131 continuation line unaligned for hanging indent
E131,
# E129 visually indented line with same indent as next logical line
E129,
# Multiple spaces after ',' (E241)
E241
max-line-length = 99
max-complexity = 19
ban-relative-imports = true
select = B,C,E,F,N,W,I25
exclude=*env
30 changes: 30 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Continuous Integration

on:
pull_request:
types: [assigned, opened, synchronize, reopened]

jobs:
pytest:
runs-on: ubuntu-latest
environment: CI Environment
steps:
- uses: actions/checkout@v2
- name: Bring up Services and Run Tests
run: |
docker-compose -f docker-compose-pipeline.yml build
docker-compose -f docker-compose-pipeline.yml up -d
docker-compose -f docker-compose-pipeline.yml exec -T api pytest tests/ --cov --junit-xml=test-reports/report.xml --cov-report=xml --cov-fail-under=70
echo "STATUS=$(cat pytest-coverage.txt | grep 'Required test' | awk '{ print $1 }')" >> $GITHUB_ENV
echo "FAILED=$(cat test-reports/report.xml | awk -F'=' '{print $5}' | awk -F' ' '{gsub(/"/, "", $1); print $1}')" >> $GITHUB_ENV
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
if: ${{ always() && github.ref != 'refs/heads/master' }}
with:
create-new-comment: true
junitxml-path: ./test-reports/report.xml
- name: Evaluate Coverage
if: ${{ (env.STATUS == 'FAIL') || (env.FAILED > 0) }}
run: exit 1
71 changes: 38 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
# DjangoQ debugger folder
debugger/

# Byte-compiled / optimized / DLL files
__pycache__/
cache.db-journal
*.py[cod]
*$py.class
.DS_Store/

# C extensions
*.so

# IDEs
.idea
.vscode


# Test files
test.py

# Cache
demo_cache.sqlite
__pycache__
.DS_Store

# Setup File
setup.sh
local_run.sh

# Distribution / packaging
.Python
build/
Expand All @@ -20,6 +42,7 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -49,7 +72,9 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/
test-reports/
pytest-coverage.txt
.pytest_cache/

# Translations
*.mo
Expand All @@ -72,7 +97,6 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -83,9 +107,7 @@ profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -94,30 +116,15 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
# businessCentralMath parsed files
*.businessCentral.py

# Environments
.env
Expand Down Expand Up @@ -146,15 +153,13 @@ dmypy.json
# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/
# Local server
local_run.sh

# Cython debug symbols
cython_debug/
#docker compose
docker-compose.yml

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# Cache db
cache.db
fyle_integrations_platform_connector/
fyle_accounting_mappings/
Loading

0 comments on commit e201315

Please sign in to comment.