MCP HubMCP Hub
스킬 목록으로 돌아가기

lsp-test-correlation

blackwell-systems
업데이트됨 5 days ago
53
2
53
GitHub에서 보기
테스팅testingdesign

정보

이 스킬은 수정된 소스 파일을 커버하는 특정 테스트만 식별하여 실행하며, 전체 테스트 스위트 실행을 피합니다. 편집 후 검증이나 커밋 전 점검에 이상적이며, 빠르고 표적화된 피드백을 제공합니다. agent-lsp MCP 서버가 필요하며, LSP 기능을 활용하여 소스 파일을 해당 테스트에 매핑합니다.

빠른 설치

Claude Code

추천
기본
npx skills add blackwell-systems/agent-lsp -a claude-code
플러그인 명령대체
/plugin add https://github.com/blackwell-systems/agent-lsp
Git 클론대체
git clone https://github.com/blackwell-systems/agent-lsp.git ~/.claude/skills/lsp-test-correlation

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Requires the agent-lsp MCP server.

lsp-test-correlation

Discover which tests cover a source file, then run only those tests. Faster than running the full suite when you've changed one or two files and want targeted feedback.

When to use

  • After editing a source file: "Which tests do I need to run for this change?"
  • Before committing: run only the tests that cover what you touched
  • Debugging a failure: find which test file corresponds to a broken source file
  • Code review: understand what test coverage exists for a file before merging

Use /lsp-verify instead when you want to run the full suite and check all three layers (diagnostics + build + tests). Use this skill when you want fast, scoped test execution.


Workflow

Step 1 — Find correlated test files

Call get_tests_for_file for each edited source file:

mcp__lsp__get_tests_for_file({ "file_path": "/abs/path/to/source.go" })

Returns the test files that correspond to the source file. For multiple edited files, call once per file.

If no test files are returned: the source file may have no dedicated test file, or the mapping is not resolvable (e.g. integration tests in a separate directory). See Step 2 for fallback.

Step 2 — Enumerate test functions (fallback or enrichment)

If get_tests_for_file returns test files, use find_symbol to list the test functions defined in those files:

mcp__lsp__find_symbol({ "query": "Test" })

Filter results to the correlated test files from Step 1. This gives you the specific test function names to run rather than the whole test file.

Fallback (no test files found): query find_symbol for test functions that contain the changed symbol's name:

mcp__lsp__find_symbol({ "query": "Test<ChangedFunctionName>" })

This catches cases where get_tests_for_file misses indirect coverage.

Step 3 — Report the correlation map

Before running, report what was found:

## Test correlation for <file>

Source file: internal/tools/analysis.go
Test files:
  → internal/tools/analysis_test.go
     Tests: TestHandleGetCodeActions, TestHandleGetCompletions, TestHandleGetDocumentSymbols

No correlated test files found for: internal/lsp/normalize.go
  → Fallback: TestNormalizeCompletion, TestNormalizeDocumentSymbols (from workspace symbol search)

If the user provided run=true or asks to run, proceed to Step 4. Otherwise stop here and let the user decide.

Step 4 — Run correlated tests

Run only the correlated test files or functions. Scope as tightly as possible:

Go — run specific package:

mcp__lsp__run_tests({ "workspace_dir": "<root>", "test_filter": "TestHandleGetCodeActions|TestHandleGetCompletions" })

If run_tests does not support test_filter, pass the package path instead of the workspace root to narrow scope. The test output will be smaller and faster than running ./....

Output handling: If test output is large, do not read it in full. Search for failures:

grep -E "^(FAIL|--- FAIL)" <output_file>

Step 5 — Report results

## Test Results

Ran 3 tests in internal/tools/analysis_test.go

PASSED (2):
  TestHandleGetCodeActions
  TestHandleGetCompletions

FAILED (1):
  TestHandleGetDocumentSymbols — expected 3 symbols, got 2 (analysis_test.go:87)

Recommendation: Fix TestHandleGetDocumentSymbols before committing.

