Skip to content

Commit fa1c272

Browse files
authored
fix: broken e2e tests (#1391)
## Summary by Sourcery Use dynamic node lookup and hoisted bun linker in e2e tests to fix broken tests Bug Fixes: - Replace hardcoded node name with dynamic resolution in restart-resources test by adding a helper that fetches the blockchain node via the SDK - Update bun install commands in SettleMint and standalone project setup tests to include `--linker=hoisted` for correct dependency installation <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit 245d6fc. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 7fcbe40 commit fa1c272

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

test/create-new-settlemint-project.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("Setup a project on the SettleMint platform using the SDK", () => {
7777
await updatePackageJsonToUseLinkedDependencies(dAppDir);
7878
await updatePackageJsonToUseLinkedDependencies(contractsDir);
7979
await updatePackageJsonToUseLinkedDependencies(subgraphDir);
80-
await $`bun install --no-cache`.cwd(projectDir).env(env);
80+
await $`bun install --no-cache --linker=hoisted`.cwd(projectDir).env(env);
8181
});
8282

8383
test("Connect to platform", async () => {

test/create-new-standalone-project.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe("Setup a project on a standalone environment using the SDK", () => {
124124
await updatePackageJsonToUseLinkedDependencies(dAppDir);
125125
await updatePackageJsonToUseLinkedDependencies(contractsDir);
126126
await updatePackageJsonToUseLinkedDependencies(subgraphDir);
127-
await $`bun install --no-cache`.cwd(projectDir).env(env);
127+
await $`bun install --no-cache --linker=hoisted`.cwd(projectDir).env(env);
128128
});
129129

130130
test("Connect to standalone environment", async () => {

test/restart-resources.e2e.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { loadEnv } from "@settlemint/sdk-utils/environment";
33
import { fetchWithRetry } from "@settlemint/sdk-utils/http";
44
import { NODE_NAME_3_WITHOUT_PK } from "./constants/test-resources";
55
import { forceExitAllCommands, runCommand } from "./utils/run-command";
6+
import { findBlockchainNodeByName } from "./utils/test-resources";
67

78
const COMMAND_TEST_SCOPE = __filename;
89

@@ -14,11 +15,15 @@ afterEach(() => {
1415

1516
describe("Restart platform resources using the SDK", () => {
1617
test("Restart blockchain node on the platform", async () => {
18+
const blockchainNode = await findBlockchainNodeByName(NODE_NAME_3_WITHOUT_PK);
19+
if (!blockchainNode) {
20+
throw new Error(`Blockchain node ${NODE_NAME_3_WITHOUT_PK} not found`);
21+
}
1722
const { output } = await runCommand(COMMAND_TEST_SCOPE, [
1823
"platform",
1924
"restart",
2025
"blockchain-node",
21-
NODE_NAME_3_WITHOUT_PK,
26+
blockchainNode.uniqueName,
2227
"--wait",
2328
"--accept-defaults",
2429
]).result;

0 commit comments

Comments
 (0)