Stabilize descending threaded-comments integration assertions#421
Merged
Conversation
Closed
Agent-Logs-Url: https://github.com/wp-net/WordPressPCL/sessions/a71830fa-e874-4fe6-ab7c-1ecb616d4c79 Co-authored-by: ThomasPe <4225039+ThomasPe@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix integration tests
Stabilize descending threaded-comments integration assertions
Apr 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Stabilizes the self-hosted integration test coverage for threaded comments in descending order by ensuring top-level ordering assertions are applied only to top-level comments (not the full interleaved threaded list), and adds a focused regression test for ThreadedCommentsHelper.ToThreaded(true).
Changes:
- Fix descending-order assertions in
CommentsThreaded_Sort_Extension_Descto consistently validate ordering using the top-level (Depth == 0) subset. - Remove the ID-based ordering assertion that was coupling the test to unrelated threaded/child ordering.
- Add a new self-hosted utility test that verifies top-level descending date order while keeping children attached to their parent in the threaded output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| WordPressPCL.Tests.Selfhosted/CommentsThreaded_Tests.cs | Updates descending-order assertions to use the filtered top-level list (firstLvl) for ordering checks. |
| WordPressPCL.Tests.Selfhosted/Utility/ThreadedCommentsHelper_Tests.cs | Adds a regression test validating ToThreaded(true) keeps root comments in descending date order and preserves parent/child adjacency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The integration suite was failing intermittently in the threaded comments descending-order test. The failure came from validating top-level ordering against the full threaded list, which includes interleaved child comments.
Root cause
CommentsThreaded_Sort_Extension_Descfiltered top-level comments intofirstLvl, but its final ordering assertions still indexed intothreaded.Change
firstLvlconsistently for the top-level ordering check.Regression coverage
ThreadedCommentsHelper.ToThreaded(true)that constructs a root/child/root comment shape and asserts that: