test: cover the sort on a from_many? relationship reached through an aggregate - #873
Merged
zachdaniel merged 1 commit intoSep 28, 2026
Merged
Conversation
…aggregate The existing coverage in `combination_test.exs` creates a single comment, so every ordering of the relationship agrees and the sort goes untested. These use two comments, and add a two-hop aggregate so the `from_many?` hop is not the first in the path. Requires ash-project/ash_sql#266.
2 tasks done
Contributor
|
🚀 Thank you for your contribution! 🚀 |
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.
Apologies for the quick AI PR, but confirmed against my own code plus had it TDDd.
Should solve a simple ordering bug in ash_sql
Description
Regression coverage for ash-project/ash_sql#266, which fixes a
from_many?relationship losing its sort when reached through an aggregate. The test belongs here because it needs a SQL data layer.combination_test.exsalready has a test named for this behaviour, but it creates a single comment — every ordering agrees, so the sort is never exercised. These create two, and add a two-hop aggregate toAuthorso thefrom_many?hop is not first in the path, which is the case the fix addresses.Against ash_sql main the two-hop test fails with the aggregate returning
"oldest"; with #266 all three pass. The other two pass either way and are here to close the single-row gap, not as regression coverage.Contributor checklist