bun test - don't send start events for skipped tests#22896
Conversation
…itted. also don't time skipped tests.
|
Updated 9:23 PM PT - Sep 22nd, 2025
❌ @pfgithub, your commit 7182722 has 2 failures in
🧪 To try this PR locally: bunx bun-pr 22896That installs a local version of the PR into your bun-22896 --bun |
WalkthroughIntroduces early-return guards in onSequenceStarted and onEntryStarted to skip null callbacks, and updates onSequenceCompleted to set elapsed_ns to 0 when the sequence never started; otherwise uses sinceNow(). No exported/public declarations changed. Changes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/bun.js/test/Execution.zig (2)
490-491: Nit: unwrap the nested inline if for readabilitySlightly clearer as a block.
- if (sequence.test_entry) |entry| if (entry.callback == null) return; + if (sequence.test_entry) |entry| { + if (entry.callback == null) return; + }
505-506: Prevent stale timeouts: reset timespec for callback-null entriesIf an entry was previously executed in a prior repeat/run, its timespec could carry over. Explicitly zero it for callback-null entries.
-fn onEntryStarted(_: *Execution, entry: *ExecutionEntry) void { - if (entry.callback == null) return; +fn onEntryStarted(_: *Execution, entry: *ExecutionEntry) void { + if (entry.callback == null) { + entry.timespec = .epoch; + return; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/bun.js/test/Execution.zig(3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/**/*.zig
📄 CodeRabbit inference engine (.cursor/rules/building-bun.mdc)
Implement debug logs in Zig using
const log = bun.Output.scoped(.${SCOPE}, false);and invokinglog("...", .{})
Files:
src/bun.js/test/Execution.zig
**/*.zig
📄 CodeRabbit inference engine (.cursor/rules/javascriptcore-class.mdc)
**/*.zig: Declare the extern C symbol in Zig and export a Zig-friendly alias for use
Wrap the Bun____toJS extern in a Zig method that takes a JSGlobalObject and returns JSC.JSValue
**/*.zig: Format Zig files with zig-format (bun run zig-format)
In Zig, manage memory carefully with allocators and use defer for cleanup
Files:
src/bun.js/test/Execution.zig
src/bun.js/**/*.zig
📄 CodeRabbit inference engine (.cursor/rules/zig-javascriptcore-classes.mdc)
src/bun.js/**/*.zig: In Zig binding structs, expose generated bindings via pub const js = JSC.Codegen.JS and re-export toJS/fromJS/fromJSDirect
Constructors and prototype methods should return bun.JSError!JSC.JSValue to integrate Zig error handling with JS exceptions
Use parameter name globalObject (not ctx) and accept (*JSC.JSGlobalObject, *JSC.CallFrame) in binding methods/constructors
Implement getters as get(this, globalObject) returning JSC.JSValue and matching the .classes.ts interface
Provide deinit() for resource cleanup and finalize() that calls deinit(); use bun.destroy(this) or appropriate destroy pattern
Access JS call data via CallFrame (argument(i), argumentCount(), thisValue()) and throw errors with globalObject.throw(...)
For properties marked cache: true, use the generated Zig accessors (NameSetCached/GetCached) to work with GC-owned values
In finalize() for objects holding JS references, release them using .deref() before destroy
Files:
src/bun.js/test/Execution.zig
🧠 Learnings (1)
📚 Learning: 2025-08-30T00:13:36.815Z
Learnt from: CR
PR: oven-sh/bun#0
File: .cursor/rules/zig-javascriptcore-classes.mdc:0-0
Timestamp: 2025-08-30T00:13:36.815Z
Learning: Applies to src/bun.js/bindings/generated_classes_list.zig : Update src/bun.js/bindings/generated_classes_list.zig to include new classes
Applied to files:
src/bun.js/test/Execution.zig
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Format
🔇 Additional comments (2)
src/bun.js/test/Execution.zig (2)
519-519: Elapsed = 0 when never started — goodThis keeps reporters consistent for skipped/todo/filtered tests and avoids negative/undefined durations.
490-491: Approve: guard prevents start events for skipped tests — verification passedrg output shows reportTestStart is defined in src/bun.js/Debugger.zig and called only from src/bun.js/test/Execution.zig; src/cli/test_command.zig contains an empty handleTestStart stub. No other matches found.
No description provided.