Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The patch that was committed caused 11 test fails in Drupal\views\Tests\QueryGroupByTest.
views.view.test_group_by_count_multicardinality.yml has some complex aggregation and sorting needs.
Tests pass on PostgreSQL and SQLite.
Proposed resolution
Add sort fields to new test view.
Remaining tasks
- Commit patch drupal-2483903-fix-multicardinality-test-7.patch
User interface changes
None.
API changes
None.
Beta phase evaluation
Issue category | Bug |
---|---|
Issue priority | Major |
Prioritized changes | PostgreSQL |
Disruption | None |
Comment | File | Size | Author |
---|---|---|---|
#8 | views.view_.blah_.yml | 6.89 KB | mradcliffe |
#7 | drupal-2483903-fix-multicardinality-test-7.patch | 1.93 KB | mradcliffe |
#6 | drupal-2483903-fix-typos-in-multicardinality-test-view-6.patch | 1.31 KB | mradcliffe |
queries.txt | 2.36 KB | mradcliffe |
Comments
Comment #1
dawehnerMh, those queries don't have a sort criteria at all ... I guess simply adding one would fix it?
Comment #2
mradcliffeYou're right, @dawehner.
I was confused by the patch in the commit and was only looking at the test views that were in the patch. I don't see any sorts defined in views.view.test_group_by_count.yml and views.view.test_group_by_in_filters.yml and views.view.test_aggregate_count.yml
Fixed my assumption in issue summary. Hopefully that makes this patch trivial, and I should be able to write a patch before I get to LA.
Comment #3
dawehner@mradcliffe
Do you see a chance to get a green run in LA?
Comment #4
mradcliffeYes, for this task.
For everything, it's a bit hairy because we need to switch from drupalci_testbot legacy to production, and there are issues there to fix related to drupalci. Also need to review and decide on the case insensitive issue (citext vs lower()).
Comment #5
webchickAFAIK every single DA tech person will be in LA, along with jthorson, so I'm betting you can get some drupalci help. :)
Comment #6
mradcliffeSigh... I always do everything backwards in my life, code, and art...
1st patch fixes some typos from the original commit in the multicardinality test view.
2nd patch(See comment #7) contains the 1st patch and adds some sorts.I'm a bit torn on this approach, which I'll relate to you in a poem because I'm tired:
Should we add sorts to the view
to emulate what a real person would do
or always add an order by
which may make a site builder sigh?
In other words I think the value of the test is not as great if we're testing order and expect the user to do themselves, but the only alternative is to add aggregate order by whenever an aggregate is added into the view. The latter could have performance impact.
Comment #7
mradcliffeAnd i'm tired, and didn't watch my git diff :(
Comment #8
mradcliffeI also did a test in the UI with nodes with the attached view.
Comment #9
dawehnerwhy this change ... ah I see duplication.
Ha!
-100 to add implicit behaviour, I think people should have a look at PIP 8. In reality the created field is added by default to node based views, so it should be less of a problem,
especially because unless tests, timestamps are in proper order. Yeah entropy in the universe!
Well, people should have a look at their views, when they build sites, and I think you always build your sites against a certain target database, given that you can add it if needed.
You know for mysql it seems to work fine, so too bad pgsql people have maybe to do more, but adding an additional sort criteria is probably one of the least problematics steps.
Comment #10
mradcliffeI woke up this morning with the same thought, and I agree.
I ran QueryGroupByTest in sqlite and it passes as well, but a Views test run on sqlite and pgsql drupalci legacy testbots would be appreciated.
Edit: I think I can spin up livetestbot-drupal-latest.iso on the drupalci legacy branch, but i don't have any of the old containers built. It'll take a while.
Comment #11
bzrudi71 CreditAttribution: bzrudi71 commentedI did a PG bot run and we have pass with patch applied!
Comment #12
mradcliffeI probably won't be able to get the legacy tesbot up and running on my local box again until this evening for a partial SQLite run.
Comment #13
mradcliffeOkay, this passes SQlite too.
Comment #14
mradcliffeI'll put this to RTBC based on #9 and #11.
Comment #15
alexpottCommitted b183aa1 and pushed to 8.0.x. Thanks!