Het testen van Joomla! patches
From Joomla! Documentation
In iedere software zitten fouten die opgelost moeten worden, dit is ook zo bij opensource software zoals Joomla!. De broncode van Joomla! staat centraal op internet, waardoor het voor iedereen toegankelijk is. Iedereen die een bug of probleem met Joomla! vindt kan dat melden. Een handleiding om bugs en problemen te rapporteren kan hier worden gevonden: Rapporteren van bugs en problemen
Gerapporteerde bugs worden opgelost en moeten uiteindelijk getest worden. Deze pagina legt uit hoe u kunt bijdragen aan het Joomla project door voorgestelde oplossingen te testen. U hoeft geen kennis van coderen te hebben, u heeft een Joomla installatie nodig om op te testen.
Een Quick-Reference-Guide voor het testen is beschikbaar op: Testen van Joomla! patches Quick-Reference-Guide
De Joomla 'staging' code
De Joomla 'staging' code is de meest recente code waarmee gewerkt wordt. Alle bugfixes en nieuwe functies zitten in deze code.
De Joomla 'staging' code bevindt zich op https://github.com/joomla/joomla-cms, dit is de code die geïnstalleerd moet worden. Hoe dat gedaan moet worden, wordt iets verderop uitgelegd onder Voorbereiding op het testen.
De issue-tracker
De issue-tracker voor Joomla staat hier: https://issues.joomla.org
De lijst toont de tracker-items van nieuw naar oud maar de volgorde kan veranderd worden door de filters onder Zoekmiddelen. Alle items in de tracker, die een patch hebben, hebben een versienummer naast de titel.
- PR-staging: Dit is Joomla 3.9.x
- PR-4.0-dev: Dit is Joomla 4.0
Deze labels zullen in de toekomst veranderen als nieuwe versies ontstaan en oude versies verdwijnen.
De status is belangrijk en dit is de uitleg:
Nieuw - Direct nadat een probleem wordt gerapporteerd krijgt het deze status. Maak, als u een bug vindt, een beschrijving hoe de bug te reproduceren is. Mensen die het probleem testen, weten dan hoe ze de patch (oplossing) moeten testen.
Bevestigd - Het tracker-team heeft het probleem kunnen reproduceren. Het codeer-team zoekt naar een oplossing.
Wachten - Er is een oplossing gevonden voor het probleem. Er is een patch bijgesloten die getest kan worden. Het probleem moet getest worden. Let op het label naast de titel, dit geeft aan voor welke Joomla versie de patch van toepassing is.
Klaar voor invoer - De patch is met succes getest en de code kan bevestigd worden.
Gesloten - Deze status is voor alle problemen die geen verdere actie behoeven.
Het filteren is handig in de issue-tracker. Monitoren kan handig zijn om berichten te ontvangen over een probleem dat bijgewerkt is.
In principe kunt u problemen testen die de status "Wachten" hebben.
Voorbereiding op het testen
Eerst moet de basiscode opgehaald worden uit de Joomla GitHub repository. Er zijn verschillende manieren om de Joomla mastercode te downloaden, maar we bespreken hier alleen de download optie.
Map aanmaken
Eerst moeten we een map aanmaken op de lokale webserver OF op een hosting-account dat toegankelijk is via de browser. Maak de map bugtesten aan en ga naar deze map via Verkenner of Finder.
Download Joomla!
Ga naar de Joomla GitHub locatie en klik op Download ZIP
Dit geeft u een kopie van de Joomla mastercode in een ZIP-bestand. Pak het bestand uit op een tijdelijke locatie, een map genaamd joomla-cms-staging verschijnt. Binnen deze map staat de Joomla mastercode. Ga naar de joomla-cms-staging map en kopieer de complete inhoud naar de map bugtesten die u in de vorige stap heeft aangemaakt.
After that you have to set up your system. For more information see https://docs.joomla.org/J4.x:Setting_Up_Your_Local_Environment/en.
U kunt nu Joomla installeren door naar http://localhost/bugtesten
te gaan als u een lokale webserver gebruikt. Ga, als u gebruik maakt van een hoster, naar de juiste URL voor de hoster. U ziet het normale installatieproces van Joomla.
Kies als voorbeelddata: Test English (GB) sample data
Dit is belangrijk zodat iedereen dezelfde gegevens gebruikt om te testen!
De installatie map hoeft niet verwijderd te worden, waardoor u alles, indien gewenst, makkelijk opnieuw kunt installeren.
Download de Patchtester
Om u te helpen met het proces van het testen van patches, is een extensie genaamd Patch Tester ontwikkeld. De Patchtester kan gedownload worden van de Patchtester pagina
The page you are presented with has the Patch Tester 3.0.0 Release Candidate for use on Joomla 3 Sites and the Patch Tester 4.0.0 Release Candidate for use on Joomla 4 sites. Note that the files to download are hidden in the Assets drop-down which when clicked will review the download file formats and the source code. Once downloaded it can be installed via the Extension Manager in Joomla.
Om de Patchtester te kunnen gebruiken is een GitHub account vereist, de reden hiervoor is dat er een limiet is op het aantal anonieme aanvragen die via de Patchtester worden gedaan. U kunt zich aanmelden voor een GitHub account op deze pagina.
Instellen Patchtester
De details van het GitHub account kunnen bij de instellingen van de Patchtester worden ingevuld. Ga, nadat de Patchtester geïnstalleerd is, naar Componenten -> Joomla! Patch Tester en klik op Opties rechtsboven. De Opties pagina verschijnt en er zijn drie tabbladen. Op het eerste tabblad genaamd GitHub Repository kunt u kiezen welke repository u wilt gebruiken. Standaard is dit het Joomla! CMS.
Op het tweede tabblad genaamd GitHub Authentication kunt u uw GitHub gebruikersnaam en wachtwoord of token invoeren, als u gebruik maakt van een token.
Klik, na het invoeren van uw account details, op Opslaan & sluiten. Klik, terug in de Patchtester op 'Gegevens ophalen' in de linker bovenhoek.
U bent nu klaar om te beginnen met testen.
Vind een probleem in de issue-tracker dat u wilt testen of gebruik de "Ik doe een gok" knop. Controleer eerst of u het probleem kunt reproduceren. Indien u het probleem kunt reproduceren, kunt u de patch installeren.
Het installeren van een patch
Vind in de Patchtester de items waar u aan werkt door middel van de (gedeeltelijke) titel of het ID. De titel van een tracker-item ziet er altijd zo uit:
[#4308] - Fixed event dispatching inconsistencies leading to incomplete API
Beside the # is the ID and behind the - sign comes the title.
Klik, nadat de patch gevonden is, op de blauwe knop Apply Patch. Controleer of de bug is opgelost en controleer ook of er geen nieuwe bugs zijn ontstaan.
Registreren testresultaten
After testing, please add your test result in the test overview (use the button "Test this"). Now you only need to add a comment if you have extra information or if you test unsuccessful. As the Tracker now automatically add a comment that you test it. It must also be noted that it is much better if you can test patches in a multilingual environment (with at least 3 content languages published) as there can be issues triggered only in such environment.
Terugdraaien patch
Nadat een patch is getest, is deze niet meer nodig en kan deze verwijderd worden uit uw test-installatie, hierdoor test u altijd op een schoon systeem (u kunt patches in relatie tot elkaar testen om zeker te weten dat ze elkaar niet in de weg zitten). Ga terug naar de Patchtester en klik op de groene knop Revert Patch. Dit verwijdert de patch en kunt u het volgende probleem testen.
Testing patches using Git
Since the Patch Tester cannot be used for all patches to test, sometimes we must use another way. The Patch Tester replaces the complete file and does not only apply the changes of the pull request, so you may not be testing an issue in an isolated state. To truly test a patch with only the changes made in the patch, we must use Git. The reason is that Git can apply a patch with only the changes in that patch. Git does this using a diff file. Voorwaarden om de methode hieronder te gebruiken zijn:
- Joomla is geïnstalleerd met behulp van Git
- cURL is geïnstalleerd
De diff verkrijgen
Een diff verkrijgen uit een pull request is vrij eenvoudig. Laten we zeggen dat dit de URL is van het pull request
https://github.com/joomla/joomla-cms/pull/1452
To get the diff, all you need to do is add .diff after the URL, so it becomes
https://github.com/joomla/joomla-cms/pull/1452.diff
Testing the diff
Before you apply the diff, you can first check if the diff can be applied, a sanity check. Go to the root of your Joomla installation and run the following command:
curl -L https://github.com/joomla/joomla-cms/pull/1452.diff | git apply --check
Applying the diff
After the diff has been tested and there are no errors, the diff can be applied by running the following command:
curl -L https://github.com/joomla/joomla-cms/pull/1452.diff | git apply
With the diff applied you can run your tests and record your test results as explained above. If needed, you can apply multiple diffs at once as long as they do not overlap each other. In some cases this is needed when there are multiple pull requests that need to be combined to be tested.
Reverting the diff
Once you are done with testing you can cleanup the system by revering the diff with the following command:
curl -L https://github.com/joomla/joomla-cms/pull/1452.diff | git apply -R
To verify that everything is clean you can run
git status
You should get the notice:
nothing to commit, working directory clean
In case the system is not clean you can get a notice like this:
In case you see changed files but you have not made any changes you can cleanup the system with
git reset --hard HEAD
Now all should be clean
If you have become enthusiastic to test, give it a try. It takes a bit of effort to set everything up but once that is done, it is fun and easy! In addition you are also contributing to Joomla!.
Prebuild packages
For all people who test Pull Requests for J4: At the bottom of each new PR's is now a link to download an update packages containing the changes from this specific PR. Maybe you have to expand the details for the tests first. For this click on Show all checks.
Then you see the link to the download. Click on Details.
The link leads to a download page for that PR where you can download full install packages and update packages.
This will get you a copy of the Joomla 4.-dev code inclusive the patch in a ZIP file. Unzip the file in a temporary location, a folder named Joomla_[Version]+[Number of Path]-Development-Full_Package will appear. For Version 4.0.0-beta1-dev and PR-number 28462 this will be for example Joomla_4.0.0-beta1-dev+pr.28462-Development-Full_Package. Now we need to create a folder on either the local web server or the hosting account that can be accessed via the browser. Create the folder bugtesting and go to this folder via Explorer or Finder. Go into the Joomla_[Version]+[Number of Path]-Development-Full_Package folder and copy the complete contents to the folder bugtesting that you created in the previous step.
Now you can install Joomla by navigating to http://localhost/bugtesting if you are using a local web server, if you use one on a hosting account, navigate to the appropriate URL for the hosting account.
For testing a PR, people who don't have a git clone and do not have Composer or Node.js can download and install the full install package. If a PR modifies update SQL scripts or other things related to updating, testers can install a 3.10-dev nightly or 3.10 beta and use the update package of that J4 PR to test updating to J4.
Videos
How to test patch for Joomla 4
Hoe een patch voor Joomla 3 testen
- Deel 1:Introductie
- Deel 2: Neard Webserver installatie
- Deel 3: Voorbeeld issue testen.
How to test Prebuild packages for Joomla
Joomla has instigated a new method of testing pr's that will greatly benefit those on shared hosting. Or those who simply want a simple pr testing method.