Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#181 Testes de Qualidade #190

Merged
merged 23 commits into from
May 6, 2021
Merged

Conversation

thiagohdaqw
Copy link
Collaborator

@thiagohdaqw thiagohdaqw commented May 3, 2021

Descrição

Trabalhando na adição dos testes de qualidade de software e organizando o projeto

Resolve (Issues)

#181

Como esta sendo testado

Sendo testado nesse pull request com os comentarios do codeclimate e com github actions

Tarefas gerais realizadas

  • Mudar de CoverAlls para Codecov
  • Adicionar CodeClimate
  • Refatorar problemas apontados pelos testes
  • Lint do python

@thiagohdaqw thiagohdaqw self-assigned this May 3, 2021
@thiagohdaqw thiagohdaqw changed the title [WIPX] #181 Testes de Qualidade [WIP] #181 Testes de Qualidade May 3, 2021
@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch from d458967 to fbd6a03 Compare May 3, 2021 21:17
@thiagohdaqw
Copy link
Collaborator Author

thiagohdaqw commented May 3, 2021

Como rodar os testes

Esse método se mostrou mais eficiente do que usando tox, porque o tox criava um outro ambiente e tinha q esperar ele instalar as dependências, e rodar os testes pelo docker é muito mais rápido porque a imagem está já criada.

Pre- requisitos

docker com o build atualizado docker-compose build
ou pipenv com dependencias de dev atualizados pipenv install -d

Uma vez que o projeto esteja rodando no docker, execute o seguinte comando:
docker exec anunbis_backend bash "./tests.sh"

ou pelo pipenv shell:
bash ./tests.sh
ou ./tests.sh

ou
pipenv run bash tests.sh - linux
pipenv run tests.sh - windows terminal

@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch from c46f91c to b412896 Compare May 3, 2021 21:54
@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch from b412896 to a068444 Compare May 3, 2021 22:00
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@e3e68d8). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #190   +/-   ##
==========================================
  Coverage           ?   99.56%           
==========================================
  Files              ?       36           
  Lines              ?      693           
  Branches           ?        0           
==========================================
  Hits               ?      690           
  Misses             ?        3           
  Partials           ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3e68d8...cba7bb0. Read the comment docs.

@thiagohdaqw
Copy link
Collaborator Author

Houve a necessidade de trocar do CoverAlls para o Codecov porque o bot do coveralls nao comentava nos nossos PR

@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch 3 times, most recently from 8a24f64 to 38e11b1 Compare May 3, 2021 23:58
@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch from 38e11b1 to 8abed21 Compare May 4, 2021 00:00
@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch from 3cb6938 to e8dc04e Compare May 4, 2021 03:29
app/controller/post_resources.py Show resolved Hide resolved
app/controller/post_resources.py Show resolved Hide resolved
app/controller/student_resources.py Show resolved Hide resolved
app/model/report.py Show resolved Hide resolved
app/model/report.py Show resolved Hide resolved
@thiagohdaqw thiagohdaqw force-pushed the feature/#181-Testes_Qualidade_Codigo branch from b50a75b to d83a701 Compare May 4, 2021 16:41
app/services/student_services.py Show resolved Hide resolved
app/services/post_services.py Show resolved Hide resolved
app/services/student_services.py Show resolved Hide resolved
app/services/post_services.py Show resolved Hide resolved
app/services/student_services.py Show resolved Hide resolved
@fga-eps-mds fga-eps-mds deleted a comment from codeclimate bot May 4, 2021
@thiagohdaqw thiagohdaqw changed the title [WIP] #181 Testes de Qualidade #181 Testes de Qualidade May 4, 2021
@thiagohdaqw
Copy link
Collaborator Author

thiagohdaqw commented May 4, 2021

Desativei os comentarios do CodeClimate porque estava poluindo demais, mas ele vai ficar como required nos checks.
Por exemplo:

image
)

Não tem ainda nesse porq eu criei o PR antes de ativar o recurso

@thiagohdaqw thiagohdaqw removed the WIP label May 5, 2021
@thiagohdaqw
Copy link
Collaborator Author

thiagohdaqw commented May 6, 2021

Recomendo criar um hook para rodar esses comandos antes dos commits com o git hooks
.git/hooks/pre-commit

image

@RcleydsonR RcleydsonR self-requested a review May 6, 2021 01:34
@thiagohdaqw
Copy link
Collaborator Author

Se forem testar os testes no docker, nao esqueçam de antes dar o build no container

@thiagohdaqw
Copy link
Collaborator Author

Como rodar o lint

no diretorio raiz, execute: bash lint.sh
ou bash ./lint.sh
ou ./lint.sh

Copy link
Collaborator

@victorhugo21 victorhugo21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testei aqui e todos comandos estão funcionando perfeitamente. Boa Thiago!

Copy link
Collaborator

@oEduardoAfonso oEduardoAfonso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tudo testando aqui e rodando tranquilo! 👍

@thiagohdaqw thiagohdaqw merged commit 3d1d3eb into develop May 6, 2021
@thiagohdaqw thiagohdaqw deleted the feature/#181-Testes_Qualidade_Codigo branch May 6, 2021 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants