Repository navigation
test: add unit tests for storage providers, webhooks, MCP registry, and fix silent skips - #30
Merged
OkiriGabriel merged 1 commit intoJul 20, 2026
Conversation
- tests/test_storage.py: mock-based tests for S3Storage, GCSStorage,
and AzureBlobStorage covering put_json, get_json, list_keys, delete,
and missing-key edge cases; no real cloud credentials required
- tests/test_api.py: FastAPI TestClient tests for /health, /audit,
/webhook/github (valid sig, invalid sig, no secret), /webhook/alertmanager
(valid payload, empty alerts), /webhook/manual, and /orgs/{org_id}/docs
CRUD routes; all external services mocked
- tests/test_mcp.py: smoke tests asserting AGENT_TOOLS is non-empty and
register_agent_tools registers every tool name via mcp.add_tool
- tests/test_basic.py: replace bare except/pass with pytest.skip(),
replace assert True stubs with pytest.skip() pointing to test_mcp.py
- tests/integration/README.md: document that integration tests require
live credentials and are not run in CI
Closes open-devops-agent#16
OkiriGabriel
approved these changes
Jul 20, 2026
OkiriGabriel
left a comment
Collaborator
There was a problem hiding this comment.
Covers all acceptance criteria for #16 — storage mocks, API routes, MCP registry, test_basic fixes, and integration README. Nice work.
Collaborator
|
Thanks @Maqbool61 — this covers all the acceptance criteria for #16. Approved workflow and review; will merge once CI is green. Good work on the storage mocks and MCP registry test. |
5 tasks
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.
Problem
Test coverage was narrow — no tests existed for
s3_storage.py,gcs_storage.py,azure_storage.py,devops_mcp/registry.py, or any webhook/org-config route.docs/PLATFORM_SUPPORT.mdreferencedpytest tests/integration/ -vbuttests/integration/did not exist. Two tests usedassert Truestubs and severalexcept Exception: passblocks silently masked failures.Closes #16.
Changes
tests/test_storage.py(new)Mock-based tests for all three cloud storage providers using
sys.modulesinjection so no real credentials or cloud SDKs are needed:TestS3Storage—put_json,get_json,get_jsonmissing key (with properNoSuchKeyexception class),list_keyssorted,deleteexists/missingTestGCSStorage— same operations via mockedgoogle.cloud.storage.ClientTestAzureBlobStorage— same operations via mockedazure.storage.blob.BlobServiceClienttests/test_api.py(new)FastAPI
TestClienttests with all external services mocked (DevOpsAgent,IncidentQueue,IncidentStore,OrgDocs,EscalationService):GET /health→ 200GET /audit→ 200POST /webhook/github— validWEBHOOK_SECRETsignature → 200; invalid signature → 401; no secret configured → 200POST /webhook/alertmanager— valid payload → 200; empty alerts → 200POST /webhook/manual— with requiredtypefield → 200POST/GET/DELETE /orgs/{org_id}/docs→ 200PUT /orgs/{org_id}/config→ 200GET /orgs/{org_id}/config/status→ 200tests/test_mcp.py(new)test_agent_tools_are_defined— assertsAGENT_TOOLSis a non-empty list withnameanddescriptionon every entrytest_register_agent_tools_registers_all_tools— mocksFastMCPand assertsmcp.add_toolis called exactly once per tool inAGENT_TOOLSwith matching namestests/test_basic.py(updated)assert Trueintest_importsand two stub tests withpytest.skip()pointing to the new covering test filesexcept Exception: passblocks inTestK8sCollectorwithpytest.skip()carrying an explicit reasonexcept Exception: passin async health/audit tests withexcept ImportError: pytest.skip(...)tests/integration/README.md(new)Documents that integration tests require live credentials and a real Kubernetes cluster, and are not run in CI — satisfies the
docs/PLATFORM_SUPPORT.mdreference.Test results
The 2 skips are the intentional
pytest.skip()stubs for agent tool-call tests that require a live agent loop.