Add tools/server for server under ts-node, and update help (#3179)

This commit is contained in:
Kai Ninomiya 2023-11-17 15:57:04 -08:00 committed by GitHub
parent c25f9a5cc3
commit 8ee974a9d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -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.
@ -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
`);

6
tools/server Executable file
View file

@ -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');