Conversation
8d7ad48 to
63d202a
Compare
This comment has been minimized.
This comment has been minimized.
63d202a to
ecfaf35
Compare
This comment has been minimized.
This comment has been minimized.
Add .github/scripts/js_examples/run.py. It runs the JS SDK's example tests against the testing package's local runner, and exits non-zero on any failure. It uses a JS SDK checkout from --js-dir or JS_SDK_DIR, or clones JS main. Run it with hatch run dev-testing:js-examples. run.py serves WebRunner in a child process, so each server session starts with no runner state. A small proxy on a thread turns the tests' Lambda Invoke into POST /start-durable-execution. The Lambda shim runs each function on reusable worker threads. When an invocation passes the function's Timeout, the shim terminates the worker, as Lambda does. step/interrupted-no-retry depends on this. The js-examples workflow runs the harness on changes to the testing package. All 121 test files with cloud tests pass in about 2.5 minutes on 4 CPUs.
ecfaf35 to
043d3de
Compare
| durable = props.get("DurableConfig") | ||
| function_configs[function_name] = ( | ||
| {"DurableConfig": dict(durable)} if durable else {} | ||
| ) |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_2q3t5r6bt6vqonbfkuf3wraohv
[P2] Preserve an empty DurableConfig as durable
The runner treats {"DurableConfig": {}} as a durable target with default timeout and retention, but this truthiness check emits {} and classifies it as plain. A chained invoke then runs it as a one-shot Lambda invocation instead of a child durable execution. Check for None or key presence and add an empty-config test.
| durable = props.get("DurableConfig") | |
| function_configs[function_name] = ( | |
| {"DurableConfig": dict(durable)} if durable else {} | |
| ) | |
| durable = props.get("DurableConfig") | |
| function_configs[function_name] = ( | |
| {"DurableConfig": dict(durable)} if durable is not None else {} | |
| ) |
| "FunctionName": function_name, | ||
| "FunctionQualifier": "$LATEST", |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_l56oh7o542gv5lkojghfxre2xz
[P2] Split qualified identifiers before starting the runner
For name:7 or a function ARN, this stores the entire identifier as FunctionName and hard-codes $LATEST. The runner expects the bare name and qualifier separately, so execution details report malformed ARNs and the wrong version even though the shim happens to find the handler. Parse path and query qualifiers into separate fields and assert the complete start payload in the proxy tests.
| functionName, | ||
| // An alias names no version the shim knows, so only a numeric | ||
| // qualifier is reported as the version. | ||
| functionVersion: /^\d+$/.test(qualifier ?? "") ? qualifier : "$LATEST", |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_dijv4e2didn4fvufp3ensmydyy
[P2] Report $LATEST.PUBLISHED as the executed version
The testing runner explicitly preserves $LATEST.PUBLISHED as an executed version, but the shim maps every nonnumeric qualifier to $LATEST. Handlers invoked with this supported qualifier therefore observe a context inconsistent with the runner's execution details. Preserve this special qualifier and add it to the qualified-identifier tests.
| functionVersion: /^\d+$/.test(qualifier ?? "") ? qualifier : "$LATEST", | |
| functionVersion: | |
| qualifier === "$LATEST.PUBLISHED" || /^\d+$/.test(qualifier ?? "") | |
| ? qualifier | |
| : "$LATEST", |
| for directory in old: | ||
| shutil.rmtree(directory, ignore_errors=True) |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_airpqn5cq3y57oztz6av4w7kyf
[P3] Do not prune output directories that are still active
OUT_MARKER is created when a run starts, so an active directory becomes eligible for deletion here. Once ten newer runs start across other JS checkouts, this can remove the older run's logs, maps, and Jest output while they are still in use. Track completion or hold a per-run lock and prune only completed or unlocked directories, with a concurrent-pruning test.
Codex AI reviewFour actionable correctness issues remain, primarily around durable-target classification and qualified invocation semantics. Reviewed commit |
Adds
.github/scripts/js_examples/run.py, which runs the JS SDK's example tests against the local runner in the testing package. No AWS account is involved; everything runs on the loopback.run.pyuses a JS SDK checkout from--js-dirorJS_SDK_DIR, or clones JSmain. It builds the examples, starts the servers, runs jest, and exits non-zero on any failure. It refuses to run unless its interpreter has this checkout's testing package.lambda-shim.cjshosts the built JS handlers, as the Lambda runtime does. It runs each function on reusable worker threads. When an invocation passes the function'sTimeout, it returnsSandbox.Timedoutand terminates the worker.step/interrupted-no-retrydepends on this.run.pyservesWebRunnerin a child process (multiprocessing), so each server session starts with no runner state.invoke_proxy.py, on a thread, turns the LambdaInvokecall the JS tests use to start an execution into the runner'sPOST /start-durable-execution, and forwards everything else unchanged..github/workflows/js-examples.ymlruns the harness on PRs and pushes that touch the testing package. A manual run can choose another JS branch, tag or commit withjs_ref. The harness unit tests run intest-parser.yml.Locally and in CI: 121 of 121 test files with cloud tests pass in about 2.5 minutes on 4 CPUs. Usage is in
.github/scripts/js_examples/README.md.Canary: #746 dropped the chained-invoke result in the runner, and its run failed on
invoke/simpleas expected (run).