Any extension will need Joomla to be system tested, but if they are provided as a standalone package, how can we test them? The solution we found is to add joomla-cms as a GIT submodule. The first tests we run is the Joomla installer so we install Joomla. Then we install the extension, for example com_weblinks, using the install from folder installer. Finally we are ready to run the extension tests.
Me and @puneet0191 have already a working example. We will pull it here as soon as possible.
Short-term, that will work. Long term you need to think about "somehow" including all the dev-dependencies that are needed to test just this component in isolation (if you need the entire CMS to test this, it just shows how bad the architecture is). That probably means publishing the CMS library folder as a separate entity.
for system testing we need the CMS because we use a browser to click in all the buttons of the extensions, we will have soon an example based on "codeception" framework in the com_localise repository that hopefully could serve as example for this. Still work in progress.
The cool part is that we were able to run an Apache in Travis, so we can run the browser on every pull and test that nothing is broken.
Of course if we can also use other kinds of testing, like test directly the API we don't need the CMS, but I thing it would be awesome that we could do the system testing too. It will bring great value to quality.
Labels |
Added:
?
|
Closing. This issue was done already with: https://github.com/joomla-extensions/weblinks#tests