Rohit & Prasanna, I thought about this over the weekend a little bit. I think testing the entire range of commands really is an automated system test. I think adding to current set of automated tests is fine but it really serves no purpose in testing the changes in this api refactoring.
What you really changed is the processing loop and moving code out to adapters. The right thing to do is actually to write a test case that tests that main loop and also test drivers for the security adapters. So test drivers here is different than unit tests. Unit tests understands how your code works and you can write that too but test drivers loads code specified and tests the interface to make sure in all situations the contract is upheld. Also the actual adapter implementations need to be moved under plugins. They should not be any part of the api/server/core package. --Alex > -----Original Message----- > From: Prasanna Santhanam [mailto:[email protected]] > Sent: Sunday, December 23, 2012 7:39 PM > To: [email protected] > Subject: Re: API Updates: Tracking progress, changes > > On Mon, Dec 24, 2012 at 08:27:52AM +0530, Min Chen wrote: > > Added recent change and TODO item for list api performance > > optimization. > > > > Thanks > > -min > > > > On 12/23/12 6:20 PM, "Rohit Yadav" > > <[email protected]<mailto:[email protected]>> wrote: > > > > This thread is for tracking progress, changes on api_refactoring. > > > > Current changes: > > 1. Introduction of a new InternalIdentity interface that provides a > > contract for any extending Interface or implementing class that it > > would have a getId() method that returns the internal id (long). > > 2. Merge master on api_refactoring to get the latest changes, all > > merge conflicts (about 3k lines) resolved. > > 3. Host/hypervisor simulator runs with the mgmt server when the > > profile simulator (mvn xxx -P simulator) is selected. > > The simulator is mostly running now save for systemVms that don't come > up unless you remove the SecondaryStorageDiscoverer from > components.xml. I'm still figuring out how to fix ComponentLocator to > not load multiple adapters of the same name. > > Until then do the following: > diff --cc build/replace.properties > index c9a93c2,c9a93c2..23156ed > --- a/build/replace.properties > +++ b/build/replace.properties > @@@ -24,6 -24,6 +24,6 @@@ DBHOST=localhos > AGENTLOGDIR=logs > AGENTLOG=logs/agent.log > MSMNTDIR=/mnt > --COMPONENTS-SPEC=components.xml > ++COMPONENTS-SPEC=components-simulator.xml > AWSAPILOG=awsapi.log > REMOTEHOST=localhost > diff --cc client/tomcatconf/components.xml.in > index 5957b61,5957b61..d224356 > --- a/client/tomcatconf/components.xml.in > +++ b/client/tomcatconf/components.xml.in > @@@ -130,7 -130,7 +130,6 @@@ under the License > </adapters> > <adapters key="com.cloud.resource.Discoverer"> > <adapter name="XCP Agent" > class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer"/> > -- <adapter name="SecondaryStorage" > class="com.cloud.storage.secondary.SecondaryStorageDiscoverer"/> > <adapter name="KVM Agent" > class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer"/> > <adapter name="Bare Metal Agent" > class="com.cloud.baremetal.BareMetalDiscoverer"/> > <adapter name="SCVMMServer" > class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer"/> > > > And then to startup the simulator: > mvn -Psimulator clean install > mvn -Pdeveloper -pl developer -Ddeploydb > mvn -Pdeveloper -pl developer -Ddeploydb-simulator > mvn -pl client jetty:run > > > 4. Correctly annotate @Parameter on *all apis* and remove > > @IdentityMapper, except for few in plugin whose VO classes did not > > implement an interface. For. ex: ExternalLoadBalancerDeviceVO, > > NiciraNvpDeviceVO > > 5. Get rid of IdentityMapper annotation processing code in > > ApiDispatcher. > > 6. Replace IdentityProxy field in all Response classes by String > > field except CreateCmdResponse. > > 7. Created Host db join view to improve listHostsCmd performance. > > > > TODO: > > 1. Prasanna to completely resurrect the simulator. > Check: > There might be some commands that might be missing from Simulator's set > but we > can fix those along the way as we hit the corressponding API Cmd. > > > 2. Fix ACL Role and checkaccess adapters, move out config. to the > > plugin and implement an interface for ACL adapter to get mappings of > > apiname etc. > > 3. Rename @Implementation to @Command and introduce name field so > we > > tightly couple over the wire api name to the Cmd class (no mappings > > in properties files necessary). > > 4. Performance profiling for several costly list APIs > > (listAccountsCmd, listUserCmd, listVolumesCmd, listStorgePoolsCmd) > > identified by QAs and look into creation of DB join views for > > these responses. > > 5. Come up with the marvin configurations covering the admin APIs/user > APIs. > 6. CRUD tests > > I'll start on 5 & 6 tomorrow. > > Happy Christmas and Happy Holidays to all! > > -- > Prasanna.,
