Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix run-rerun command displaying "OK | 0 passed" when tests fail #5193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Copilot wants to merge 4 commits into 3.x from copilot/fix-7609953f-c3e0-4bc9-b74d-21c6b21bd73c

Conversation

Copy link
Contributor

@Copilot Copilot AI commented Sep 18, 2025
edited
Loading

Problem

The run-rerun command could display misleading output like "OK | 0 passed" even when tests actually failed. This occurred because the event.all.result event was being emitted with incorrect data, causing listeners to receive empty or invalid result information.

Root Cause

In lib/rerun.js, the final event.all.result emission was passing the rerunner instance (this) instead of the actual result object (container.result()):

// Before - incorrect
event.emit(event.all.result, this)
// After - correct 
event.emit(event.all.result, container.result())

This inconsistency with the regular run command (which correctly emits container.result()) meant that event listeners expecting result data would receive the wrong object type.

Solution

Changed the event emission in the rerun's run() method to emit the proper result object, ensuring consistency with other commands and accurate result reporting.

Testing

  • Added test case to verify the fix prevents "OK | 0 passed" output when tests fail
  • Confirmed all existing unit and runner tests still pass
  • Validated that individual test run results are displayed correctly during rerun operations

Impact

This fix ensures that users get accurate result summaries from the run-rerun command, preventing confusion when tests fail but appear to show successful results.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.168/linux64/chrome-headless-shell-linux64.zip
    • Triggering command: node install.mjs (http block)
  • https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.168/linux64/chrome-linux64.zip
    • Triggering command: node install.mjs (http block)
  • jsonplaceholder.typicode.com
    • Triggering command: node /home/REDACTED/work/CodeceptJS/CodeceptJS/node_modules/.bin/mocha test/unit --recursive --timeout 10000 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits September 18, 2025 14:57
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
@Copilot Copilot AI changed the title (削除) [WIP] I run one test using codeceptjs run, test failed but got OK | 0 passed in the output. (削除ここまで) (追記) Fix run-rerun command displaying "OK | 0 passed" when tests fail (追記ここまで) Sep 18, 2025
@kobenguyent kobenguyent deleted the copilot/fix-7609953f-c3e0-4bc9-b74d-21c6b21bd73c branch September 18, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kobenguyent kobenguyent Awaiting requested review from kobenguyent

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /