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.
Statistics tests for logging are messy if you want to add one. They have indexes on them and all, so when you try to add a simple logging assertion you have to understand a lot of unnecessary logic.
I think a nice thing would be to add a function like assertStatLog().
Comment | File | Size | Author |
---|---|---|---|
#7 | statistics-proper_test_coverage-1326698-7.patch | 3.75 KB | iamEAP |
#2 | drupal-statistics_refactor_log_tests-1326698-2.patch | 3.75 KB | iamEAP |
Comments
Comment #1
iamEAP CreditAttribution: iamEAP commentedSince removing accesslog (and a number of intermediary, unrelated improvements to the Statistics test suite), I think the qualms raised in the original issue are largely taken care of.
That being said, I think the test coverage is lacking in some places and redundant in others in regards to logging. Specifically:
Comment #2
iamEAP CreditAttribution: iamEAP commentedAnd upon further reflection, checking for the existence of the scripts/settings across cache/uncached/authenticated is a little absurd too.
We just need to ensure that:
Patch attached.
Comment #3
iamEAP CreditAttribution: iamEAP commented#2: drupal-statistics_refactor_log_tests-1326698-2.patch queued for re-testing.
Comment #4
iamEAP CreditAttribution: iamEAP commentedAlso re-categorizing as a bug and renaming, since tests as they exist now are not fully covering the behavior of the module.
Comment #5
iamEAP CreditAttribution: iamEAP commented#2: drupal-statistics_refactor_log_tests-1326698-2.patch queued for re-testing.
Comment #7
iamEAP CreditAttribution: iamEAP commentedRe-roll of #2.
Comment #7.0
iamEAP CreditAttribution: iamEAP commentedMinor fixes for readability in English.
Comment #8
iamEAP CreditAttribution: iamEAP commentedAaaand Statistics broke because these tests weren't in. All of these test improvements ended up going in via #2172859: Statistics JS and settings are not included on node pages, which fixed the module too.
Closing as a dupe, now.