Skip to content

ci: run the test suite, which CI has never done - #15

Merged
OxToF merged 2 commits into
mainfrom
ci/run-the-test-suite
Sep 1, 2026
Merged

ci: run the test suite, which CI has never done#15
OxToF merged 2 commits into
mainfrom
ci/run-the-test-suite

Conversation

@OxToF

@OxToF OxToF commented Aug 31, 2026

Copy link
Copy Markdown
Owner

CI has never run the test suite. It builds the program, lints it, runs cargo test and the frontend build — and goes green. The 105 cases that cover the protocol economics ran nowhere automatic, so a pull request breaking the emission ceiling, the borrow-collateral guard or the floor invariant passed exactly as green as one that did not.

PR #14 demonstrated it: five checks green, zero of the 105 tests executed.

Two jobs, split by what they need

Bankrun (69 cases) joins the existing Anchor job. Not a job of its own, because startAnchor(".") loads target/deploy/soladrome.so from the tree and this is the job that already builds it — a separate job would rebuild it or ship it as an artefact. In-process, ~2s. Covers the emission cycle and its ceilings, the continuous stream, borrow-collateral recycling, the floor guard, partner allocations, and the SPL-only token boundary.

A new job runs tests/soladrome.ts (36 cases) against a real validator. The curve invariants, POL, and the founder/team/contributor allocation paths that bankrun cannot host. --reset is not optional here: state left by a previous run makes tests pass that fail from cold, which CLAUDE.md records as already having happened once.

On the throwaway keypair

The integration job generates its own keypair in the runner. The suite calls initialize itself and hardcodes no wallet, so nothing real is ever needed and nothing real is ever signed. The program id comes from Anchor.toml rather than being pasted in, so it cannot drift.

Verified before it was written

Both halves were run locally against the exact shape the workflow uses, rather than trusted to the first CI run:

  • Bankrun alone, freshly built .so: 69 passing, 0 failing.
  • tests/soladrome.ts against a fresh solana-test-validator --reset signing with a throwaway keypair, not the local deployer: 36 passing, 0 failing (47s).

69 + 36 = the 105 this repo has, and now runs.

Why now

This lands before the Token-2022 migration on purpose. That migration touches amm.rs, bribes.rs and the partner stream — the three areas only these tests cover. Writing it against a CI that cannot make them fail is how the July devnet brick happened.

The 105 tests that cover the protocol economics ran nowhere automatic. CI
built the program, linted it, and went green — a pull request that broke the
emission ceiling, the borrow-collateral guard or the floor invariant passed
just as green as one that did not.

Two jobs now, split by what they need:

  • The bankrun suite (69 cases) joins the existing Anchor job, because that
    job already produces the `target/deploy/soladrome.so` that
    `startAnchor(".")` loads. In-process, ~2s, no validator.

  • A new job runs tests/soladrome.ts (36 cases) against a real
    `solana-test-validator` with `--reset`, for the curve invariants, POL and
    the allocation paths that bankrun cannot host.

The integration job signs with a throwaway keypair generated in the runner:
the suite calls `initialize` itself and hardcodes no wallet, so nothing real
is ever needed. Verified locally against a fresh validator and a fresh
keypair before being written here — 36 passing, matching the 69 from bankrun
for the full 105.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
soladrome-lzn5 Ready Ready Preview Aug 31, 2026 10:32pm

The first run of this workflow failed where it was least expected: the
bankrun suite, not the validator job. Node 22.18+ enables native TypeScript
type-stripping by default and it claims `.ts` before ts-node's require hook
can. It reads the ESM syntax, serves the file as a module, `require()` fails,
and mocha retries with `import()` — where `BN` is no longer a statically
analysable named export of `@coral-xyz/anchor`, which is CommonJS. The run
dies on a SyntaxError before a single test executes.

Node 24 resolves the same file the other way, which is why the suite was
green on the machine it was written on and red on the runner, with identical
code and identical dependencies.

Reproduced locally under the runner's exact 22.23.2 before fixing, and the
flag takes it back to 69 passing. Set on both test jobs rather than only the
one that failed: the loader race is not file-specific by design, and the
integration job passing today is luck worth removing.

CLAUDE.md records it, since the documented local recipe hits the same wall on
any Node 22.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@OxToF
OxToF merged commit 2806054 into main Sep 1, 2026
6 checks passed
@OxToF
OxToF deleted the ci/run-the-test-suite branch September 1, 2026 07:11
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