Skip to content

test: add ethdebug/conformance#215

Merged
gnidan merged 3 commits into
ethdebug:mainfrom
walnuthq:feature/ethdebug-solc
Jun 18, 2026
Merged

test: add ethdebug/conformance#215
gnidan merged 3 commits into
ethdebug:mainfrom
walnuthq:feature/ethdebug-solc

Conversation

@djolertrk

Copy link
Copy Markdown
Contributor

Add conformance tests for ethdebug producers and consumers.

$ yarn --cwd packages/conformance test
 ✓ test/conformance.test.ts (5 tests) 2442ms
   ✓ @ethdebug/conformance > [bug] compiles BUG fixtures into valid ETHDebug programs 7ms
   ✓ @ethdebug/conformance > [solc] compiles Solidity fixtures and validates ETHDebug output 45ms
   ✓ @ethdebug/conformance > [soldb] checks solc ETHDebug resources through the SolDB consumer backend 34ms
   ✓ @ethdebug/conformance > [soldb] checks multi-source solc ETHDebug resources through the SolDB consumer backend 21ms
   ✓ @ethdebug/conformance > [soldb] checks source-line breakpoints against solc output on local anvil  2335ms

 Test Files  1 passed (1)
      Tests  5 passed (5)
   Start at  16:51:17
   Duration  3.02s (transform 220ms, setup 0ms, collect 430ms, tests 2.44s, environment 0ms, prepare 30ms)

@djolertrk

Copy link
Copy Markdown
Contributor Author

cc @gnidan

@djolertrk djolertrk marked this pull request as draft May 15, 2026 14:53
@djolertrk djolertrk marked this pull request as ready for review May 22, 2026 09:24

@gnidan gnidan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This conformance suite is awesome! Thank you for putting it together @djolertrk 🙏

Mostly I'm requesting changes to make sure we test against the JSON-Schemas themselves, but maybe you'll agree with my other comments also. Let me know if you run into trouble with the hyperjump stuff.

On a broader note, this stuff might get a bit complicated when we want to add schema versioning, since then suddenly the conformance tests have to grow in dimensionality... Have you thought about this at all? Obviously that conversation remains a bit premature [and definitely shouldn't block getting this PR merged]

Comment thread packages/conformance/src/runner.ts
Comment thread packages/conformance/test/conformance.test.ts
Comment thread packages/conformance/src/adapters/soldb.ts
Comment thread packages/conformance/src/runner.ts Outdated
}

const knownSourceIds = sourceIds(artifact);
if (knownSourceIds.size > 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can knownSourceIds ever be empty if referencedSourceIds isn't? If so, we probably don't want to silently skip this check.

Comment on lines +176 to +195
const interactive = await runSoldb({
executable: soldb!,
args: [
"trace",
tx.transactionHash,
"--rpc",
anvil.rpcUrl,
"--ethdebug-dir",
debugDir.spec,
"--interactive",
],
stdin: "break Counter.sol:8\ncontinue\nq\n",
});

expect(interactive.exitCode).toBe(0);
expect(interactive.stdout).toContain(
"Breakpoint set at Counter.sol:8, PC",
);
expect(interactive.stdout).toContain("Breakpoint hit at step");
expect(interactive.stdout).toContain("Counter.sol:8, PC");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This stuff gets a bit brittle, no? No way to control soldb as a library for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, agreed. I moved the REPL scripting/output matching behind SolDB adapter helpers, so the test no longer hardcodes the raw interaction inline.

Comment thread .github/workflows/ethdebug.yml
@djolertrk

Copy link
Copy Markdown
Contributor Author

This conformance suite is awesome! Thank you for putting it together @djolertrk 🙏

Mostly I'm requesting changes to make sure we test against the JSON-Schemas themselves, but maybe you'll agree with my other comments also. Let me know if you run into trouble with the hyperjump stuff.

Thanks!

On a broader note, this stuff might get a bit complicated when we want to add schema versioning, since then suddenly the conformance tests have to grow in dimensionality... Have you thought about this at all? Obviously that conversation remains a bit premature [and definitely shouldn't block getting this PR merged]

Yes, I’ve thought about it. I think schema versioning can actually make the conformance suite cleaner rather than worse: each fixture can declare the ETHDebug schema version it targets, and the runner can validate it against the matching schema set, and new tests added for a schema bump can target the specific behavior or shape changed by that bump.

@gnidan gnidan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @djolertrk for handling all my concerns.

This is super exciting that this repo's CI will test against real live solc ethdebug output. Like, holy crap! Kudos for this.

@gnidan gnidan merged commit 5609d04 into ethdebug:main Jun 18, 2026
4 of 5 checks passed
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.

3 participants