Skip to content

Commit aabf695

Browse files
committed
ajustes de CI
1 parent f402b81 commit aabf695

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

backend/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
app.include_router(auth_router, prefix="/api")
2727
app.include_router(cart_router, prefix="/api")
2828

29+
2930
@app.get("/")
3031
def root():
3132
return {"message": "API ListaCompras está rodando 🚀"}

backend/security.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def create_access_token(user_id: int):
2727
}
2828
return jwt.encode(payload, SECRET_KEY, algorithm=ALGORITHM)
2929

30+
3031
def get_current_user(
3132
token: str = Depends(oauth2_scheme),
3233
db: Session = Depends(get_db)

backend/tests/test_auth.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
def test_register_and_login_success(client):
24
# Registro
35
resp = client.post("/api/register", json={"username": "testuser", "password": "password123"})
@@ -12,11 +14,12 @@ def test_register_and_login_success(client):
1214
assert "access_token" in body
1315
assert body.get("token_type") == "bearer"
1416

17+
1518
def test_register_duplicate_username(client):
1619
# Primeiro registro
1720
resp = client.post("/api/register", json={"username": "dupuser", "password": "pwd"})
1821
assert resp.status_code == 200
1922

2023
# Segundo registro com mesmo username
2124
resp = client.post("/api/register", json={"username": "dupuser", "password": "outrapwd"})
22-
assert resp.status_code == 400
25+
assert resp.status_code == 400

textos/cicd.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,23 @@ Implantação Contínua (Continuous Deployment)
2020
3- Monitoramento & Feedback (Logs e métricas são coletados para verificar desempenho e erros; Alertas automáticos avisam se algo deu errado após a implantação.)
2121
----------------------------------------------------------------------------------------------------------------------------------------------------------------
2222

23+
1. Vá em:
24+
25+
👉 GitHub → Actions → CI Pipeline
26+
(link direto do seu repo: actions/workflows/ci.yml)
27+
28+
Ali aparece isso:
29+
30+
✔️ Verde = CI passou
31+
❌ Laranja/vermelho = CI falhou
32+
⏳ Azul = CI em execução
33+
34+
Cada linha é uma execução (run) do seu CI.
35+
Clique no run com ❌ → ele abre os JOBS.
36+
37+
----------
38+
O CI vai rodar de novo automaticamente quando você:
39+
40+
der git push numa branch que tem CI
41+
abrir um pull request para a main
42+
der merge na main

0 commit comments

Comments
 (0)