Multi-file workflow

For changes spanning multiple source files:

  1. Call get_tests_for_file for each changed file in parallel.
  2. Deduplicate the resulting test files (the same test file may cover multiple source files).
  3. Report the full correlation map before running.
  4. Run the deduplicated test set once.
## Test correlation for 3 changed files

internal/tools/analysis.go      → internal/tools/analysis_test.go
internal/lsp/client.go          → internal/lsp/client_test.go, internal/lsp/client_completion_test.go
internal/resources/resources.go → (no dedicated test file)

Deduplicated test files to run: 3

Decision guide

SituationAction
get_tests_for_file returns test filesUse those; enumerate functions via find_symbol
No test files returnedFallback to find_symbol with changed symbol names
Test files found but no matching test functionsReport gap — this source file may lack unit test coverage
More than 10 test files returnedDon't run all; use /lsp-verify for full suite instead
Test failsRun /lsp-verify for full diagnostic picture

Example

# "I edited internal/tools/symbol_source.go — which tests should I run?"

get_tests_for_file(file_path="/repo/internal/tools/symbol_source.go")
  → internal/tools/symbol_source_test.go

find_symbol(query="TestGetSymbolSource")
  → TestGetSymbolSource_ContainsPosition (line 12)
  → TestGetSymbolSource_FindInnermost (line 34)
  → TestGetSymbolSource_PositionPattern (line 67)

# Report correlation, then run:
run_tests(workspace_dir="/repo", test_filter="TestGetSymbolSource")
  → 3 passed in 0.4s

GitHub 저장소

blackwell-systems/agent-lsp
경로: skills/lsp-test-correlation
0
agentskillsai-agentsai-toolingclaudeclaude-codecode-intelligence

연관 스킬

evaluating-llms-harness

테스팅

이 Claude Skill은 MMLU, GSM8K를 포함한 60개 이상의 표준화된 학술 과제에서 LLM 성능을 벤치마크하기 위해 lm-evaluation-harness를 실행합니다. 개발자들이 모델 품질을 비교하고, 학습 진행 상황을 추적하거나 학술 결과를 보고할 수 있도록 설계되었습니다. 이 도구는 HuggingFace와 vLLM 모델을 포함한 다양한 백엔드를 지원합니다.

스킬 보기

cloudflare-cron-triggers

테스팅

이 스킬은 cron 표현식을 사용하여 Worker를 스케줄링하기 위한 Cloudflare Cron Triggers 구현에 관한 포괄적인 지식을 제공합니다. 주기적 작업, 유지보수 작업, 자동화된 워크플로우 설정 방법을 다루며, 잘못된 cron 표현식이나 시간대 문제 같은 일반적인 이슈들을 해결하는 방법을 포함합니다. 개발자들은 이를 통해 스케줄된 핸들러 구성, cron 트리거 테스트, Workflows 및 Green Compute와의 연동 작업을 수행할 수 있습니다.

스킬 보기

webapp-testing

테스팅

이 Claude Skill은 Python 스크립트를 통해 로컬 웹 애플리케이션을 테스트하기 위한 Playwright 기반 툴킷을 제공합니다. 프론트엔드 검증, UI 디버깅, 스크린샷 캡처, 로그 확인 기능을 지원하며 서버 라이프사이클을 관리합니다. 브라우저 자동화 작업에 사용하되 컨텍스트 오염을 방지하기 위해 소스 코드를 읽지 않고 스크립트를 직접 실행하세요.

스킬 보기

finishing-a-development-branch

테스팅

이 스킬은 테스트 통과를 확인한 후 체계적인 통합 옵션을 제시하여 개발자가 완성된 작업을 마무리하도록 돕습니다. 구현이 완료된 후 머지, PR 생성, 브랜치 정리와 같은 워크플로우를 안내합니다. 코드가 준비되고 테스트가 완료되었을 때 개발 프로세스를 체계적으로 마무리하기 위해 사용하세요.

스킬 보기