Skip to content

feat: Implementação dos testes unitarios e de CI & CD - #10

Merged
Matheus904-12 merged 1 commit into
mainfrom
feat/implementar-testes-unitarios-e-cicd
May 7, 2026
Merged

Matheus904-12 merged 1 commit into
mainfrom
feat/implementar-testes-unitarios-e-cicd

Conversation

@Matheus904-12

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 7, 2026 22:51
@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
weather-api Ready Ready Preview, Comment May 7, 2026 10:51pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 GetWeatherUseCase e um teste de rota para GET /weather/{city}.
  • Adiciona workflow de GitHub Actions para instalar dependências e rodar pytest no backend.
  • Atualiza CORS no backend/main.py e 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 thread backend/tests/test_api.py
Comment on lines +1 to +4
import pytest
from fastapi.testclient import TestClient
from main import app
from src.domain.entities import WeatherData
Comment thread backend/tests/test_api.py
@@ -0,0 +1,38 @@
import pytest
Comment thread .github/workflows/backend-tests.yml
@Matheus904-12
Matheus904-12 merged commit 9ec90dd into main May 7, 2026
6 of 8 checks passed
@Matheus904-12 Matheus904-12 linked an issue May 7, 2026 that may be closed by this pull request

This branch was successfully deployed

1 active deployment
Preview — 4dd34663 Deployed May 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implementar camada de testes unitarios

2 participants