Skip to content

Commit 9dcfafd

Browse files
committed
test: add foreign endpoint parity suite
1 parent 7de6cb9 commit 9dcfafd

5 files changed

Lines changed: 472 additions & 0 deletions

File tree

.github/rulesets/required-ci-domains.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
{ "context": "Correctness / Module API Host Startup" },
9090
{ "context": "Correctness / Module Bundled Outputs" },
9191
{ "context": "Correctness / Module External Lifecycle" },
92+
{ "context": "Correctness / Module Foreign Runtime" },
9293
{ "context": "Correctness / Module Harness Integration" },
9394
{ "context": "Correctness / Module Harness Cost And Matrix" },
9495
{ "context": "Correctness / Module Contracts Architecture" },

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ jobs:
174174
filter: 'FullyQualifiedName~SharpClaw.Tests.Modules.BundledModuleOutputTests'
175175
- domain: Module External Lifecycle
176176
filter: 'FullyQualifiedName~SharpClaw.Tests.Modules.SyntheticExternalModuleLifecycleTests'
177+
- domain: Module Foreign Runtime
178+
filter: 'FullyQualifiedName~SharpClaw.Tests.Modules.ForeignModule|FullyQualifiedName~SharpClaw.Tests.Modules.JavaScriptModuleSdkTests|FullyQualifiedName~SharpClaw.Tests.Modules.PythonModuleSdkTests'
177179
- domain: Module Harness Integration
178180
filter: 'FullyQualifiedName~ModuleRegistersDynamicProvidersToolsHeaderTagsAndCostFeed|FullyQualifiedName~ProviderCaptureRedactsSecretsButKeepsAssertablePromptShape'
179181
- domain: Module Harness Cost And Matrix

SharpClaw.Tests.ForeignSidecar/Program.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ async Task HandleAsync(TcpClient client)
113113
routePattern = "/modules/sample/echo",
114114
responseMode = "json",
115115
},
116+
new
117+
{
118+
method = "GET",
119+
routePattern = "/modules/sample/static/hello.txt",
120+
responseMode = "static",
121+
},
122+
new
123+
{
124+
method = "GET",
125+
routePattern = "/modules/sample/stream",
126+
responseMode = "stream",
127+
},
116128
},
117129
tools = new[]
118130
{
@@ -255,6 +267,23 @@ await WriteNdjsonAsync(
255267
});
256268
break;
257269

270+
case "/modules/sample/static/hello.txt":
271+
await WriteTextAsync(
272+
stream,
273+
200,
274+
"OK",
275+
"static-parity-asset",
276+
"text/plain");
277+
break;
278+
279+
case "/modules/sample/stream":
280+
await WriteNdjsonAsync(
281+
stream,
282+
new { delta = "first:" },
283+
new { delta = "second" },
284+
new { isFinal = true });
285+
break;
286+
258287
default:
259288
await WriteTextAsync(stream, 404, "Not Found", "not found", "text/plain");
260289
break;

0 commit comments

Comments
 (0)