@tokenoftrust/storefront-runner 2.4.7 → 2.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/storefront/package.json +1 -1
- package/apps/storefront/test/pipeline/fake-preview-services.ts +25 -9
- package/apps/storefront/test/pipeline/harness.ts +2 -1
- package/apps/storefront/test/pipeline/matrix-faults.ts +344 -0
- package/apps/storefront/test/pipeline/pipeline-host.ts +173 -8
- package/apps/storefront/test/pipeline/pool-config.cjs +78 -0
- package/apps/storefront/test/pipeline/publish-kinds.ts +109 -27
- package/apps/storefront/test/pipeline-faults/matrix-lib.ts +661 -0
- package/apps/storefront/vitest.faults.config.cts +13 -0
- package/apps/storefront/vitest.workers.config.cts +5 -67
- package/package.json +1 -1
|
@@ -1,69 +1,7 @@
|
|
|
1
|
-
// The pipeline harness
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// The object lives in its own Worker, `pipeline-host`, not in the test runner's isolate: an
|
|
6
|
-
// eviction must restart the object without touching its callers, as in production. Auxiliary
|
|
7
|
-
// Workers take plain modules, so the host is bundled here, in memory, with esbuild.
|
|
8
|
-
// .cts for the same reason as vitest.config.cts: compiled in memory, no sibling file written.
|
|
1
|
+
// The hand-written pipeline harness tests (test/pipeline/), inside workerd — see
|
|
2
|
+
// test/pipeline/pool-config.cjs. .cts for the same reason as vitest.config.cts: compiled in memory,
|
|
3
|
+
// no sibling file written.
|
|
9
4
|
process.env.VITE_CJS_IGNORE_WARNING = "1";
|
|
10
|
-
const {
|
|
11
|
-
const esbuild = require("esbuild");
|
|
12
|
-
const path = require("node:path");
|
|
5
|
+
const { pipelinePoolConfig } = require("./test/pipeline/pool-config.cjs");
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
const compatibilityFlags = ["nodejs_compat"];
|
|
16
|
-
const HOST = "pipeline-host";
|
|
17
|
-
|
|
18
|
-
const hostModule = esbuild.buildSync({
|
|
19
|
-
entryPoints: [path.join(__dirname, "test/pipeline/pipeline-host.ts")],
|
|
20
|
-
bundle: true,
|
|
21
|
-
format: "esm",
|
|
22
|
-
platform: "neutral",
|
|
23
|
-
target: "es2022",
|
|
24
|
-
external: ["cloudflare:*"],
|
|
25
|
-
write: false,
|
|
26
|
-
}).outputFiles[0].text;
|
|
27
|
-
|
|
28
|
-
const pipelineBinding = { TENANT_PIPELINE: { className: "TenantPipeline", scriptName: HOST } };
|
|
29
|
-
|
|
30
|
-
module.exports = defineWorkersConfig({
|
|
31
|
-
// The source tree's `@/` import alias (tsconfig `paths`), for modules the tests import directly.
|
|
32
|
-
resolve: { alias: { "@": path.join(__dirname, "src") } },
|
|
33
|
-
test: {
|
|
34
|
-
name: "pipeline",
|
|
35
|
-
include: ["test/pipeline/**/*.test.ts"],
|
|
36
|
-
cache: false,
|
|
37
|
-
testTimeout: 60_000,
|
|
38
|
-
hookTimeout: 60_000,
|
|
39
|
-
poolOptions: {
|
|
40
|
-
workers: {
|
|
41
|
-
isolatedStorage: false,
|
|
42
|
-
singleWorker: true,
|
|
43
|
-
miniflare: {
|
|
44
|
-
compatibilityDate,
|
|
45
|
-
compatibilityFlags,
|
|
46
|
-
durableObjects: pipelineBinding,
|
|
47
|
-
serviceBindings: { PIPELINE_HOST: HOST, INTAKE_B: "pipeline-intake-b" },
|
|
48
|
-
workers: [
|
|
49
|
-
{
|
|
50
|
-
name: HOST,
|
|
51
|
-
modules: [{ type: "ESModule", path: "pipeline-host.mjs", contents: hostModule }],
|
|
52
|
-
compatibilityDate,
|
|
53
|
-
compatibilityFlags,
|
|
54
|
-
durableObjects: { TENANT_PIPELINE: { className: "TenantPipeline", useSQLite: true } },
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "pipeline-intake-b",
|
|
58
|
-
modules: true,
|
|
59
|
-
scriptPath: path.join(__dirname, "test/pipeline/intake-worker.mjs"),
|
|
60
|
-
compatibilityDate,
|
|
61
|
-
compatibilityFlags,
|
|
62
|
-
durableObjects: pipelineBinding,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
});
|
|
7
|
+
module.exports = pipelinePoolConfig({ root: __dirname, name: "pipeline", include: ["test/pipeline/**/*.test.ts"] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.9",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|