Hi all, 

Summary 

We have made a marionette test to perform the static code analysis on RIL 
related code in Gecko part by jshint . 
Now we are going to check-in the patch and activate the test on try server. 
Please note that it acts as all other tests. That means, once you got orange in 
in-bound, the patch will get backout. 

To avoid surprising you and making you feel bad when got an unexpected test 
fail on try server, we try our best to provide sufficient materials about this. 
Hope everyone who work on the following files could aware of this change. 

dom/system/gonk/ RILContentHelper.js 
dom/system/gonk/ RadioInterfaceLayer.js 
dom/system/gonk/ ril_worker.js 
dom/system/gonk/ ril_consts.js 

Bug 880643 - B2G RIL: Add a code quality test on try server for RIL javascript 
code in gecko 
Document: 
https://hackpad.com/Code-Quality-Test-For-RIL-Javascript-Code-In-Gecko-cz5j7YIGiw8
 
Reference slide: 
https://speakerdeck.com/aknow/improve-code-quality-of-ril-code-by-jshint 


Why / Motivation 

Because of the nature of js code, it's hard to detect the errors, even the 
syntax errors, during the b2g build process. 
All the errors in RIL part is transparent to the build and might cause the 
phone power-on fail. 
It's better to found these silly errors as early as possible, thus we don't 
have to waste the time on build-flash-debug cycles. 
jshint could help us for this part. We hope everyone could know the beneficial 
of this tool and have better productivity. 
Moreover, we would like to do more and let the check become a test case. That 
guarantees we always have high quality code in the repository. 


What we do 



    1. Add a marionette test case. You could also run the test locally before 
you push to the try server. 
    2. Provide a customized version of jshint (named jshint-gecko ). You could 
perform the check in command line without running the test. 
    3. Provide a document collecting all the information. 
    4. Provide a slide showing how we develop the test case. 

Example on try server 

https://tbpl.mozilla.org/?tree=Try&rev=2c260c61e610 




We could found the error messages between AssertionError and 
TEST_UNEXPECTED_FAIL 
For the example, we should add a missing semicolon. 


If you have any questions, please feel free to let me know. 
Let's make it better!! 


Best regards, 
Aknow 
-- 
Szu-Yu Chen (Aknow) 陳思佑 
Mozilla Taiwan 


_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to