ci: run the test suite, which CI has never done - #15
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI has never run the test suite. It builds the program, lints it, runs
cargo testand 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(".")loadstarget/deploy/soladrome.sofrom 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.--resetis 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
initializeitself and hardcodes no wallet, so nothing real is ever needed and nothing real is ever signed. The program id comes fromAnchor.tomlrather 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:
.so: 69 passing, 0 failing.tests/soladrome.tsagainst a freshsolana-test-validator --resetsigning 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.rsand 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.