You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many (most?) of the unit tests actually make network requests to various MediaWiki projects like English Wikipedia. This leads them to be inherently flaky, because changes to data (not the API, just data) in these wikis can cause the tests to fail. See here for a simple and direct overview of the problem and the value of hermetic tests.
It is understood that mwoffliner needs to be tested against live wikis in order to prevent regressions. However, tests should be segregated so that any test which requires a live network connection is moved into e2e tests.
We should be able to test specific behaviors like "This utility method returns normalized titles" without downloading entire wiki pages.
Fixing this would also likely lead to architectural improvements, because we would be forced to decouple various modules more and use dependency injection.
It would also make the unit tests more speedy, because the network requests would not be necessary.
E2E tests could still be run in CI and on demand, when necessary.
The text was updated successfully, but these errors were encountered:
I can only agree with you, but not that easy to mockup MediaWiki with different configurations. That said we have an easy way to deploy MediaWiki with https://github.com/offspot/mediawiki-docker
Where the unit test just tests one aspect of the code and does not connect to any MediaWiki installation at all. I believe unit tests should test individual aspects and functions, instead of "Download this whole list of articles and then test if this one portion of it worked", which seems to be the current architecture.
Many (most?) of the unit tests actually make network requests to various MediaWiki projects like English Wikipedia. This leads them to be inherently flaky, because changes to data (not the API, just data) in these wikis can cause the tests to fail. See here for a simple and direct overview of the problem and the value of hermetic tests.
It is understood that mwoffliner needs to be tested against live wikis in order to prevent regressions. However, tests should be segregated so that any test which requires a live network connection is moved into e2e tests.
We should be able to test specific behaviors like "This utility method returns normalized titles" without downloading entire wiki pages.
Fixing this would also likely lead to architectural improvements, because we would be forced to decouple various modules more and use dependency injection.
It would also make the unit tests more speedy, because the network requests would not be necessary.
E2E tests could still be run in CI and on demand, when necessary.
The text was updated successfully, but these errors were encountered: