Skip to content

add real coverage for PrepareDoctorDataset, ai/etl was at 0.8% - #382

Merged
gerardrecinto merged 1 commit into
masterfrom
add-doctor-dataset-etl-tests
Sep 20, 2026
Merged

gerardrecinto merged 1 commit into
masterfrom
add-doctor-dataset-etl-tests

Conversation

@gerardrecinto

Copy link
Copy Markdown
Collaborator

Pivoted from staticcheck (SA4006/U1000 are fully exhausted across the whole codebase now) to real coverage numbers. ai/etl sat at 0.8%, and doctor.go had zero tests touching it at all despite real, meaningful parsing logic (CSV row extraction, symptom text cleanup, sequential ID generation, full agent.Config assembly).

3 tests against a real local httptest.Server, not a mock behind an interface, an actual HTTP round trip through http.Get:

  • Full happy path: parses a fixture CSV into a config, verifies the ID, embedder, policies, and both real data rows land with correct IDs/text/description, and confirms the blank-disease row is correctly skipped.
  • A 500 response still returns a valid HTTP response, so it exercises the CSV-header-read error path rather than the network-error path.
  • An unreachable address exercises the actual download-failure path.

ai/etl coverage: 0.8% -> 14.0%. Build+vet+gofmt+test clean.

zero tests touched doctor.go at all. wrote 3 against a real local
httptest server (not a mock behind an interface, an actual http
round trip): CSV parsing into a full agent.Config with correct field
values, the blank-disease-row-gets-skipped behavior, underscore-to-
space symptom cleanup, sequential ID generation across rows, a 500
response failing CSV header parsing, and an unreachable address
failing the download itself. etl package coverage 0.8% -> 14.0%.
@gerardrecinto
gerardrecinto merged commit 9984747 into master Sep 20, 2026
23 of 25 checks passed
@gerardrecinto
gerardrecinto deleted the add-doctor-dataset-etl-tests branch September 20, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant