Compatibility/System Addon/AutoTest: Difference between revisions

Jump to navigation Jump to search
Update description
(Initial version)
 
(Update description)
Line 5: Line 5:


= Architecture =
= Architecture =
[[File:WebCompat AutoTest Architecture.png|framed]]
[[File:WebCompat AutoTest Architecture.png]]


Current autotest leverages great works of [https://jenkins.io/ Jenkins] Continuous Integration. In the following sections, I will describe each component in the workflow.
Current autotest leverages great works of [https://jenkins.io/ Jenkins] Continuous Integration. In the following sections, I will describe each component in the workflow.


== Jenkins Master ==
== Jenkins Master ==
Each site patch in WebCompat Go Faster Addon maps to a task in Jenkins autotest. Jenkins master is the control tower of autotest.  
Jenkins master is the control tower of autotest. Each site patch in WebCompat Go Faster Addon maps to a job in Jenkins autotest. We use the schedule function to create a task and run test for the site patch periodically.
 
We don't really run test on Jenkins Master, but assign the task to a Jenkins slave. Each job defines:
* Which Jenkins slave to run the test
* The test case repository
* Batch command (or script) to run test
* Postbuild script to upload result
You need to check if these 4 are configured properly or refer to the dummy test case.


== Jenkins Slave ==
== Jenkins Slave ==
We plan to have Windows, Mac OS X and Linux machines as Jenkins slaves to serve all tests, but currently we only have 1 Windows 7 machine runs platform independent test case and Windows specific test case.
Test cases are on [https://github.com/MDTsai/webcompat-system-addon-autotest GitHub]. While task begins, Jenkins slave pulls the repository from github, runs the batch command (download latest Firefox for this platform, and test case). Any error level not 0 fail the task.
== Firebase & Dashboard ==
It's not good enough to use Jenkins to see the test result, 2 reasons:
# We can't easily see which test failed.
# Jenkins master and slave are in Taipei office private network. For those who are not in this office, VPN to Mozilla data center is required.


== Firebase ==
To solve this issue, a [https://github.com/MDTsai/webcompat-system-addon-autotest/blob/master/scripts/postbuild.py Post Build Script] is used to get latest build result and upload to my Firebase database. We store test name, build ID, result, timestamp and console output in Firebase database using the schema(?):
* webcomapt-sysaddon-autotest
** job
*** %JOB_NAME%
**** %BUILD_ID%
****** { result: %RESULT%, timestamp: %TIMESTAMP% }
** job_console
*** %JOB_NAME%
**** %BUILD_ID%
***** { output: %CONSOLE_OUTPUT% }


== Dashboard ==
To display the result, you can visit the [https://mdtsai.github.io/dashboard.html Dashboard] too see the result. The page grabs the result from Firebase directly. Move cursor on build can see the timestamp, click to see the full console output can help to fix the test.


== Limitation ==
== Limitation ==
* Geo-restriction
* Geo-restriction: If a test case requires run in specific country, this is not ready or well tested. But it's a problem indeed.
* Private
* Private network: As said, this architecture is in a private network, not friendly for everyone to access.


= Plans =
= Plans =
* Move this prototype to try server
* Move this prototype to try server which will be more stable and public for everyone.
133

edits

Navigation menu