From a66c58343705f0c0881065b82664d4377d3d1297 Mon Sep 17 00:00:00 2001 From: heyitsaamir Date: Tue, 24 Mar 2026 23:48:23 -0700 Subject: [PATCH 1/3] Add e2e test spec for echo bot and repo-wide e2e instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These two markdown files are all a human needs to write — the e2e testing skill generates and manages the actual Playwright test code from here. Co-Authored-By: Claude Opus 4.6 (1M context) --- e2e-instructions.md | 9 +++++++++ examples/echo/e2e.spec.md | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 e2e-instructions.md create mode 100644 examples/echo/e2e.spec.md diff --git a/e2e-instructions.md b/e2e-instructions.md new file mode 100644 index 000000000..b4f161009 --- /dev/null +++ b/e2e-instructions.md @@ -0,0 +1,9 @@ +# E2E Instructions + +## Environment +- env: `e2e-test/.env` +- devtunnel: `devtunnel host $DEVTUNNEL_NAME` + +## Bot Start +- command: `DOTENV_CONFIG_PATH=../../e2e-test/.env npm run dev` +- ready: `listening on port` diff --git a/examples/echo/e2e.spec.md b/examples/echo/e2e.spec.md new file mode 100644 index 000000000..0962945d0 --- /dev/null +++ b/examples/echo/e2e.spec.md @@ -0,0 +1,12 @@ +# Echo Bot E2E Tests + +## Tests + +- act: send "Hello there" + assert: bot replies with 'you said "Hello there"' + +- act: send "Testing 123" + assert: bot replies with 'you said "Testing 123"' + +- act: send "🎉" + assert: bot replies with 'you said "🎉"' From 0a7e5b058240b9ee5494f84488c7ec8a6f5f8f07 Mon Sep 17 00:00:00 2001 From: heyitsaamir Date: Thu, 26 Mar 2026 11:02:18 -0700 Subject: [PATCH 2/3] Fix HttpServer breaking Azure App Service named pipe ports (#487) Remove parseInt coercion in HttpServer.start() that converted named pipe paths (e.g. \\.\pipe\...) to NaN on Azure App Service. Pass port through as-is since Node's http.Server.listen() natively handles both numbers and pipe strings. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/apps/src/http/adapter.ts | 2 +- packages/apps/src/http/express-adapter.ts | 2 +- packages/apps/src/http/http-server.spec.ts | 14 +++++++++++--- packages/apps/src/http/http-server.ts | 3 +-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/apps/src/http/adapter.ts b/packages/apps/src/http/adapter.ts index 1730c8f23..82efaa866 100644 --- a/packages/apps/src/http/adapter.ts +++ b/packages/apps/src/http/adapter.ts @@ -44,7 +44,7 @@ export interface IHttpServerAdapter { * Not needed if app.start() is not called * @param port Port number to listen on */ - start?(port: number): Promise; + start?(port: number | string): Promise; /** * Stop the server from listening and perform any cleanup that needs to be done diff --git a/packages/apps/src/http/express-adapter.ts b/packages/apps/src/http/express-adapter.ts index a68dfe2f3..39785e217 100644 --- a/packages/apps/src/http/express-adapter.ts +++ b/packages/apps/src/http/express-adapter.ts @@ -78,7 +78,7 @@ export class ExpressAdapter implements IHttpServerAdapter { /** * Start the server listening on the specified port */ - async start(port: number): Promise { + async start(port: number | string): Promise { return new Promise((resolve, reject) => { // Handle startup errors this.server.once('error', (err) => { diff --git a/packages/apps/src/http/http-server.spec.ts b/packages/apps/src/http/http-server.spec.ts index dafdfd2aa..e1b6203ca 100644 --- a/packages/apps/src/http/http-server.spec.ts +++ b/packages/apps/src/http/http-server.spec.ts @@ -10,7 +10,7 @@ class MockAdapter implements IHttpServerAdapter { this.routes.push({ method, path, handler }); } - async start(_port: number): Promise { + async start(_port: number | string): Promise { this.started = true; } @@ -151,12 +151,20 @@ describe('HttpServer', () => { expect(adapter.started).toBe(true); }); - it('should parse string port to number', async () => { + it('should pass string port through to adapter', async () => { const startSpy = jest.spyOn(adapter, 'start'); await server.start('4000'); - expect(startSpy).toHaveBeenCalledWith(4000); + expect(startSpy).toHaveBeenCalledWith('4000'); + }); + + it('should pass named pipe path through to adapter', async () => { + const startSpy = jest.spyOn(adapter, 'start'); + + await server.start('\\\\.\\pipe\\507cb72a-6765-4f1e-a9f0-1234abcd5678'); + + expect(startSpy).toHaveBeenCalledWith('\\\\.\\pipe\\507cb72a-6765-4f1e-a9f0-1234abcd5678'); }); it('should throw when adapter does not implement start', async () => { diff --git a/packages/apps/src/http/http-server.ts b/packages/apps/src/http/http-server.ts index 4b1cbc441..f0810f1f8 100644 --- a/packages/apps/src/http/http-server.ts +++ b/packages/apps/src/http/http-server.ts @@ -112,14 +112,13 @@ export class HttpServer implements IHttpServer { * Called by App.start() */ async start(port: number | string) { - const portNumber = typeof port === 'string' ? parseInt(port, 10) : port; if (!this._adapter.start) { throw new Error( 'Adapter does not implement start(). ' + 'Either implement start() in your adapter, or manage server lifecycle manually.' ); } - await this._adapter.start(portNumber); + await this._adapter.start(port); } /** From 24885ec4a0d9797985f16d599a34815e7efe6203 Mon Sep 17 00:00:00 2001 From: heyitsaamir Date: Thu, 26 Mar 2026 11:11:04 -0700 Subject: [PATCH 3/3] Remove e2e test spec and instructions files Co-Authored-By: Claude Opus 4.6 (1M context) --- e2e-instructions.md | 9 --------- examples/echo/e2e.spec.md | 12 ------------ 2 files changed, 21 deletions(-) delete mode 100644 e2e-instructions.md delete mode 100644 examples/echo/e2e.spec.md diff --git a/e2e-instructions.md b/e2e-instructions.md deleted file mode 100644 index b4f161009..000000000 --- a/e2e-instructions.md +++ /dev/null @@ -1,9 +0,0 @@ -# E2E Instructions - -## Environment -- env: `e2e-test/.env` -- devtunnel: `devtunnel host $DEVTUNNEL_NAME` - -## Bot Start -- command: `DOTENV_CONFIG_PATH=../../e2e-test/.env npm run dev` -- ready: `listening on port` diff --git a/examples/echo/e2e.spec.md b/examples/echo/e2e.spec.md deleted file mode 100644 index 0962945d0..000000000 --- a/examples/echo/e2e.spec.md +++ /dev/null @@ -1,12 +0,0 @@ -# Echo Bot E2E Tests - -## Tests - -- act: send "Hello there" - assert: bot replies with 'you said "Hello there"' - -- act: send "Testing 123" - assert: bot replies with 'you said "Testing 123"' - -- act: send "🎉" - assert: bot replies with 'you said "🎉"'