Skip to content

feat: ens-test-kit initial#2028

Open
sevenzing wants to merge 1 commit intoll/ensnode-testsfrom
ll/ens-test-kit
Open

feat: ens-test-kit initial#2028
sevenzing wants to merge 1 commit intoll/ensnode-testsfrom
ll/ens-test-kit

Conversation

@sevenzing
Copy link
Copy Markdown
Member

@sevenzing sevenzing commented Apr 30, 2026

Summary

Introduce my idea of ens-test-kit.

One might find it easier to review full file like that:
https://github.com/namehash/ensnode/blob/ll/ens-test-kit/.memory-bank/tasks/0006-ens-test-kit/IDEA.md


Why

  • Why this change exists. Link to related GitHub issues where relevant.

Testing

  • How this was tested.
  • If you didn't test it, say why.

Notes for Reviewer (Optional)

  • Anything non-obvious or worth a heads-up.

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

@sevenzing sevenzing requested a review from a team as a code owner April 30, 2026 14:29
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Apr 30, 2026 2:29pm
ensnode.io Ready Ready Preview, Comment Apr 30, 2026 2:29pm
ensrainbow.io Ready Ready Preview, Comment Apr 30, 2026 2:29pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 30, 2026

⚠️ No Changeset found

Latest commit: cbf0c0b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR


## Status

Proposal for review. Authored after iterative design conversation. Once approved, see [IMPL.md](./IMPL.md) for the PR-by-PR rollout.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is WIP, just want to share my vision first

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a7f97826-e825-409d-bd6e-4849f5929654

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ll/ens-test-kit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR adds a design proposal (IDEA.md) for a new @ensnode/ens-test-kit package — a declarative, transport-agnostic ENS testing framework that separates fixture seeding, typed test cases, and per-transport adapters. No code is changed; this is a pure idea document for review before implementation.

  • P1 – Vitest coupling in "just data" test cases: expected: expect.arrayContaining(...) embeds a live Vitest matcher inside TestCase, breaking the stated design goal of framework-agnostic data and causing failures if cases are consumed outside a Vitest context (e.g. the seed CLI).
  • P2 – Silent fixture dedup: dedupeFixtures by id can silently drop a variant fixture, making one test case run against unexpected on-chain state without any error.

Confidence Score: 4/5

Safe to discuss/merge as a design doc, but the Vitest-coupling P1 should be addressed before implementation begins.

Only one file changed (a documentation/proposal), so there is no runtime risk from merging. The P1 finding is a design flaw in the proposal itself that needs to be corrected before the described code is written; if unaddressed, it would cause real bugs in the implementation.

.memory-bank/tasks/0006-ens-test-kit/IDEA.md — see Vitest coupling issue at line 240 and dedup behaviour at line 291.

Important Files Changed

Filename Overview
.memory-bank/tasks/0006-ens-test-kit/IDEA.md New design-proposal document for the ens-test-kit package; contains a Vitest coupling issue in TestCase data and a silent fixture-dedup risk that should be resolved before implementation begins.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    TK["@ensnode/ens-test-kit"]
    TK --> Cases["cases/\n(TestCase<Api>[])"]
    TK --> Seeder["seeder/\n(seedFixtures)"]
    TK --> Interfaces["interfaces/\n(ResolutionsApi, DomainsApi, ...)"]
    TK --> Vitest["vitest/\n(runSuite)"]
    TK --> CLI["bin/ens-test-kit seed"]

    Seeder --> Fixtures["fixtures/\n(text-record, registration, ...)"]
    Seeder --> Docker["devnet/Dockerfile\n(seeds on startup)"]

    ITE["@ensnode/integration-test-env"]
    ITE --> Adapters["adapters/\n(rest-adapter, omnigraph-adapter)"]
    ITE --> Tests["tests/\n(runSuite calls)"]

    TK --> ITE
    Interfaces --> Adapters
    Cases --> Tests
    Vitest --> Tests
Loading

Reviews (1): Last reviewed commit: "commit idea file" | Re-trigger Greptile

const account = await api.getAccount(OWNER_ADDRESS);
return account?.domains.map((d) => d.name);
},
expected: expect.arrayContaining(["test.eth"]),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Vitest expect matcher embedded in "just data" test case

expected: expect.arrayContaining(["test.eth"]) embeds a live Vitest expect matcher inside the TestCase struct, which is described elsewhere as "just data." This contradicts the design goal: expect is only available at test runtime (inside a describe/it block), so any code that constructs or imports ownershipCases outside a Vitest context — for example the seed CLI, a documentation generator, or a future JSON exporter — will throw at module load time.

The expected: unknown type on TestCase permits this silently today but runSuite will need to distinguish plain values from matchers anyway. Consider using a discriminated union (e.g. { kind: "arrayContaining"; values: string[] }) or a narrow Matcher wrapper that runSuite maps to Vitest matchers internally. This keeps case data serialisable and framework-agnostic while still supporting asymmetric matching.

Comment thread .memory-bank/tasks/0006-ens-test-kit/IDEA.md
Comment on lines +291 to +299
import { applyTextRecord } from "./fixtures/text-record";
import { applyPrimaryName } from "./fixtures/primary-name";
// ...

const HANDLERS = {
"text-record": applyTextRecord,
"primary-name": applyPrimaryName,
"multicoin-address": applyMulticoinAddress,
"contenthash": applyContenthash,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Deduplication by id could silently discard fixture variants

dedupeFixtures(fixtures) collapses by id. If two independent test cases share a fixture ID but differ in any field (e.g. value, resolverAddress), the second definition is silently dropped. The seeder will then run only the first variant, making one of the two cases test the wrong on-chain state — producing a misleading pass or a hard-to-diagnose failure.

Consider either (a) throwing an error when two fixtures share an id but are not deeply equal, or (b) using content-hash equality as the dedup key so structural differences are always caught at seed time.

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