Skip to content

Commit 3751335

Browse files
ci(e2e): nightly-deploy-multi cell + parametrize contract-deploy tests (Phase 5c) (#90)
1 parent 5ce8cf8 commit 3751335

4 files changed

Lines changed: 57 additions & 56 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"playground-cli": patch
3+
---
4+
5+
Nightly E2E now exercises the multi-contract publish path: `nightly-deploy-multi` cell publishes both `TokenA.sol` and `TokenB.sol` from the multi-contract fixture to the `e2e-cli-multi.dot` domain, exercising the batch contract-instantiate path. Refactored the 3 near-identical contract-deploy tests (foundry, hardhat, multi) into a shared `runContractDeployTest` helper.

.github/workflows/e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ jobs:
138138
- cell: nightly-deploy-hardhat
139139
# source: e2e/cli/deploy.test.ts → describe("dot deploy — hardhat …")
140140
pattern: "deploy — hardhat"
141+
- cell: nightly-deploy-multi
142+
# source: e2e/cli/deploy.test.ts → describe("dot deploy — multi …")
143+
pattern: "deploy — multi"
141144
steps:
142145
- uses: actions/checkout@v4
143146

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ These are things that aren't self-evident from reading the code and have bitten
5656

5757
- **Local launcher:** `tools/e2e-local.sh [smoke|pr|nightly]` — also callable via `pnpm test:e2e:smoke`, `pnpm test:e2e:pr`, `pnpm test:e2e:nightly`.
5858
- **CI workflow:** `.github/workflows/e2e.yml` — runs on PR / push:main / cron 06:00 UTC / workflow_dispatch.
59-
- **CI matrix:** 9 cells across four matrices — `test-no-publish` (parallel: pr-install, pr-preflight, pr-mod, pr-init-session) + `test-publish` (max-parallel: 1: pr-deploy-frontend, pr-deploy-foundry) + `test-nightly-no-publish` (parallel, schedule/dispatch only: nightly-mod-miss, nightly-diagnostic) + `test-nightly-publish` (max-parallel: 1, schedule/dispatch only: nightly-deploy-hardhat). Each cell runs a subset via `vitest -t "<pattern>"`.
59+
- **CI matrix:** 10 cells across four matrices — `test-no-publish` (parallel: pr-install, pr-preflight, pr-mod, pr-init-session) + `test-publish` (max-parallel: 1: pr-deploy-frontend, pr-deploy-foundry) + `test-nightly-no-publish` (parallel, schedule/dispatch only: nightly-mod-miss, nightly-diagnostic) + `test-nightly-publish` (max-parallel: 1, schedule/dispatch only: nightly-deploy-hardhat, nightly-deploy-multi). Each cell runs a subset via `vitest -t "<pattern>"`.
6060
- **Test files:** `e2e/cli/*.test.ts` (vitest, spawned via `bun run src/index.ts`).
6161
- **Reports directory:** `e2e-reports/junit.xml` + `e2e-reports/dot-runs.log` (gitignored).
6262
- **Tag prefix:** `DOT_TAG=e2e-{ci|local}-{trigger}` so Sentry dashboards filter test traffic. The CLI plumbs `DOT_TAG` into the `cli.tag` root-span attribute via `src/telemetry-config.ts`.

e2e/cli/deploy.test.ts

Lines changed: 48 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,48 @@ function absBuildDir(fixture: string, dir = "dist"): string {
3030
return resolve(fixture, dir);
3131
}
3232

33+
/**
34+
* Shared helper for contract-deploy end-to-end tests.
35+
*
36+
* `--no-contract-build` skips the toolchain subprocess (forge / npx hardhat
37+
* compile / cargo-contract) so the CI runner doesn't need the EVM/Rust
38+
* toolchain installed. Each fixture ships pre-built bytecode in its out/ or
39+
* artifacts/ directory.
40+
*/
41+
interface ContractDeployTestConfig {
42+
/** describe-block discriminator: "foundry", "hardhat", "multi" */
43+
name: string;
44+
/** E2E_DOMAINS.<name> */
45+
domain: string;
46+
/** fixturePath() result */
47+
fixture: string;
48+
}
49+
50+
function runContractDeployTest(cfg: ContractDeployTestConfig): void {
51+
describe(`dot deploy — ${cfg.name} (requires Paseo + IPFS)`, () => {
52+
test(`${cfg.name} deploy completes end-to-end`, { timeout: 450_000 }, async () => {
53+
const result = await dot([
54+
"deploy",
55+
"--signer", "dev",
56+
"--domain", cfg.domain,
57+
"--buildDir", absBuildDir(cfg.fixture),
58+
"--contracts",
59+
"--no-contract-build",
60+
"--playground",
61+
"--suri", SIGNER.suri,
62+
"--dir", cfg.fixture,
63+
], { timeout: 400_000 });
64+
65+
expect(
66+
result.exitCode,
67+
`${cfg.name} deploy failed: ${result.stdout}\n${result.stderr}`,
68+
).toBe(0);
69+
expect(result.stdout).toContain("Deploy complete");
70+
expect(result.stdout).toContain(cfg.domain);
71+
});
72+
});
73+
}
74+
3375
describe("dot deploy — preflight and validation", () => {
3476
test("reports mainnet not yet supported", async () => {
3577
const result = await dot([
@@ -238,61 +280,12 @@ describe("dot deploy --playground — full pipeline (requires Paseo + IPFS)", ()
238280
});
239281
});
240282

241-
describe("dot deploy — foundry (requires Paseo + IPFS)", () => {
242-
test("foundry deploy completes end-to-end", { timeout: 450_000 }, async () => {
243-
const domain = E2E_DOMAINS.foundry;
244-
const result = await dot([
245-
"deploy",
246-
"--signer", "dev",
247-
"--domain", domain,
248-
"--buildDir", absBuildDir(foundry),
249-
// --no-contract-build skips the forge subprocess so we don't
250-
// need the EVM toolchain on the CI runner; the fixture ships
251-
// pre-committed bytecode under out/Counter.sol/Counter.json.
252-
// The frontend build is the trivial mkdir+echo in the fixture's
253-
// package.json — let it run to produce dist/.
254-
"--contracts",
255-
"--no-contract-build",
256-
"--playground",
257-
"--suri", SIGNER.suri,
258-
"--dir", foundry,
259-
], { timeout: 400_000 });
260-
261-
expect(
262-
result.exitCode,
263-
`foundry deploy failed: ${result.stdout}\n${result.stderr}`,
264-
).toBe(0);
265-
expect(result.stdout).toContain("Deploy complete");
266-
expect(result.stdout).toContain(domain);
267-
});
268-
});
269-
270-
describe("dot deploy — hardhat (requires Paseo + IPFS)", () => {
271-
test("hardhat deploy completes end-to-end", { timeout: 450_000 }, async () => {
272-
const domain = E2E_DOMAINS.hardhat;
273-
const result = await dot([
274-
"deploy",
275-
"--signer", "dev",
276-
"--domain", domain,
277-
"--buildDir", absBuildDir(hardhat),
278-
// --no-contract-build skips `npx hardhat compile` (the toolchain
279-
// isn't installed on the CI runner). The fixture ships pre-built
280-
// bytecode under artifacts/contracts/Lock.sol/Lock.json.
281-
"--contracts",
282-
"--no-contract-build",
283-
"--playground",
284-
"--suri", SIGNER.suri,
285-
"--dir", hardhat,
286-
], { timeout: 400_000 });
287-
288-
expect(
289-
result.exitCode,
290-
`hardhat deploy failed: ${result.stdout}\n${result.stderr}`,
291-
).toBe(0);
292-
expect(result.stdout).toContain("Deploy complete");
293-
expect(result.stdout).toContain(domain);
294-
});
295-
});
283+
// Contract-deploy tests — parametrized via runContractDeployTest
284+
runContractDeployTest({ name: "foundry", domain: E2E_DOMAINS.foundry, fixture: foundry });
285+
runContractDeployTest({ name: "hardhat", domain: E2E_DOMAINS.hardhat, fixture: hardhat });
286+
// Multi-contract foundry project — exercises the contracts-batch publish path
287+
// (TokenA.sol + TokenB.sol deployed in a single --contracts run).
288+
runContractDeployTest({ name: "multi", domain: E2E_DOMAINS.multi, fixture: multiContract });
296289

297290
// SKIPPED: the rust-cdm fixture's `target/flipper.contract` is a stub
298291
// (`{"source":{"hash":"0xabc"}}`) and there is no `target/<crate>.release.polkavm`

0 commit comments

Comments
 (0)