mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-01 21:05:42 +09:00
Remove temporary shard 6 timing markers
This commit is contained in:
1 parent
dbb365e5e5
commit
eacb24ea79
3 files changed
+1
-63
No files matched your search
@@ -5,7 +5,6 @@ import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { loadDevBuild } from "../db";
|
||||
import { stopChildProcess } from "../process";
|
||||
import { logPerf } from "../perf";
|
||||
import {
|
||||
createLocalBundleFromDevBuild,
|
||||
getAvailablePort,
|
||||
@@ -23,10 +22,6 @@ const cliTsconfigPath = fileURLToPath(
|
||||
new URL("../../../../packages/cli/tsconfig.local.json", import.meta.url)
|
||||
);
|
||||
|
||||
// Temporary markers for the shard 6 Linux timing run.
|
||||
const profileShard6Preview =
|
||||
process.env.CI !== undefined && process.env.E2E_TEST_SHARD === "shard-6";
|
||||
|
||||
export const withMcpEmailHttpPreview = async <Result>({
|
||||
emailPort,
|
||||
httpPort,
|
||||
@@ -56,7 +51,6 @@ export const withMcpEmailHttpPreview = async <Result>({
|
||||
);
|
||||
const port = await getAvailablePort();
|
||||
const output: string[] = [];
|
||||
const previewStartedAt = Date.now();
|
||||
preview = spawn(
|
||||
process.execPath,
|
||||
[
|
||||
@@ -95,25 +89,11 @@ export const withMcpEmailHttpPreview = async <Result>({
|
||||
url,
|
||||
output: () => output.join(""),
|
||||
});
|
||||
if (profileShard6Preview) {
|
||||
logPerf("shard 6 Preview build and startup", previewStartedAt);
|
||||
}
|
||||
return await callback({ url });
|
||||
} finally {
|
||||
if (preview !== undefined) {
|
||||
const shutdownStartedAt = Date.now();
|
||||
try {
|
||||
await stopChildProcess(preview, { killGroup: true });
|
||||
} finally {
|
||||
if (profileShard6Preview) {
|
||||
logPerf("shard 6 Preview process group shutdown", shutdownStartedAt);
|
||||
}
|
||||
}
|
||||
await stopChildProcess(preview, { killGroup: true });
|
||||
}
|
||||
const removeStartedAt = Date.now();
|
||||
await rm(tempDir, { recursive: true, force: true });
|
||||
if (profileShard6Preview) {
|
||||
logPerf("shard 6 Preview temporary directory removal", removeStartedAt);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -9,14 +9,11 @@ import { withMcpEmailHttpPreview } from "../flows/mcp-email-http-preview";
|
||||
import { startFormContextReceiver } from "../flows/form-context-receiver";
|
||||
import { runFormAuthor } from "../flows/mcp-form-author";
|
||||
import { test } from "../test";
|
||||
import { logPerf } from "../perf";
|
||||
import {
|
||||
startPreviewFormMcpClient,
|
||||
submitPreviewFormViaMcp,
|
||||
} from "../flows/mcp-preview-submit";
|
||||
|
||||
const profileCi = process.env.CI !== undefined;
|
||||
|
||||
const authorForms = async (projectId: string) => {
|
||||
const { stdout } = await runFormAuthor(
|
||||
"mcp-default-contact-email-author",
|
||||
@@ -71,7 +68,6 @@ test("Generated Preview delivers MCP-authored forms with readable email and brow
|
||||
email: "mcp-default-contact@webstudio.test",
|
||||
title: "MCP default contact Form",
|
||||
});
|
||||
const authorStartedAt = Date.now();
|
||||
const {
|
||||
formData: {
|
||||
formId: formDataFormId,
|
||||
@@ -81,9 +77,6 @@ test("Generated Preview delivers MCP-authored forms with readable email and brow
|
||||
contact: { formId, ownerResourceId, visitorResourceId },
|
||||
context: { formId: contextFormId },
|
||||
} = await authorForms(projectId);
|
||||
if (profileCi) {
|
||||
logPerf("shard 6 Preview form authoring", authorStartedAt);
|
||||
}
|
||||
expect(formDataExpression).toContain(".toString()");
|
||||
const build = await loadDevBuild({ projectId });
|
||||
const resources = JSON.parse(build.resources) as Array<{
|
||||
@@ -168,7 +161,6 @@ test("Generated Preview delivers MCP-authored forms with readable email and brow
|
||||
throw new Error("Expected a local Email receiver port");
|
||||
}
|
||||
const receiver = await startFormContextReceiver();
|
||||
let assertionsFinishedAt: number | undefined;
|
||||
try {
|
||||
await withMcpEmailHttpPreview({
|
||||
projectId,
|
||||
@@ -411,26 +403,12 @@ test("Generated Preview delivers MCP-authored forms with readable email and brow
|
||||
},
|
||||
});
|
||||
});
|
||||
if (profileCi) {
|
||||
assertionsFinishedAt = Date.now();
|
||||
console.info("[e2e:profile] shard 6 Preview assertions finished");
|
||||
}
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
const receiversCloseStartedAt = Date.now();
|
||||
await Promise.all([
|
||||
receiver.close(),
|
||||
new Promise<void>((resolve) => server.close(() => resolve())),
|
||||
]);
|
||||
if (profileCi) {
|
||||
logPerf("shard 6 Preview receivers close", receiversCloseStartedAt);
|
||||
if (assertionsFinishedAt !== undefined) {
|
||||
logPerf(
|
||||
"shard 6 Preview assertions to test body end",
|
||||
assertionsFinishedAt
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -10,26 +10,6 @@ class TimingReporter implements Reporter {
|
||||
}> = [];
|
||||
|
||||
onTestEnd(test: TestCase, result: TestResult) {
|
||||
if (
|
||||
process.env.CI !== undefined &&
|
||||
process.env.E2E_TEST_SHARD === "shard-6" &&
|
||||
test.location.file.endsWith("browser-form-preview.[shard-6].e2e.ts")
|
||||
) {
|
||||
for (const after of result.steps.filter(
|
||||
({ title }) => title === "After Hooks" || title === "Worker Cleanup"
|
||||
)) {
|
||||
console.info(
|
||||
`[e2e:profile] shard 6 Preview ${after.title} duration=${after.duration}ms`
|
||||
);
|
||||
for (const step of after.steps.filter(
|
||||
({ category }) => category === "fixture"
|
||||
)) {
|
||||
console.info(
|
||||
`[e2e:profile] shard 6 Preview ${step.title} duration=${step.duration}ms`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.tests.push({
|
||||
file: relative(process.cwd(), test.location.file),
|
||||
title: test.title,
|
||||
|
||||
Reference in new issue
Block a user