feat: 31 new tests, metrics LLM counters, Dockerfile caching, Makefile targets, compose limits, code fixes

This commit is contained in:
Marker689
2026-05-11 23:08:09 +03:00
parent 20bf7e6745
commit 18efcf482e
26 changed files with 840 additions and 12 deletions

View File

@@ -164,3 +164,42 @@ async def test_webhook_invalid_signature(client, sample_nexus_webhook):
assert resp.status_code == 403
guarddog_nexus.config.config.webhook_secret = ""
# --- Unknown ecosystem rejection ---
@pytest.mark.asyncio
async def test_webhook_rejects_unknown_ecosystem_asset(client):
resp = await client.post(
"/webhooks/nexus",
json={
"action": "UPDATED",
"repositoryName": "test-repo",
"asset": {
"format": "maven",
"name": "/packages/test/1.0/test-1.0.tar.gz",
"downloadUrl": "http://nexus:8081/repo/test/1.0/test-1.0.tar.gz",
},
},
)
assert resp.status_code == 200
data = resp.json()
assert data["status"] == "ignored"
assert data["reason"] == "unknown_ecosystem"
@pytest.mark.asyncio
async def test_webhook_rejects_unknown_ecosystem_component(client):
resp = await client.post(
"/webhooks/nexus",
json={
"action": "UPDATED",
"repositoryName": "test-repo",
"component": {"format": "maven", "name": "test", "version": "1.0"},
},
)
assert resp.status_code == 200
data = resp.json()
assert data["status"] == "ignored"
assert data["reason"] == "unknown_ecosystem"