You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add unit tests for collectors, cloud storage, webhooks, and MCP #16
Hi @OkiriGabriel! I'd like to take this on in a single PR.
I've read through the existing tests, storage/, devops_mcp/registry.py, api/server.py, and docs/PLATFORM_SUPPORT.md and have a clear plan:
1. Storage provider tests (tests/test_storage.py)
All three storage classes import their SDKs lazily inside __init__, so they're straightforward to mock with unittest.mock.patch:
S3Storage — mock boto3.client; test put_json, get_json, list_keys, delete
GCSStorage — mock google.cloud.storage.Client; same operations
AzureBlobStorage — mock azure.storage.blob.BlobServiceClient; same operations
2. Webhook + org config API tests (tests/test_api.py)
Using FastAPI's TestClient with mocked verify_github_signature and IncidentQueue:
GET/POST/DELETE /orgs/{org}/docs and GET /orgs/{org}/config
3. MCP registry smoke test (tests/test_mcp.py)
Mock FastMCP and DevOpsAgent; assert register_all_tools registers the expected tool names from AGENT_TOOLS
4. Fix silent pass skips (tests/test_basic.py)
Replace bare except: pass in test_health_endpoint_structure, test_audit_endpoint_structure, TestK8sCollector with pytest.skip() or proper import guards
Replace assert True stubs in test_k8s_tools_dry_run and test_github_tools_mock with real mock-based assertions
5. Fix doc reference (docs/PLATFORM_SUPPORT.md)
Create tests/integration/ with a README.md explaining these are manual-only tests requiring real credentials, so the doc reference is no longer broken
Thanks @Maqbool61 assigned. Please fork the repo, branch from feat/add-mcp, and open a PR with Closes #16.
Go ahead and open a draft PR from a fork and I’ll review. I’ll assign the issue once the PR is up.
Note: tests/test_security.py already covers some webhook auth — extend rather than duplicate.
Run pytest tests/ -v before opening the PR.
Update: @Maqbool61 delivered — see PR #30 (test coverage for storage, webhooks, MCP registry, test_basic fixes, and integration README). Review approved; merging once CI passes. Thanks for the work.
Activity
Maqbool61 commentedon Jul 16, 2026
Hi @OkiriGabriel! I'd like to take this on in a single PR.
I've read through the existing tests,
storage/,devops_mcp/registry.py,api/server.py, anddocs/PLATFORM_SUPPORT.mdand have a clear plan:1. Storage provider tests (
tests/test_storage.py)All three storage classes import their SDKs lazily inside
__init__, so they're straightforward to mock withunittest.mock.patch:S3Storage— mockboto3.client; testput_json,get_json,list_keys,deleteGCSStorage— mockgoogle.cloud.storage.Client; same operationsAzureBlobStorage— mockazure.storage.blob.BlobServiceClient; same operations2. Webhook + org config API tests (
tests/test_api.py)Using FastAPI's
TestClientwith mockedverify_github_signatureandIncidentQueue:POST /webhook/github— valid signature → 200, invalid signature → 401POST /webhook/alertmanager— valid payload → 200POST /webhook/manual— triggers enqueueGET/POST/DELETE /orgs/{org}/docsandGET /orgs/{org}/config3. MCP registry smoke test (
tests/test_mcp.py)FastMCPandDevOpsAgent; assertregister_all_toolsregisters the expected tool names fromAGENT_TOOLS4. Fix silent
passskips (tests/test_basic.py)except: passintest_health_endpoint_structure,test_audit_endpoint_structure,TestK8sCollectorwithpytest.skip()or proper import guardsassert Truestubs intest_k8s_tools_dry_runandtest_github_tools_mockwith real mock-based assertions5. Fix doc reference (
docs/PLATFORM_SUPPORT.md)tests/integration/with aREADME.mdexplaining these are manual-only tests requiring real credentials, so the doc reference is no longer brokenCould you assign this to me?
OkiriGabriel commentedon Jul 16, 2026
Thanks @Maqbool61 assigned. Please fork the repo, branch from feat/add-mcp, and open a PR with Closes #16.
Go ahead and open a draft PR from a fork and I’ll review. I’ll assign the issue once the PR is up.
Note: tests/test_security.py already covers some webhook auth — extend rather than duplicate.
Run pytest tests/ -v before opening the PR.
OkiriGabriel commentedon Jul 20, 2026
Update: @Maqbool61 delivered — see PR #30 (test coverage for storage, webhooks, MCP registry, test_basic fixes, and integration README). Review approved; merging once CI passes. Thanks for the work.