Return an empty TestSuite if mainSuite is null#1040
Open
caherrera wants to merge 2 commits intoparatestphp:6.xfrom
Open
Return an empty TestSuite if mainSuite is null#1040caherrera wants to merge 2 commits intoparatestphp:6.xfrom
caherrera wants to merge 2 commits intoparatestphp:6.xfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves error handling in the LogInterpreter class by replacing an assertion with graceful null handling. When no test suites are available to merge, the method now returns an empty TestSuite instead of failing with an assertion error.
- Replaced assertion with null check for better error handling
- Returns an empty
TestSuitewhen$mainSuiteis null
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Slamdunk
requested changes
Oct 20, 2025
Member
Slamdunk
left a comment
There was a problem hiding this comment.
Hello, in the issue you wrote:
ParaTest should not throw a fatal error when running against a test file that contains zero tests. It should generate a valid, possibly empty, JUnit XML report file (results.xml) and exit gracefully.
Could you please add a test to ensure this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes a small but important change to the
mergeReadersmethod inLogInterpreter.php. The method now handles the case where$mainSuiteisnullby returning an emptyTestSuiteinstance instead of asserting its existence. This improves the robustness of the code by preventing potential errors when no test suites are available.mergeReadersinLogInterpreter.phpto return an emptyTestSuiteif$mainSuiteisnull, instead of asserting, to handle edge cases more gracefully.