Skip to content

Run JSC stress tests on PRs#243

Open
dylan-conway wants to merge 3 commits into
mainfrom
claude/jsc-tests-ci
Open

Run JSC stress tests on PRs#243
dylan-conway wants to merge 3 commits into
mainfrom
claude/jsc-tests-ci

Conversation

@dylan-conway

Copy link
Copy Markdown
Member

Adds a JSC Tests workflow that runs the upstream run-javascriptcore-tests driver against a release jsc shell on each PR. The existing Preview Build only verifies the tree compiles; this is the first correctness gate.

What it runs

  • Build: PORT=JSCOnly release jsc on linux-x64-gh, clang-21, system ICU, -march=haswell (same flags as the Docker artifact build minus the custom ICU repack)
  • Tests: Tools/Scripts/run-javascriptcore-tests --quick --memory-limited, stress + mozilla + ChakraCore + jsc-layout-tests; native test binaries (testmasm/testair/testb3/testdfg/testapi/testwasmdebugger) skipped so DEVELOPER_MODE=ON isn't needed
  • Output: jsc_results.json artifact + a step summary listing failures

Why --quick
Upstream EWS budgets ~1h for the full release run. --quick keeps default + no-cjit-validate modes only for the stress corpus. We can drop --quick once we know the runner timing.

Verified locally
The Perl→Ruby driver chain runs end-to-end against a locally-built jsc (--root = cmake build dir; executableProductDir() appends /bin on non-Apple). JSON output schema matches what the summary step consumes.

Open questions

  • Baseline: we likely have pre-existing failures vs upstream because of USE_BUN_JSC_ADDITIONS. First green run will establish the expectations file.
  • May want to switch to consuming the existing Preview Build artifact instead of rebuilding once this is stable.

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 52672be6-59b1-4a75-aad9-f9cae2e9b3ce

📥 Commits

Reviewing files that changed from the base of the PR and between b37cdb1 and 2547110.

📒 Files selected for processing (1)
  • .github/workflows/build-reusable.yml

Walkthrough

This PR adds a new jsc-tests job to the reusable GitHub Actions workflow that runs the JavaScriptCore test suite against built artifacts. The job downloads the JSC build, installs test runner dependencies, executes tests in JSCore-only mode with JSON output, uploads results unconditionally, and generates a summarized failure report appended to the workflow step summary.

Changes

JSC Tests Workflow Job

