matomo-org / plugin-LogViewer

View your Matomo logs within Matomo
GNU General Public License v3.0
5 stars 13 forks source link

Improve UI test stability and runtime #91

Closed sgiehl closed 5 months ago

sgiehl commented 5 months ago

Description:

The UI tests of this plugin are also running in our core builds. There it happens quite often that the UI tests are failing as additional error message occur in the log files, as e.g. there is a temporary error while generating the assets.

This happens, as the UI tests currently overwrite the log file position, with a file specially created for tests. New log entries are therefor directly written to the file and the UI tests display them. This PR changes the behavior, so the log file position actually isn't overwritten, but the ReaderFactory in this plugin responsible for reading the log file use the customized path for reading only. That way no new messages can appear in the tests.

In addition I've also speeded the tests up ab bit by adding a nearly empty fixture, that will be used in the UI tests. Using the default fixture works as well, but takes a lot longer to be set up.

Review