CLI javascript API

Libor Zoubek lzoubek at redhat.com
Tue Jun 12 18:37:19 UTC 2012


Hello RHQ developers,

As we (QE) are starting to develop CLI automation, we are going to need  
some common JS file with helper functions and build our tests on it. My  
current focus is on testing RHQ plugins (i.e. interact with EAP using CLI,  
create/configure/delete resources on it). I do not want to end up with the  
common.js file having tons of functions developed ad-hoc, so I decided to  
design the API and discuss it with rest of team. I hope if we do it  
properly, API can be reused by CLI users or customers.

Why do we need such API?
  - current remote API was not designed to be consumed by scripting  
language, it is very low-level.
  - current remote API is asynchronous - using CLI in interactive mode is  
clumsy (IMHO)
  - scripts written on top of this new API will be shorter, simpler. It  
will be possible to have code completion in your favorite IDE when  
developing.

I have a few goals with the common.js API:
1. develop it and reuse it for automation
2. contribute it to rhq-samples
3. make it production-ready and contribute it to CLI so it's gonna be  
bundled within client and with help of commonjs support it may be injected  
by default when CLI is started

I've started http://jbosson.etherpad.corp.redhat.com/common-js-CLI-JS-API  
containing first piece of design and thoughts.

I am interested in your feedback, especially if we can work together and  
achieve goal 3.

thanks
-- 
Libor Zoubek


More information about the rhq-devel mailing list