Closed (fixed)
Project:
Node Revision Delete
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
5 Jul 2022 at 19:29 UTC
Updated:
20 Jul 2022 at 19:34 UTC
Jump to comment: Most recent
Working on that.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
berdirThat was easier than expected.
Comment #5
adriancidThanks
Comment #6
adriancidComment #7
berdirThanks. Note that being able to test as a patch, I would have needed to add a line to composer.json for drupal/core. That said, now that it's committed, you should be able to set up a weekly test run or so on https://www.drupal.org/node/1779880/qa against D10 to see that it works on DrupalCI as well.
Comment #8
adriancidThanks, its done
Comment #9
berdirAlmost. D10 requires PHP 8.1 :)
Comment #10
adriancidThanks, I updated the test.
Comment #12
berdirI'm sorry, I really did miss the composer.json change, I thought the definition is missing. Opened another MR.
Comment #13
berdirThat test has a race condition: https://www.drupal.org/pift-ci-job/2420740. It's calling strtotime() in the provider (which is executed during test discovery) and the implementation and expect it to return the same. If too much time passes between defining the test and running it (for example when running all tests at once because the functional test then runs first), you get a different result. It's probably less likely to happen on CI as it runs tests one-by one, but it's still possible to have a second-switch in the middle of discovering/running the test as that example shows.
Also, noticed while looking at that: \Drupal\node_revision_delete\NodeRevisionDelete::getTimeString() is too simple, singular/plural rules are more complicated than that, some languages have more than a single plural version. It's most likely also impossible to correctly translate that grammatically into certain languages and hard to understand what it is from the placeholder names. A better approach would be to use https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation..., for each time option with a complete string.
Comment #14
adriancidThanks, I will try to update the code with your recommendations.
Comment #15
berdirYeah, sorry for just dumping that here. The D10 test is green now, had to retry twice, the second error was a weird git thing. But the linked fails will probably happen from time to time. time related tests are very tricky.
I copy pasted those issues into a new one for each problem, so you can merge the second MR and close this again.
Comment #16
adriancid