Skip to content

Commit

Permalink
(#185) Adição de testes unitários para todas as fontes de dados e ref…
Browse files Browse the repository at this point in the history
…atoração do repositório
  • Loading branch information
Victor-oss committed Oct 30, 2023
1 parent 3bd78bd commit d844832
Show file tree
Hide file tree
Showing 279 changed files with 11,341 additions and 852 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = scripts/tests/*,scripts/epe_matriz.py,*/__init__.py,scripts/main.py,
4 changes: 2 additions & 2 deletions .github/workflows/atualiza_tabelas.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: run main.py

on:
schedule: [{cron: "0 19 * * 3"}] #agendamento
schedule: [{cron: "0 0 * * 3"}] #agendamento

jobs:
build:
Expand All @@ -20,7 +20,7 @@ jobs:
pip install bs4==0.0.1
pip install openpyxl==3.1.2
- name: execute py script # run main.py
run: python 04_PipelineTCU/main.py
run: python scripts/main.py
- name: commit files
run: |
git config --local user.email "[email protected]"
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Python Linter

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install pylint
- name: Lint flake8
run: |
flake8 scripts --ignore=E203,W291,W293 --max-line-length=240 --show-source --statistics
find . -type f -name "*.py" -exec pylint --disable=C0103,C0301,C0114,W0703,W0622,R0913,E1101,R0903,R0915,R0912,W0612,E0401 -j 0 --exit-zero {} \;
23 changes: 23 additions & 0 deletions .github/workflows/testes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: teste-unitario-automatizado

on: # Quando o usuário realizar um push, será feito os testes
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install --upgrade pip
- name: Test with pytest
run: | # Vai realizar os testes
pip install pytest
pip install pytest-cov
pytest --cov-config=.coveragerc --cov=scripts
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
env*
venv*
04_PipelineTCU/__pycache__
scripts/__pycache__
scripts/scrappers/__pycache__
scripts/handlers/__pycache__
scripts/tests/__pycache__
.coverage
.pytest_cache
Empty file added scripts/__init__.py
Empty file.
202 changes: 0 additions & 202 deletions scripts/anuarioHandler.py

This file was deleted.

87 changes: 0 additions & 87 deletions scripts/benHandler.py

This file was deleted.

Loading

0 comments on commit d844832

Please sign in to comment.