Layer / File(s) Summary
Job definition and matrix configuration
.github/workflows/build-reusable.yml
Introduces jsc-tests job with matrix-driven configuration for the Linux amd64 artifact variant, configured to run after the linux job.
Build artifact download and JSC binary setup
.github/workflows/build-reusable.yml
Performs sparse checkout of test directories, downloads the bun-webkit artifact, extracts it into WebKitBuild layout, copies the JSC binary, and verifies the executable.
Dependency installation and test execution
.github/workflows/build-reusable.yml
Installs ruby, perl, and make dependencies, then executes run-javascriptcore-tests in JSCore-only mode with selected test categories disabled and JSON output enabled.
Results capture, upload, and summary generation
.github/workflows/build-reusable.yml
Uploads test artifacts unconditionally with 14-day retention, parses JSON results with Python to extract stress test failures, and appends a formatted summary to the GitHub step summary.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is comprehensive and well-structured, but does not follow the required WebKit template format (bug reference, Bugzilla link, reviewer, and changelog format are missing). Add a Bugzilla reference at the top, include 'Reviewed by' line, and format the changelog section with file paths and affected functions per the WebKit template.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Run JSC stress tests on PRs' clearly and concisely summarizes the main change: adding a workflow job that runs JSC stress tests during pull request validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/jsc-tests.yml:
- Line 146: The summary string written in the workflow currently says "### JSC
tests (quick)\n\n" but the tests run in full mode; update the out.write call
that writes the summary (the line containing out.write(f"### JSC tests
(quick)\n\n")) to remove "(quick)" so it reads "### JSC tests\n\n" to accurately
reflect the test mode in the workflow.
- Around line 134-152: Wrap the json.load(...) call in a try/except that catches
json.JSONDecodeError (and optionally Exception) to handle malformed
jsc_results.json: on exception, print an error to stderr including the filename
and error message, set r = {} (or stress = []), and proceed to write a summary
message to "${{ runner.temp }}/summary.md" indicating that parsing failed so the
workflow doesn't emit a Python traceback; update references to r and stress in
the block so they are safe when parsing fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 178a0c47-ddb3-4794-8f6e-301e12acbfd6

📥 Commits

Reviewing files that changed from the base of the PR and between 48460d8 and b37cdb1.

📒 Files selected for processing (1)
  • .github/workflows/jsc-tests.yml

Comment thread .github/workflows/jsc-tests.yml Outdated
Comment on lines +134 to +152
python3 - <<'EOF'
import json, sys
with open("jsc_results.json") as f:
r = json.load(f)
stress = r.get("stressTestFailures", [])
print(f"## JSC test summary", file=sys.stderr)
print(f"stress failures: {len(stress)}")
for t in stress[:50]:
print(f" FAIL {t}")
if len(stress) > 50:
print(f" ... and {len(stress)-50} more")
with open("${{ runner.temp }}/summary.md", "w") as out:
out.write(f"### JSC tests (quick)\n\n")
out.write(f"- stress failures: **{len(stress)}**\n")
if stress:
out.write("\n<details><summary>failures</summary>\n\n```\n")
out.write("\n".join(stress[:200]))
out.write("\n```\n</details>\n")
EOF

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add error handling for JSON parsing failures.

The Python script does not handle the case where jsc_results.json exists but contains malformed JSON. Although this is an edge case, wrapping the JSON load in a try/except block would make the summary step more robust and prevent the workflow from showing a Python traceback on parse errors.

🛡️ Proposed fix to add JSON error handling
           python3 - <<'EOF'
 import json, sys
-with open("jsc_results.json") as f:
-    r = json.load(f)
-stress = r.get("stressTestFailures", [])
+try:
+    with open("jsc_results.json") as f:
+        r = json.load(f)
+    stress = r.get("stressTestFailures", [])
+except (json.JSONDecodeError, KeyError, IOError) as e:
+    print(f"## JSC test summary", file=sys.stderr)
+    print(f"Failed to parse results: {e}", file=sys.stderr)
+    sys.exit(0)
 print(f"## JSC test summary", file=sys.stderr)
 print(f"stress failures: {len(stress)}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/jsc-tests.yml around lines 134 - 152, Wrap the
json.load(...) call in a try/except that catches json.JSONDecodeError (and
optionally Exception) to handle malformed jsc_results.json: on exception, print
an error to stderr including the filename and error message, set r = {} (or
stress = []), and proceed to write a summary message to "${{ runner.temp
}}/summary.md" indicating that parsing failed so the workflow doesn't emit a
Python traceback; update references to r and stress in the block so they are
safe when parsing fails.

Comment thread .github/workflows/jsc-tests.yml Outdated
if len(stress) > 50:
print(f" ... and {len(stress)-50} more")
with open("${{ runner.temp }}/summary.md", "w") as out:
out.write(f"### JSC tests (quick)\n\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove "(quick)" from summary title—tests run in full mode.

Line 146 outputs "### JSC tests (quick)\n" but the test command (line 113) does not include the --quick flag, consistent with the file header comment (line 7: "full mode set"). The summary title should reflect that the full test suite is running.

📝 Proposed fix to align summary with actual test mode
-             out.write(f"### JSC tests (quick)\n\n")
+             out.write(f"### JSC tests\n\n")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
out.write(f"### JSC tests (quick)\n\n")
out.write(f"### JSC tests\n\n")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/jsc-tests.yml at line 146, The summary string written in
the workflow currently says "### JSC tests (quick)\n\n" but the tests run in
full mode; update the out.write call that writes the summary (the line
containing out.write(f"### JSC tests (quick)\n\n")) to remove "(quick)" so it
reads "### JSC tests\n\n" to accurately reflect the test mode in the workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant