tests: rename internal/livedns to livednstest and deny it outside tests #165

Open
clawbot wants to merge 1 commits from issue-164-livednstest into next
Collaborator

Implements #164.

The live-DNS retry and concurrency limit that tests share was in internal/livedns, which only tests import, but nothing stopped program code from importing it and compiling it into the binary. The package is now internal/livednstest, and its import path is added to the test-support deny list in .golangci.yml, with a desc worded like the net/http/httptest entry's. Importing it from program code now makes make lint report a depguard finding under that rule. Every import and mention is updated: README Architecture, TESTING.md, code comments, TODO.md.

Things the diff does not show:

  • Nothing else in .golangci.yml changes. The deny list is the one part the file's own comment and sneak/prompts#60 let a repository extend.
  • The package's own files are exempt from the rule because their directory name now ends in test; test files everywhere are exempt as before.
  • internal/resolver/livedns_test.go and livedns_harness_test.go keep their names: they are files of the resolver's tests, not the renamed package.

Disclosures:

  • Judgement call: the older TODO.md entry for #159 now names the new path, since the definition of done asks for every mention in TODO.md to be updated.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/dnswatcher/issues/164. The live-DNS retry and concurrency limit that tests share was in `internal/livedns`, which only tests import, but nothing stopped program code from importing it and compiling it into the binary. The package is now `internal/livednstest`, and its import path is added to the `test-support` `deny` list in `.golangci.yml`, with a `desc` worded like the `net/http/httptest` entry's. Importing it from program code now makes `make lint` report a `depguard` finding under that rule. Every import and mention is updated: README Architecture, `TESTING.md`, code comments, `TODO.md`. Things the diff does not show: - Nothing else in `.golangci.yml` changes. The `deny` list is the one part the file's own comment and https://git.eeqj.de/sneak/prompts/issues/60 let a repository extend. - The package's own files are exempt from the rule because their directory name now ends in `test`; test files everywhere are exempt as before. - `internal/resolver/livedns_test.go` and `livedns_harness_test.go` keep their names: they are files of the resolver's tests, not the renamed package. Disclosures: - Judgement call: the older `TODO.md` entry for https://git.eeqj.de/sneak/dnswatcher/issues/159 now names the new path, since the definition of done asks for every mention in `TODO.md` to be updated. Model: opus-5-5
clawbot added the needs-review label 2026-09-29 10:47:13 +02:00
clawbot self-assigned this 2026-09-29 10:47:13 +02:00
Author
Collaborator
  • .golangci.yml, the new deny entry: its desc, "Live-DNS test support belongs in test files only.", is not true of the tree. The package itself is internal/livednstest/livednstest.go, which is not a test file. The test-support rule, and the comment above it, also allow non-test files in any package whose directory name ends in test. So anyone who hits the error is told a rule that does not match what is enforced. Acceptable: a one-line desc that matches the rule, worded like the existing net/http/httptest entry, e.g. "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary." The commit body has the same gap: "make lint fails when a file that is not a test imports it" should say program code, as TODO.md does.

Model: opus-5-5

- `.golangci.yml`, the new `deny` entry: its `desc`, "Live-DNS test support belongs in test files only.", is not true of the tree. The package itself is `internal/livednstest/livednstest.go`, which is not a test file. The `test-support` rule, and the comment above it, also allow non-test files in any package whose directory name ends in `test`. So anyone who hits the error is told a rule that does not match what is enforced. Acceptable: a one-line `desc` that matches the rule, worded like the existing `net/http/httptest` entry, e.g. "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary." The commit body has the same gap: "make lint fails when a file that is not a test imports it" should say program code, as `TODO.md` does. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-09-29 11:08:00 +02:00
clawbot added 1 commit 2026-09-29 12:45:11 +02:00
The live-DNS retry and concurrency limit is only for tests, but nothing
stopped program code from importing it and compiling it into the
binary. Its directory name now ends in test, and its import path is on
the test-support deny list in .golangci.yml, so make lint fails when
program code imports it. Every import and mention is updated to the new
name.

Model: opus-5-5
clawbot force-pushed issue-164-livednstest from 18eba18759 to a75d4d51fd 2026-09-29 12:45:11 +02:00 Compare
Author
Collaborator
  • .golangci.yml: the livednstest desc now reads "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary."
  • Commit body and PR body now say make lint fails when program code imports it; TODO.md already did.

Model: opus-5-5

- `.golangci.yml`: the `livednstest` `desc` now reads "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary." - Commit body and PR body now say `make lint` fails when program code imports it; `TODO.md` already did. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-09-29 12:45:25 +02:00
Author
Collaborator

Review passed on a75d4d5.

Model: opus-5-5

Review passed on a75d4d5. Model: opus-5-5
All checks were successful
check / check (push) Successful in 1m38s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-164-livednstest:issue-164-livednstest
git checkout issue-164-livednstest
Sign in to join this conversation.