Test Gap Analysis
Test suite snapshot: 1,101 unit tests, 78 integration tests (tests/compiler_tests.rs), 3 init tests, 8 MCP HTTP tests β 1,191 total. All pass. β
Previous issue #376 is still open (3 gaps: generate_lean_prompt, init_logging, upload-workitem-attachment in tools list). The gaps below are new and not covered by #376 β introduced by the upload-build-artifact tool additions and execute refactor (#388).
Priority Gaps
| Module |
Function/Path |
Why It Matters |
Suggested Test |
tests/mcp_http_tests.rs |
test_mcp_initialize_and_tools_list β upload-build-artifact not asserted |
New tool registered in src/mcp.rs at line 993 but the tools-list test still only checks 5 of ~20 tools. A broken MCP registration would go completely undetected. |
Add assert!(body.contains("upload-build-artifact"), ...) |
src/execute.rs |
No test_execute_malformed_upload_workitem_attachment_* |
Every other multi-step tool (update-wiki-page, comment-on-work-item, create-wiki-page) has at least one test_execute_malformed_* and test_execute_*_missing_context test exercising the dispatch path. upload-workitem-attachment has zero execute-level tests β the macro dispatch arm at line 315 is untested. |
Mirror test_execute_malformed_comment_on_work_item_returns_err for this tool |
src/execute.rs |
No test_execute_malformed_upload_build_artifact_* |
Same gap as above for the newer upload-build-artifact tool (dispatch arm at line 348). All 23 existing tests for this tool live inside upload_build_artifact.rs and never invoke execute_safe_output. |
Mirror test_execute_malformed_update_wiki_page_returns_err for this tool |
Suggested Test Cases
1. MCP tools list β assert upload-build-artifact is registered
// In tests/mcp_http_tests.rs, add to test_mcp_initialize_and_tools_list:
assert!(
body.contains("upload-build-artifact"),
"Should list upload-build-artifact tool, body: {body}"
);
// While here, also add the upload-workitem-attachment assert from #376:
assert!(
body.contains("upload-workitem-attachment"),
"Should list upload-workitem-attachment tool (renamed from upload-attachment in #372), body: {body}"
);
2. Execute dispatch β malformed JSON for upload-workitem-attachment
#[tokio::test]
async fn test_execute_malformed_upload_workitem_attachment_returns_err() {
let dir = tempfile::tempdir().unwrap();
let path = dir.path().join("out.ndjson");
let line = r#"{"tool":"upload-workitem-attachment","params":{"not_valid":true}}"#;
std::fs::write(&path, line).unwrap();
let result = execute_safe_outputs(
dir.path(),
&path,
&ExecutionContext::default(),
false,
)
.await;
assert!(result.is_err() || result.unwrap().iter().any(|r| r.is_err()));
}
3. Execute dispatch β missing context for upload-build-artifact
#[tokio::test]
async fn test_execute_upload_build_artifact_missing_context() {
let dir = tempfile::tempdir().unwrap();
let staged = dir.path().join("staged_file.txt");
std::fs::write(&staged, b"hello").unwrap();
let path = dir.path().join("out.ndjson");
let line = serde_json::json!({
"tool": "upload-build-artifact",
"params": {
"artifact_name": "my-artifact",
"file_path": "staged_file.txt",
"staged_file": "staged_file.txt",
"sha256": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
}
})
.to_string();
std::fs::write(&path, line).unwrap();
// No ADO context β should fail gracefully (not panic)
let result = execute_safe_output(
"upload-build-artifact",
&serde_json::json!({"artifact_name": "x", "file_path": "f", "staged_file": "staged_file.txt", "sha256": "abc"}),
&ExecutionContext::default(),
dir.path(),
false,
)
.await;
assert!(result.is_err(), "Should fail without ADO context");
}
Coverage Summary
| Module |
Public Fns |
Tests |
Coverage Estimate |
tests/mcp_http_tests.rs |
test_mcp_initialize_and_tools_list |
asserts 5/~20 registered tools |
Two new tools unasserted |
src/execute.rs β upload dispatch arms |
2 dispatch arms (lines 315, 348) |
0 execute-level tests |
0% for these arms |
This issue was created by the automated test gap finder. Previous run: 2026-05-01 (#376, still open). Modules audited this cycle: all. Total tests found: 1,191 (up from 1,049 at #376 creation).
Generated by Test Gap Finder Β· β 971.4K Β· β·
Test Gap Analysis
Test suite snapshot: 1,101 unit tests, 78 integration tests (
tests/compiler_tests.rs), 3 init tests, 8 MCP HTTP tests β 1,191 total. All pass. βPrevious issue #376 is still open (3 gaps:
generate_lean_prompt,init_logging,upload-workitem-attachmentin tools list). The gaps below are new and not covered by #376 β introduced by theupload-build-artifacttool additions and execute refactor (#388).Priority Gaps
tests/mcp_http_tests.rstest_mcp_initialize_and_tools_listβupload-build-artifactnot assertedsrc/mcp.rsat line 993 but the tools-list test still only checks 5 of ~20 tools. A broken MCP registration would go completely undetected.assert!(body.contains("upload-build-artifact"), ...)src/execute.rstest_execute_malformed_upload_workitem_attachment_*update-wiki-page,comment-on-work-item,create-wiki-page) has at least onetest_execute_malformed_*andtest_execute_*_missing_contexttest exercising the dispatch path.upload-workitem-attachmenthas zero execute-level tests β the macro dispatch arm at line 315 is untested.test_execute_malformed_comment_on_work_item_returns_errfor this toolsrc/execute.rstest_execute_malformed_upload_build_artifact_*upload-build-artifacttool (dispatch arm at line 348). All 23 existing tests for this tool live insideupload_build_artifact.rsand never invokeexecute_safe_output.test_execute_malformed_update_wiki_page_returns_errfor this toolSuggested Test Cases
1. MCP tools list β assert
upload-build-artifactis registered2. Execute dispatch β malformed JSON for
upload-workitem-attachment3. Execute dispatch β missing context for
upload-build-artifactCoverage Summary
tests/mcp_http_tests.rstest_mcp_initialize_and_tools_listsrc/execute.rsβ upload dispatch armsThis issue was created by the automated test gap finder. Previous run: 2026-05-01 (#376, still open). Modules audited this cycle: all. Total tests found: 1,191 (up from 1,049 at #376 creation).