* CSS and JS aggregation enabled
* Page caching enabled (a module in D8)
* a non-zero max-age setting
* Not using the null backend for any cache bins
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | interdiff-2848751-17-21.txt | 3.98 KB | ginovski |
| #21 | sensor_to_verify-2848751-21.patch | 16.92 KB | ginovski |
| #17 | perform-sett-sensor.png | 34.04 KB | ginovski |
| #17 | sensor_to_verify-2848751-17.patch | 15.42 KB | ginovski |
| #17 | interdiff-2848751-14-17.txt | 15 KB | ginovski |
Comments
Comment #2
ginovski commentedAdded sensor, not sure about the verbose and result value type.
Comment #4
berdirwrong key here.
the bin isn't not defined, it's an instance of the null backend.
Comment #5
ginovski commentedFixed the schema and the null-backend bins.

Current sensor:
Comment #6
berdirI think the verbose table should be label: value, this isn't going to scale well as we add more checks. Have a look at the requirements sensor for example.
Comment #7
ginovski commentedChanged the table format.
Should I add a message(some info about the setting) or actions (Ignore/Unignore) column?
Comment #8
berdirMaybe we could icons, experiment with something like the new status page?
Also, you're not yet implementing the most important part yet, runSensor() and the even moster important part: tests ;)
Comment #9
berdirYou might want to define a helper function that returns an aray which contains status true/false, label and value, so that you can also easily loop over it and list all non-ok things in status messages in runSensor()
Comment #10
ginovski commentedMade some changes,
1. Added runSensor function.
2. Added helper function that contains status/label/value.
3. Added some test, not sure how to make a null backend cache bin.
Current sensor:

Comment #11
ginovski commentedAdded settings for the performance settings and tests.
Configuration form:
Comment #13
berdirfor the update sensors button to work, the id needs to be the same.
there is no reason to cache this for a long time, it s a very fast sensor. set it to 15min or so.
you can simply set the status to warning, it doesn't matter if you set it multiple times an then the code gets simpler.
instead of making it conditional, I would add another key, 'enabled'. Then you don't need to duplicate the checks, which is why we added this helper, and instead can loop over it and build the table. If you need more info in verbose, just add more keys.
to test null cache backend, use setSetting(), set the same value as you have in your settings.local.php
Comment #14
ginovski commentedAddressed #13 comment,
Tried to set null backend bin in the test, but I'm not sure why the settings aren't updated properly in the sensor.
Comment #16
berdirWe usually don't use t() in status messages, below you also don't, so just use string concatenation here.
I don't understand why you're not building the verbose table from the data in the helper?
we should use dependency injection for all servics.
We probably want to check for dynamic page cache too, as a separate key. Wondering about big pipe as well, but lets leave that out for now.
good luck trying to write a test for this ;)
PS: This doesn't make sense and is always true. That's not what this check is about, have a look at the performance settings page and how that is stored.
I'd suggest to collect the null bins and list them in the output.
looks like you're not doing negative tests on the module, you should once test when it is not enabled. Just like with the settings and cache bin.. do one run with optimal settings, then set everything wrong and test again. Then set some settings and check again, like you already do.
We're not creating a cache bin, we're setting the cache backend configuratoin for cache bins.
the sensor is enabled by default, so that shouldn't be needed?
Comment #17
ginovski commentedAddressed #16.

Test has 1 fail (can't properly set a null backend bin)
Screenshot:
Comment #19
ginovski commentedComment #20
berdirOne more thing to check.
If php version > 7.0, check the that http://php.net/manual/en/ini.core.php#ini.zend.assertions is set to -1.
Comment #21
ginovski commentedAdded zend assertions, left to fix: test failing for the null cache bin.