Skip to content

Commit

Permalink
revert e2e changes
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Jan 31, 2025
1 parent 1a26c14 commit 535a137
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 809 deletions.
3 changes: 2 additions & 1 deletion e2e/packages/client-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"viem": "2.21.19"
},
"devDependencies": {
"vite": "^4.2.1"
"vite": "^4.2.1",
"vitest": "0.34.6"
}
}
3 changes: 2 additions & 1 deletion e2e/packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0",
"forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",
"prettier": "3.2.5",
"vite": "^4.2.1"
"vite": "^4.2.1",
"vitest": "0.34.6"
}
}
2 changes: 1 addition & 1 deletion e2e/packages/contracts/worlds.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"31337": {
"address": "0x3400067841D862f40Fd0800D02EF91967020BB30"
"address": "0x7de562d80d6c8672aa32654af67884f411976593"
}
}
5 changes: 3 additions & 2 deletions e2e/packages/sync-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
"chalk": "^5.2.0",
"dotenv": "^16.0.3",
"drizzle-orm": "^0.28.5",
"execa": "^9.5.2",
"execa": "^7.1.1",
"happy-dom": "^12.10.3",
"postgres": "3.3.5",
"typescript": "5.4.2",
"viem": "2.21.19",
"vite": "^4.2.1",
"vitest": "2.1.2",
"vitest": "0.34.6",
"zod": "3.23.8"
}
}
5 changes: 2 additions & 3 deletions e2e/packages/sync-test/setup/deployContracts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @vitest-environment node
import chalk from "chalk";
import { execa } from "execa";

Expand All @@ -8,11 +7,11 @@ export function deployContracts(rpc: string) {
stdio: "pipe",
});

deploymentProcess.stdout.on("data", (data) => {
deploymentProcess.stdout?.on("data", (data) => {
console.log(chalk.blueBright("[mud deploy]:"), data.toString());
});

deploymentProcess.stderr.on("data", (data) => {
deploymentProcess.stderr?.on("data", (data) => {
console.error(chalk.blueBright("[mud deploy error]:"), data.toString());
});

Expand Down
12 changes: 5 additions & 7 deletions e2e/packages/sync-test/setup/startIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { cleanDatabase } from "@latticexyz/store-sync/postgres";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import path from "node:path";
import { exitCode } from "node:process";

type IndexerOptions =
| {
Expand Down Expand Up @@ -48,8 +47,6 @@ export async function startIndexer(opts: StartIndexerOptions) {
const proc = execa("pnpm", opts.indexer === "postgres" ? ["start:postgres"] : ["start:sqlite"], {
cwd: path.join(__dirname, "..", "..", "..", "..", "packages", "store-indexer"),
env,
forceKillAfterDelay: 5000,
exitCode: 0,
});

proc.on("error", (error) => {
Expand All @@ -74,8 +71,8 @@ export async function startIndexer(opts: StartIndexerOptions) {
console.log(chalk.magentaBright("[indexer]:", data));
}

proc.stdout.on("data", (data) => onLog(data.toString()));
proc.stderr.on("data", (data) => onLog(data.toString()));
proc.stdout?.on("data", (data) => onLog(data.toString()));
proc.stderr?.on("data", (data) => onLog(data.toString()));

async function cleanUp() {
// attempt to clean up sqlite file
Expand Down Expand Up @@ -112,9 +109,10 @@ export async function startIndexer(opts: StartIndexerOptions) {
if (exited) {
return resolve();
}
console.log("killing indexer");
proc.once("exit", resolve);
proc.kill("SIGTERM");
proc.kill("SIGTERM", {
forceKillAfterTimeout: 5000,
});
}),
};
}
Expand Down
3 changes: 2 additions & 1 deletion e2e/packages/sync-test/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { defineConfig, configDefaults } from "vitest/config";

export default defineConfig({
test: {
environment: "happy-dom",
testTimeout: 1000 * 60 * 2,
hookTimeout: 1000 * 60 * 2,
fileParallelism: false,
singleThread: true,
globalSetup: ["./setup/globalSetup.ts"],
exclude: [...configDefaults.exclude, "compare"],
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/test-data/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 535a137

Please sign in to comment.