Skip to content

Commit 5b68921

Browse files
snowmeadclaude
andcommitted
fix(test): ensure MSP database access and indexer runtime configuration
MSP nodes now require --provider-database-url for move bucket operations (required by CLI since a7d853b). This fix ensures: 1. MSPs always get --provider-database-url in fullnet (regardless of indexer setting) 2. Postgres always starts for fullnet (MSPs need database access) 3. Database migrations run for fullnet (MSPs need schema) 4. Standalone indexer gets --chain=solochain-evm-dev flag for solochain runtime This fixes widespread test failures across User, BSPNet, FullNet, Solochain EVM, Fisherman, and Backend integration test suites where MSP nodes failed to start without database configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a7d853b commit 5b68921

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

test/util/netLaunch/index.ts

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ export class NetworkLauncher {
128128
if (this.config.fisherman && this.type === "fullnet") {
129129
composeYaml.services["sh-fisherman"].command.push("--chain=solochain-evm-dev");
130130
}
131+
132+
// Add the runtime type to the command for standalone indexer if enabled
133+
if (this.config.indexer && this.config.standaloneIndexer && this.type === "fullnet") {
134+
composeYaml.services["sh-indexer"].command.push("--chain=solochain-evm-dev");
135+
}
131136
}
132137

133138
// Configure fisherman service
@@ -209,6 +214,17 @@ export class NetworkLauncher {
209214
}
210215
}
211216

217+
// MSPs always need database access for move bucket operations (required by CLI)
218+
// Always configure this for fullnet regardless of indexer setting
219+
if (this.type === "fullnet") {
220+
composeYaml.services["sh-msp-1"].command.push(
221+
"--provider-database-url=postgresql://postgres:postgres@storage-hub-sh-postgres-1:5432/storage_hub"
222+
);
223+
composeYaml.services["sh-msp-2"].command.push(
224+
"--provider-database-url=postgresql://postgres:postgres@storage-hub-sh-postgres-1:5432/storage_hub"
225+
);
226+
}
227+
212228
if (this.config.indexer) {
213229
// If using standalone indexer, configure the sh-indexer service
214230
if (this.config.standaloneIndexer && this.type === "fullnet") {
@@ -231,15 +247,6 @@ export class NetworkLauncher {
231247
composeYaml.services["sh-user"].command.push(`--indexer-mode=${this.config.indexerMode}`);
232248
}
233249
}
234-
235-
// MSPs need database access for move bucket operations
236-
// Use --provider-database-url instead of full indexer flags
237-
composeYaml.services["sh-msp-1"].command.push(
238-
"--provider-database-url=postgresql://postgres:postgres@storage-hub-sh-postgres-1:5432/storage_hub"
239-
);
240-
composeYaml.services["sh-msp-2"].command.push(
241-
"--provider-database-url=postgresql://postgres:postgres@storage-hub-sh-postgres-1:5432/storage_hub"
242-
);
243250
}
244251

245252
const cwd = path.resolve(process.cwd(), "..", "docker");
@@ -364,14 +371,19 @@ export class NetworkLauncher {
364371
}
365372
}
366373

367-
if (this.config.indexer) {
374+
// Postgres is always needed for fullnet because MSPs require database access
375+
// For other network types, only start postgres if indexer is enabled
376+
if (this.type === "fullnet" || this.config.indexer) {
368377
await compose.upOne("sh-postgres", {
369378
cwd: cwd,
370379
config: tmpFile,
371380
log: verbose
372381
});
373382

374-
await this.runMigrations();
383+
// Run migrations for fullnet (MSPs need the schema) or when indexer is enabled
384+
if (this.type === "fullnet" || this.config.indexer) {
385+
await this.runMigrations();
386+
}
375387

376388
// Start backend only if backend flag is enabled (depends on msp-1 and postgres)
377389
if (this.config.backend && this.type === "fullnet") {
@@ -433,7 +445,11 @@ export class NetworkLauncher {
433445
}
434446

435447
private async runMigrations() {
436-
assert(this.config.indexer, "Indexer must be enabled to run migrations");
448+
// Migrations are needed for indexer or for fullnet (MSPs require database schema)
449+
assert(
450+
this.config.indexer || this.type === "fullnet",
451+
"Indexer must be enabled or network type must be fullnet to run migrations"
452+
);
437453

438454
const dieselCheck = spawnSync("diesel", ["--version"], { stdio: "ignore" });
439455
assert(

0 commit comments

Comments
 (0)