Skip to content

Commit e75af80

Browse files
committed
Include e2e tests for hono and vite
1 parent 4512937 commit e75af80

File tree

6 files changed

+41
-4
lines changed

6 files changed

+41
-4
lines changed

scripts/create-test-matrix.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const DEV_TEST_CONFIGS = {
3636
apiFilePath: 'src/main.ts',
3737
apiFileImportPath: '..',
3838
},
39+
hono: {
40+
generatedStepPath: '.nitro/workflow/steps.mjs',
41+
generatedWorkflowPath: '.nitro/workflow/workflows.mjs',
42+
apiFilePath: 'server.ts',
43+
apiFileImportPath: '.',
44+
},
3945
};
4046

4147
const matrix = {
@@ -81,4 +87,16 @@ matrix.app.push({
8187
...DEV_TEST_CONFIGS.nuxt,
8288
});
8389

90+
matrix.app.push({
91+
name: 'hono',
92+
project: 'workbench-hono-workflow',
93+
...DEV_TEST_CONFIGS.hono,
94+
});
95+
96+
matrix.app.push({
97+
name: 'vite',
98+
project: 'workbench-vite-workflow',
99+
...DEV_TEST_CONFIGS.vite,
100+
});
101+
84102
console.log(JSON.stringify(matrix));

workbench/hono/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"predev": "pnpm generate:workflows",
1010
"prebuild": "pnpm generate:workflows",
1111
"dev": "nitro dev",
12-
"build": "nitro build"
12+
"build": "nitro build",
13+
"start": "node .output/server/index.mjs"
1314
},
1415
"devDependencies": {
1516
"workflow": "workspace:*",

workbench/hono/server.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Hono } from 'hono';
22
import { getHookByToken, getRun, resumeHook, start } from 'workflow/api';
33
import { hydrateWorkflowArguments } from 'workflow/internal/serialization';
44
import { allWorkflows } from './_workflows.js';
5+
import { add } from './workflows/99_e2e.js';
56

67
const app = new Hono();
78

@@ -124,6 +125,7 @@ app.get('/api/trigger', async ({ req }) => {
124125
...error,
125126
name: error.name,
126127
message: error.message,
128+
stack: error.stack,
127129
},
128130
{ status: 400 }
129131
);
@@ -166,4 +168,18 @@ app.post('/api/hook', async ({ req }) => {
166168
return Response.json(hook);
167169
});
168170

171+
// Test route for calling step functions directly outside workflow context
172+
app.post('/api/test-direct-step-call', async ({ req }) => {
173+
const body = await req.json();
174+
const { x, y } = body;
175+
176+
console.log(`Calling step function directly with x=${x}, y=${y}`);
177+
178+
// Call step function directly as a regular async function (no workflow context)
179+
const result = await add(x, y);
180+
console.log(`add(${x}, ${y}) = ${result}`);
181+
182+
return Response.json({ result });
183+
});
184+
169185
export default app;

workbench/nitro-v2/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"predev": "pnpm generate:workflows",
1010
"prebuild": "pnpm generate:workflows",
1111
"dev": "nitro dev",
12-
"build": "nitro build"
12+
"build": "nitro build",
13+
"start": "node .output/server/index.mjs"
1314
},
1415
"devDependencies": {
1516
"@types/node": "catalog:",

workbench/nuxt/workflows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../nitro-v2/workflows
1+
../nitro-v3/workflows

workbench/vite/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"predev": "pnpm generate:workflows",
1010
"prebuild": "pnpm generate:workflows",
1111
"dev": "vite dev",
12-
"build": "vite build"
12+
"build": "vite build",
13+
"start": "node .output/server/index.mjs"
1314
},
1415
"devDependencies": {
1516
"ai": "catalog:",

0 commit comments

Comments
 (0)