Skip to content

Commit b393f49

Browse files
committed
test(e2e): use fixed deploy-test domains instead of unique-per-run
The deploy e2e suite was calling uniqueDomain() (e2e<rand4>-dev<NN>) for every test, and dot deploy --playground permanently registers each name on the playground-registry contract. After many CI runs, the live registry browsed by users was filling up with test entries like 'e2el7cq-dev83'. Replace with four fixed names (E2E_DOMAINS.{preflight,storage,redeploy, collision}) reused across runs. SIGNER owns them after the first run; the registry contract permits same-owner re-publish, so subsequent runs just update metadata in place. Net effect: 4 permanent test entries total, instead of 5-7 new ones per CI run. Same idea as the playground-app e2e suite, which uses one fixed fixture domain (playground-e2e-app.dot) for the same reason.
1 parent a64206c commit b393f49

2 files changed

Lines changed: 29 additions & 21 deletions

File tree

e2e/cli/deploy.test.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
* - The --contracts flag
1414
*/
1515

16-
import { describe, test, expect, beforeEach } from "vitest";
16+
import { describe, test, expect } from "vitest";
1717
import { resolve } from "node:path";
1818
import { dot } from "./helpers/dot.js";
19-
import { SIGNER, BOB, uniqueDomain } from "./fixtures/accounts.js";
19+
import { SIGNER, BOB, E2E_DOMAINS } from "./fixtures/accounts.js";
2020
import { fixturePath } from "./fixtures/templates.js";
2121

2222
const frontendOnly = fixturePath("frontend-only");
@@ -51,7 +51,7 @@ describe("dot deploy — preflight and validation", () => {
5151
const result = await dot([
5252
"deploy",
5353
"--signer", "dev",
54-
"--domain", uniqueDomain(),
54+
"--domain", E2E_DOMAINS.preflight,
5555
"--buildDir", absBuildDir(foundry),
5656
"--no-build",
5757
"--contracts",
@@ -70,7 +70,7 @@ describe("dot deploy — preflight and validation", () => {
7070
const result = await dot([
7171
"deploy",
7272
"--signer", "dev",
73-
"--domain", uniqueDomain(),
73+
"--domain", E2E_DOMAINS.preflight,
7474
"--buildDir", absBuildDir(hardhat),
7575
"--no-build",
7676
"--contracts",
@@ -87,7 +87,7 @@ describe("dot deploy — preflight and validation", () => {
8787
const result = await dot([
8888
"deploy",
8989
"--signer", "dev",
90-
"--domain", uniqueDomain(),
90+
"--domain", E2E_DOMAINS.preflight,
9191
"--buildDir", absBuildDir(rustCdm),
9292
"--no-build",
9393
"--contracts",
@@ -104,7 +104,7 @@ describe("dot deploy — preflight and validation", () => {
104104
const result = await dot([
105105
"deploy",
106106
"--signer", "dev",
107-
"--domain", uniqueDomain(),
107+
"--domain", E2E_DOMAINS.preflight,
108108
"--buildDir", absBuildDir(multiContract),
109109
"--no-build",
110110
"--contracts",
@@ -121,7 +121,7 @@ describe("dot deploy — preflight and validation", () => {
121121
const result = await dot([
122122
"deploy",
123123
"--signer", "dev",
124-
"--domain", uniqueDomain(),
124+
"--domain", E2E_DOMAINS.preflight,
125125
"--buildDir", absBuildDir(frontendOnly),
126126
"--no-build",
127127
"--contracts",
@@ -134,7 +134,7 @@ describe("dot deploy — preflight and validation", () => {
134134
});
135135

136136
test("domain availability check runs before build/upload", { timeout: 300_000 }, async () => {
137-
const domain = uniqueDomain();
137+
const domain = E2E_DOMAINS.preflight;
138138
const result = await dot([
139139
"deploy",
140140
"--signer", "dev",
@@ -151,13 +151,8 @@ describe("dot deploy — preflight and validation", () => {
151151
});
152152

153153
describe("dot deploy --playground — full pipeline (requires Paseo + IPFS)", () => {
154-
let domain: string;
155-
156-
beforeEach(() => {
157-
domain = uniqueDomain();
158-
});
159-
160154
test("frontend-only deploy completes end-to-end", { timeout: 450_000 }, async () => {
155+
const domain = E2E_DOMAINS.storage;
161156
const result = await dot([
162157
"deploy",
163158
"--signer", "dev",
@@ -178,6 +173,7 @@ describe("dot deploy --playground — full pipeline (requires Paseo + IPFS)", ()
178173
});
179174

180175
test("re-deploy same domain succeeds for same owner", { timeout: 900_000 }, async () => {
176+
const domain = E2E_DOMAINS.redeploy;
181177
const first = await dot([
182178
"deploy",
183179
"--signer", "dev",
@@ -208,6 +204,7 @@ describe("dot deploy --playground — full pipeline (requires Paseo + IPFS)", ()
208204
});
209205

210206
test("domain taken by another account shows unavailable", { timeout: 900_000 }, async () => {
207+
const domain = E2E_DOMAINS.collision;
211208
const ownerDeploy = await dot([
212209
"deploy",
213210
"--signer", "dev",

e2e/cli/fixtures/accounts.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,22 @@ export const ALICE: TestAccount = devAccount("Alice");
6565
export const BOB: TestAccount = devAccount("Bob");
6666

6767
/**
68-
* Generate a unique .dot domain name for deploy tests.
69-
* Format mirrors `<word>-dev<NN>`.
68+
* Fixed `.dot` domain names for deploy tests. SIGNER owns all of these after
69+
* the first CI run; subsequent runs re-publish to the same domains, which the
70+
* registry contract permits for the same owner. This keeps the playground
71+
* registry from accumulating a new entry on every CI run.
72+
*
73+
* Use a separate domain per test that exercises a meaningfully different
74+
* publish path (storage / re-deploy / cross-owner collision); reuse a single
75+
* domain for the preflight tests, which never reach publish.
7076
*/
71-
export function uniqueDomain(): string {
72-
const rand = Math.random().toString(36).slice(2, 6);
73-
const suffix = String(Date.now()).slice(-2);
74-
return `e2e${rand}-dev${suffix}`;
75-
}
77+
export const E2E_DOMAINS = {
78+
/** Used by all preflight / validation tests — they exit before publish. */
79+
preflight: "e2e-cli-preflight",
80+
/** Used by the storage-phase happy path. */
81+
storage: "e2e-cli-storage",
82+
/** Used by the same-owner re-deploy test. */
83+
redeploy: "e2e-cli-redeploy",
84+
/** Used by the cross-owner collision test (BOB tries to take SIGNER's). */
85+
collision: "e2e-cli-collision",
86+
} as const;

0 commit comments

Comments
 (0)