mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 21:30:21 +00:00
Tests: fix stale expectations and weak token generation
This commit is contained in:
@@ -92,43 +92,34 @@ describe("docker build cache layout", () => {
|
||||
it("copies only install inputs before pnpm install in the e2e image", async () => {
|
||||
const dockerfile = await readRepoFile("scripts/e2e/Dockerfile");
|
||||
const installIndex = dockerfile.indexOf("pnpm install --frozen-lockfile");
|
||||
const expectPatternBeforeInstall = (pattern: RegExp) => {
|
||||
const index = indexOfPattern(dockerfile, pattern);
|
||||
expect(index).toBeGreaterThan(-1);
|
||||
expect(index).toBeLessThan(installIndex);
|
||||
};
|
||||
const expectPatternAfterInstall = (pattern: RegExp) => {
|
||||
const index = indexOfPattern(dockerfile, pattern);
|
||||
expect(index).toBeGreaterThan(installIndex);
|
||||
};
|
||||
|
||||
expect(
|
||||
indexOfPattern(
|
||||
dockerfile,
|
||||
/^COPY(?:\s+--chown=\S+)?\s+package\.json pnpm-lock\.yaml pnpm-workspace\.yaml \.npmrc \.\/$/m,
|
||||
),
|
||||
).toBeLessThan(installIndex);
|
||||
expect(
|
||||
indexOfPattern(
|
||||
dockerfile,
|
||||
/^COPY(?:\s+--chown=\S+)?\s+ui\/package\.json \.\/ui\/package\.json$/m,
|
||||
),
|
||||
).toBeLessThan(installIndex);
|
||||
expect(
|
||||
indexOfPattern(
|
||||
dockerfile,
|
||||
/^COPY(?:\s+--chown=\S+)?\s+extensions\/memory-core\/package\.json \.\/extensions\/memory-core\/package\.json$/m,
|
||||
),
|
||||
).toBeLessThan(installIndex);
|
||||
expect(
|
||||
indexOfPattern(
|
||||
dockerfile,
|
||||
/^COPY(?:\s+--chown=\S+)?\s+tsconfig\.json tsconfig\.plugin-sdk\.dts\.json tsdown\.config\.ts vitest\.config\.ts vitest\.e2e\.config\.ts vitest\.performance-config\.ts vitest\.shared\.config\.ts vitest\.bundled-plugin-paths\.ts openclaw\.mjs \.\/$/m,
|
||||
),
|
||||
).toBeGreaterThan(installIndex);
|
||||
expect(indexOfPattern(dockerfile, /^COPY(?:\s+--chown=\S+)?\s+src \.\/src$/m)).toBeGreaterThan(
|
||||
installIndex,
|
||||
expectPatternBeforeInstall(
|
||||
/^COPY(?:\s+--chown=\S+)?\s+package\.json pnpm-lock\.yaml pnpm-workspace\.yaml \.npmrc \.\/$/m,
|
||||
);
|
||||
expect(
|
||||
indexOfPattern(dockerfile, /^COPY(?:\s+--chown=\S+)?\s+test \.\/test$/m),
|
||||
).toBeGreaterThan(installIndex);
|
||||
expect(
|
||||
indexOfPattern(dockerfile, /^COPY(?:\s+--chown=\S+)?\s+scripts \.\/scripts$/m),
|
||||
).toBeGreaterThan(installIndex);
|
||||
expect(indexOfPattern(dockerfile, /^COPY(?:\s+--chown=\S+)?\s+ui \.\/ui$/m)).toBeGreaterThan(
|
||||
installIndex,
|
||||
expectPatternBeforeInstall(
|
||||
/^COPY(?:\s+--chown=\S+)?\s+ui\/package\.json \.\/ui\/package\.json$/m,
|
||||
);
|
||||
expectPatternBeforeInstall(/^COPY(?:\s+--chown=\S+)?\s+extensions \.\/extensions$/m);
|
||||
expectPatternBeforeInstall(/^COPY(?:\s+--chown=\S+)?\s+patches \.\/patches$/m);
|
||||
expectPatternBeforeInstall(
|
||||
/^COPY(?:\s+--chown=\S+)?\s+scripts\/postinstall-bundled-plugins\.mjs scripts\/npm-runner\.mjs \.\/scripts\/$/m,
|
||||
);
|
||||
expectPatternAfterInstall(
|
||||
/^COPY(?:\s+--chown=\S+)?\s+tsconfig\.json tsconfig\.plugin-sdk\.dts\.json tsdown\.config\.ts vitest\.config\.ts vitest\.e2e\.config\.ts vitest\.performance-config\.ts vitest\.shared\.config\.ts vitest\.system-load\.ts vitest\.bundled-plugin-paths\.ts openclaw\.mjs \.\/$/m,
|
||||
);
|
||||
expectPatternAfterInstall(/^COPY(?:\s+--chown=\S+)?\s+src \.\/src$/m);
|
||||
expectPatternAfterInstall(/^COPY(?:\s+--chown=\S+)?\s+test \.\/test$/m);
|
||||
expectPatternAfterInstall(/^COPY(?:\s+--chown=\S+)?\s+scripts \.\/scripts$/m);
|
||||
expectPatternAfterInstall(/^COPY(?:\s+--chown=\S+)?\s+ui \.\/ui$/m);
|
||||
});
|
||||
|
||||
it("copies manifests before install in the qr-import image", async () => {
|
||||
|
||||
Reference in New Issue
Block a user