Skip to content

Commit

Permalink
Add tools/server for server under ts-node, and update help (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x authored Nov 17, 2023
1 parent c25f9a5 commit 8ee974a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/common/runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import sys from './helper/sys.js';

function usage(rc: number): never {
console.log(`Usage:
tools/run_${sys.type} [OPTIONS...]
tools/server [OPTIONS...]
Options:
--colors Enable ANSI colors in output.
--compat Run tests in compatibility mode.
Expand All @@ -33,8 +33,10 @@ Options:
--u Flag to set on the gpu-provider as <flag>=<value>
Provides an HTTP server used for running tests via an HTTP RPC interface
To run a test, perform an HTTP GET or POST at the URL:
http://localhost:port/run?<test-name>
First, load some tree or subtree of tests:
http://localhost:port/load?unittests:basic:*
To run a single test case, perform an HTTP GET or POST at the URL:
http://localhost:port/run?unittests:basic:test,sync
To shutdown the server perform an HTTP GET or POST at the URL:
http://localhost:port/terminate
`);
Expand Down
6 changes: 6 additions & 0 deletions tools/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env node

// Launch a server that runs tests server-side on demand.

require('../src/common/tools/setup-ts-in-node.js');
require('../src/common/runtime/server.ts');

0 comments on commit 8ee974a

Please sign in to comment.