Skip to content

Commit

Permalink
chore(e2e-test): temp disable e2e test for light client
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Sep 15, 2023
1 parent a98c0d3 commit a50111a
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions packages/e2e-test/scripts/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { join } from "node:path";
import { mkdirSync, rmSync } from "node:fs";
import { retry } from "@ckb-lumos/utils";
import { RPC } from "@ckb-lumos/rpc";
import { LightClientRPC } from "@ckb-lumos/light-client";
// import { LightClientRPC } from "@ckb-lumos/light-client";
import killPort from "kill-port";
import {
ckb,
Expand All @@ -15,7 +15,7 @@ import {
CKB_RPC_PORT,
CKB_RPC_URL,
LIGHT_CLIENT_RPC_PORT,
LIGHT_CLIENT_RPC_URL,
// LIGHT_CLIENT_RPC_URL,
} from "../src/constants";

const MODULE_PATH = join(__dirname, "..");
Expand All @@ -36,7 +36,7 @@ async function main() {
mkdirSync(CKB_CWD, { recursive: true });
mkdirSync(LIGHT_CLIENT_CWD, { recursive: true });

const ckbReleaseUrl = ckb.getReleaseUrl({ version: "v0.111.0-rc1" });
const ckbReleaseUrl = ckb.getReleaseUrl({ version: "v0.111.0" });
const ckbDownloadDest = getDefaultDownloadDestination(ckbReleaseUrl);
let ckbBinaryPath = ckb.findBinaryPath(ckbDownloadDest);

Expand Down Expand Up @@ -102,34 +102,37 @@ async function main() {
cwd: LIGHT_CLIENT_CWD,
});

const lightClientProcess = spawn(
lightClientBinaryPath,
["run", "--config-file", join(LIGHT_CLIENT_CWD, "light-client.toml")],
{
stdio: "inherit",
cwd: LIGHT_CLIENT_CWD,
env: {
RUST_LOG: "info",
ckb_light_client: "info",
},
}
);

const lightClientRpc = new LightClientRPC(LIGHT_CLIENT_RPC_URL);
const lightClientTip = await retry(() => lightClientRpc.getTipHeader(), {
retries: 30,
timeout: 30_000,
delay: 100,
});

console.info("Light Client started, tip header:", lightClientTip);

execSync("npx ava '**/*.e2e.test.ts' --verbose --timeout=5m", {
// TODO uncomment me when the light client is available for CKB2023
// const lightClientProcess = spawn(
// lightClientBinaryPath,
// ["run", "--config-file", join(LIGHT_CLIENT_CWD, "light-client.toml")],
// {
// stdio: "inherit",
// cwd: LIGHT_CLIENT_CWD,
// env: {
// RUST_LOG: "info",
// ckb_light_client: "info",
// },
// }
// );

// const lightClientRpc = new LightClientRPC(LIGHT_CLIENT_RPC_URL);
// const lightClientTip = await retry(() => lightClientRpc.getTipHeader(), {
// retries: 30,
// timeout: 30_000,
// delay: 100,
// });

// console.info("Light Client started, tip header:", lightClientTip);

// TODO uncomment me when the light client is available for CKB2023
// execSync("npx ava '**/*.e2e.test.ts' --verbose --timeout=5m", {
execSync("npx ava '**/{rpc,indexer}.e2e.test.ts' --verbose --timeout=5m", {
cwd: pathTo("/"),
stdio: "inherit",
});

lightClientProcess.kill();
// lightClientProcess.kill();
ckbMinerProcess.kill();
ckbProcess.kill();

Expand Down

0 comments on commit a50111a

Please sign in to comment.