feat: Implementação dos testes unitarios e de CI & CD - #10
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Esta PR adiciona testes automatizados para o backend (camada de Use Case e endpoint FastAPI) e configura um workflow de CI no GitHub Actions para executar o Pytest, além de pequenos ajustes de CORS e documentação interna em .agents/.
Changes:
- Cria testes unitários para o
GetWeatherUseCasee um teste de rota paraGET /weather/{city}. - Adiciona workflow de GitHub Actions para instalar dependências e rodar
pytestno backend. - Atualiza CORS no
backend/main.pye adiciona/atualiza documentação de specs/regras em.agents/.
Reviewed changes
Copilot reviewed 7 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/tests/test_use_cases.py | Adiciona testes unitários do GetWeatherUseCase com mocks. |
| backend/tests/test_api.py | Adiciona teste de integração do endpoint usando TestClient e override de app.state.weather_service. |
| backend/tests/init.py | Inicializa o pacote de testes. |
| backend/main.py | Atualiza a lista de origins no CORS. |
| .github/workflows/backend-tests.yml | Cria job de CI para rodar Pytest no backend. |
| .agents/workflows/spec/roadmap.md | Documenta roadmap do projeto. |
| .agents/workflows/spec/features.md | Documenta funcionalidades planejadas/atuais. |
| .agents/workflows/spec/architecture.md | Ajusta spec de arquitetura (frontmatter). |
| .agents/workflows/spec.md | Adiciona frontmatter base. |
| .agents/rules/rules.md | Adiciona regras de interação/documentação interna. |
| .agents/rules/project_map.md | Adiciona mapa do projeto por camadas. |
| .agents/rules/persona.md | Define persona/estilo de mentoria. |
| .agents/rules/agent.md | Adiciona configuração base do agent (frontmatter). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from src.domain.entities import WeatherData | ||
|
|
||
| # Teste 1: Garante que o fluxo principal funciona quando os dados são válidos | ||
| def tests_get_weather_sucess(mocker): |
Comment on lines
+1
to
+4
| import pytest | ||
| from fastapi.testclient import TestClient | ||
| from main import app | ||
| from src.domain.entities import WeatherData |
| @@ -0,0 +1,38 @@ | |||
| import pytest | |||
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.