kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: gateway dev and e2e dev http fixtures
rodzic
c7aa791a9f
commit
58f923b247
|
@ -242,8 +242,6 @@ exports[`HTTP => OpenAPI origin default bypass caching > 2.0: GET @dev/test-ever
|
|||
|
||||
exports[`HTTP => OpenAPI origin everything "echo" tool with empty body > 10.0: POST @dev/test-everything-openapi/echo 1`] = `{}`;
|
||||
|
||||
exports[`HTTP => OpenAPI origin everything "echo" tool with empty body > 10.1: POST @dev/test-everything-openapi/echo 1`] = `{}`;
|
||||
|
||||
exports[`HTTP => OpenAPI origin everything "pure" tool > 8.0: POST @dev/test-everything-openapi/pure 1`] = `
|
||||
{
|
||||
"foo": "bar",
|
||||
|
|
|
@ -83,15 +83,18 @@ for (const [i, fixtureSuite] of fixtureSuites.entries()) {
|
|||
...fixture.request
|
||||
})
|
||||
|
||||
if (res.status !== status && res.status >= 500) {
|
||||
if (
|
||||
res.status !== status &&
|
||||
(res.status >= 500 || status === 200)
|
||||
) {
|
||||
let body: any
|
||||
try {
|
||||
body = await res.json()
|
||||
} catch {}
|
||||
|
||||
console.error(
|
||||
`${repeatIterationPrefix}${fixtureName} => UNEXPECTED ERROR ${res.status}`,
|
||||
body
|
||||
`${repeatIterationPrefix}${fixtureName} => UNEXPECTED ERROR ${res.status} (expected ${status}):`,
|
||||
JSON.stringify(body, null, 2)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -575,6 +575,18 @@ export const fixtureSuites: E2ETestFixtureSuite[] = [
|
|||
method: 'POST'
|
||||
},
|
||||
response: {
|
||||
// 400 because the request body is missing
|
||||
status: 400
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '@dev/test-everything-openapi/disabled_tool',
|
||||
request: {
|
||||
method: 'POST',
|
||||
json: {}
|
||||
},
|
||||
response: {
|
||||
// 404 because the tool is disabled which means its hidden
|
||||
status: 404
|
||||
}
|
||||
}
|
||||
|
@ -584,15 +596,6 @@ export const fixtureSuites: E2ETestFixtureSuite[] = [
|
|||
title: 'HTTP => OpenAPI origin everything "echo" tool with empty body',
|
||||
compareResponseBodies: true,
|
||||
fixtures: [
|
||||
{
|
||||
path: '@dev/test-everything-openapi/echo',
|
||||
request: {
|
||||
method: 'POST'
|
||||
},
|
||||
response: {
|
||||
body: {}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '@dev/test-everything-openapi/echo',
|
||||
request: {
|
||||
|
|
|
@ -24,39 +24,32 @@
|
|||
}
|
||||
],
|
||||
"vars": {
|
||||
"ENVIRONMENT": "production",
|
||||
"AGENTIC_API_BASE_URL": "https://api.agentic.so"
|
||||
"ENVIRONMENT": "development",
|
||||
"AGENTIC_API_BASE_URL": "http://localhost:3001"
|
||||
},
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{
|
||||
"class_name": "DurableRateLimiter",
|
||||
"name": "DO_RATE_LIMITER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpServer",
|
||||
"name": "DO_MCP_SERVER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpClient",
|
||||
"name": "DO_MCP_CLIENT"
|
||||
}
|
||||
]
|
||||
},
|
||||
"analytics_engine_datasets": [
|
||||
{
|
||||
"binding": "AE_USAGE_DATASET",
|
||||
"dataset": "agentic_gateway_usage"
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"development": {
|
||||
"vars": {
|
||||
"ENVIRONMENT": "development",
|
||||
"AGENTIC_API_BASE_URL": "http://localhost:3001"
|
||||
},
|
||||
// TODO: double-check whether all of this needs to be duplicated for each environment
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{
|
||||
"class_name": "DurableRateLimiter",
|
||||
"name": "DO_RATE_LIMITER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpServer",
|
||||
"name": "DO_MCP_SERVER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpClient",
|
||||
"name": "DO_MCP_CLIENT"
|
||||
}
|
||||
]
|
||||
},
|
||||
"analytics_engine_datasets": [
|
||||
{
|
||||
"binding": "AE_USAGE_DATASET",
|
||||
"dataset": "agentic_gateway_usage"
|
||||
}
|
||||
]
|
||||
},
|
||||
"production": {
|
||||
"routes": [
|
||||
{
|
||||
|
@ -68,6 +61,7 @@
|
|||
"ENVIRONMENT": "production",
|
||||
"AGENTIC_API_BASE_URL": "https://api.agentic.so"
|
||||
},
|
||||
// TODO: double-check whether all of this needs to be duplicated for each environment
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "turbo build --filter=!web --concurrency=32",
|
||||
"dev": "turbo dev --continue --filter=!./examples/*",
|
||||
"dev": "turbo dev --continue --filter=!./examples/**/*",
|
||||
"docs": "turbo run docs",
|
||||
"clean": "turbo clean",
|
||||
"fix": "run-s fix:*",
|
||||
|
|
Ładowanie…
Reference in New Issue