diff --git a/src/agentready/assessors/testing.py b/src/agentready/assessors/testing.py index ef8c55f4..84d94c4a 100644 --- a/src/agentready/assessors/testing.py +++ b/src/agentready/assessors/testing.py @@ -564,12 +564,17 @@ def _assess_go_coverage(self, repository: Repository) -> Finding: text_sources = self._read_go_build_files(repository) - has_test_cmd = bool(re.search(r"(?:\bgo|\$\(GO\))\s+test\b", text_sources)) + has_test_cmd = bool( + re.search( + r"(?:\bgo|\$\(GO\))\s+test\b|\bmake\s+test\b|\bginkgo\b", + text_sources, + ) + ) if has_test_cmd: score += 20.0 evidence.append("Go test command found in project files") else: - evidence.append("No 'go test' command found in Makefile/CI/README") + evidence.append("No test command found in Makefile/CI/README/AGENTS.md") has_coverage = bool( re.search(r"(? str: repository.path / "Makefile", repository.path / "Taskfile.yml", repository.path / "README.md", + repository.path / "AGENTS.md", + repository.path / "CLAUDE.md", ] # Include module-local build files (Go monorepos) diff --git a/tests/unit/test_assessors_go.py b/tests/unit/test_assessors_go.py index dc4f8285..1f66437b 100644 --- a/tests/unit/test_assessors_go.py +++ b/tests/unit/test_assessors_go.py @@ -145,6 +145,29 @@ def test_go_remediation_on_fail(self, tmp_path): assert finding.remediation is not None assert any("go test" in cmd for cmd in finding.remediation.commands) + def test_go_test_command_in_agents_md(self, tmp_path): + """Go test command documented in AGENTS.md is detected (#470).""" + repo = _make_go_repo(tmp_path) + + test_file = tmp_path / "main_test.go" + test_file.write_text('package main\nimport "testing"\n') + _git_add(tmp_path, test_file) + + agents_md = tmp_path / "AGENTS.md" + agents_md.write_text( + "## Quick Commands\n\n" + "| Action | Command |\n" + "|--------|----------|\n" + "| Run tests | `make test` (runs fmt and vet first) |\n" + "| Lint | `make lint` |\n" + ) + + assessor = TestExecutionAssessor() + finding = assessor.assess(repo) + + assert any("test command found" in e.lower() for e in finding.evidence) + assert finding.score >= 60.0 + # ============================================================================= # TypeAnnotationsAssessor — Go support