Tuesday, June 12, 2012

Melange Functional Testing

Hi,

This week i did a little bit reading on nose test runner and other articles on functional testing. I was travelling to my home town so i was not able to do much this week, though i have started work on creating test script for Profile Page.

I am learning a lot of new things and that makes me feel good. I am continuously making changes to base module to make it much better. I hope that in few days base module will be good enough to be accepted. As soon as this module will be accepted, i will start sending test scripts. Instead of using TC01 and TC02 for naming test data sheets. I am planning to give them more meaningful names like Gsoc_Student_Registration and Gsoc_Profile. Leo has reviewed my first patch and suggested few changes, i am currently in process of making those changes to make the base module much better. After Profile page, my plan is to create test script for Search page and Events & Timeline page.

Extension and Integration with External APIs : Shipment Tracking and Data Syncing

Hi
Though the previous week’s strategy of working on my own local branch worked well but it was too much duplicating of work as many of the patches had already been integrated with Shipmenttracking branch and Madhu said that the time could be better spent on implementing the features. He asked me to continue working on the shipmenttracking branch itself and integrate the rest of the patches. I integrated the rest of the patches viz.
“Add dashboard for students to view shipments.”
“Add view works as proxy view to deliver JS requests.”
I ran bin/paver build --skip-pylint command to create taggable folder in build, which was initially not there because current melange doesn’t contain it. Made correction in module import in gsoc.views.proposal and gsoc.views.trackings.py files.
Create and edit of the shipment tracking info successfully added on the admin dashboard  but when we try to sink the spreadsheet with melange, it fails. I tried to debug what the source of the error was and suspect that it is            

due to missing consumer_key and consumer_secret. Both of the variables are set to “None”, which causes an AttributeError at gdata.Oauth.redirect.
Oauth_input_params are set to “None” and in app/service.py and the function setOAuthInputParameters in soc.views.helper.gdata_apis.oauth.py to reset them but consumer_key and consumer_secret are also of “Nonetype”. I have mailed Madhu regarding the issue and hoping to solve it soon.

Monday, June 11, 2012

Connection Demo

I spent my development time this week working on a demo implementation of the connection strategy, utilizing existing code in gsoc/views/invite.py and request.py for simplicity's sake. I'm going to spend the next couple of weeks cleaning everything up and, as mentioned in my previous post, consider the option of replacing request.py and invite.py with connection.py. This option is seeming more and more appealing as I move on since (as previously mentioned) it doesn't matter who initiated the connection, only that one exists. There is no distinction between a request and an invitation, so I don't see basis for separating them. I know that there are a lot of things I need to fix before I actually submit everything to the main repo and I've made note of them; the goal of this week was merely to get a working replacement of GSoCRequest with GSoCConnection up and running. I'm using pastebin here and haven't committed anything to a branch of the main repo to save myself revisions while I'm finishing up the demo.

A lot of what I've done is simplify the logic of the two modules to use GSoCConnection rather than GSoCRequest - nothing too elaborate yet. Here's a snippet from request.py, which handles the POST request when a User requests to become a mentor for a particular organization. It generates a GSoCConnection instance between the User and the organization properly and forwards the user onto the view_request page (which I'm going to replace later). I've made changes to the checkAccess() and context() methods to facilitate this change, though the latter isn't done yet. Here's the post snippet from invite.py, again context() is still in progress.

One big hangup I've run into is the dashboard presentation and query of these connections. I tried changing a few columns of the ListConfiguration in the __init__() method of my ConnectionComponent class only to find that the table no longer displayed. That said, I dug into the ListConfiguration class and then rewrote the init method to fit my needs (discovering the Python lambda functions in the process, which are fantastic). However, I'm stumped on the following query in the getListData() method:
q = GSoCConnection.all()
 if self.for_admin:
      q.filter('organization IN', self.data.org_admin_for)
 else:
      q.filter('user =', self.data.user)
No matter what I do I cannot seem to get any Organization or User objects to equate or match in this query, even when I know that there are valid objects meeting the criteria in the datastore. I've used the logging module extensively to try to get to the root of the problem but am at a loss as to what I need to do to fix it. Other than that, this week has been an excellent learning experience and I feel far more comfortable with the view system and the lifecycle of a RequestHandler subclass, which will be useful when building the connection module.

GSoC 2012 Extension and Integration with External APIs

Sorry for not being able to stay connected with and work for the community last week first of all
owing to some health issues. I could not do much work.I started out with creating a new local branch out of the current master branch and integrated first three changes of shipmenttracking branch viz.  Add task for syncing shipment tracking data[0], Implement the shipment tracking admin views for setting the document to sync [1] and Add the modules necessary for shipment tracking [2] and it works well.


[0]http://code.google.com/p/soc/source/detail?r=179cdc3d628ac637928e1adcb26c581692465055&name=shipmenttracking
[1]http://code.google.com/p/soc/source/detail?r=c18d34cd83e8f282931813c26d6abf1246a389bf&name=shipmenttracking
[2]http://code.google.com/p/soc/source/detail?r=a5dfbf735e3852bb37d98748428be56844783331&name=shipmenttracking

Tuesday, June 5, 2012

Design & Finalized GSoCConnection

I have spent this week coming up with notes on the current request and invite modules' structure (not actual logic) in order to better understand how I should go about changing the actual functionality. I have decided to keep the generic configuration methods within these modules for the time being so that I can spend most of my time working on the logic; methods like djangoURLPatterns, templatePath, and probably checkAccess will remain the same while I'm doing some basic work. Later I will likely change these to allow for a more dynamic workflow. To quote daniel, I'll try to move away from the request -> org response and invite -> user response since it's not going to matter which party initiates the connection. I believe I'll be combining this functionality into one module (most likely views/connection.py) as I progress, but for next week I'm going to keep everything in the current request/invite design and use the current UI.

This week's goal is to develop a working demo with sample connections utilizing the new GSoCConnection model I wrote last week and finalized over the weekend. We've cleaned it up and simplified the states that it can represent slightly so that there isn't any distinction between an accepted mentor invitation and an accepted mentor request; if necessary, the type of connection will be signified by the party who initiated the connection.

The only code I have for you this week is the finalized GSoCConnection model (linked above), but next week will  be more interesting once I've completed the request and invite demos.

Melange Functional Testing

This week i worked on completing all the three test test scripts and making changes to base module melange_functional_actions.py. I sent my first patch to melange this week. All the test scripts import this base module and use it in writing functional tests. I am waiting for the base module to get committed so that i can start sending test scripts. I am making changes continuously to the base module adding more and more functionality to it so that test scripts look more clean. I have completed three test cases till now. One such test case is TC01 student_registration_test_tc01.py where we are checking the student registration process, when a student enters all the correct details and successfully register himself/herself on melange. Test Case , Steps to Execute, Check Item, Test Case Objective and Expected result are shown below.



Test data for all the test cases will be imported from the sheets of testdata_melange.xls workbook.
 
Here TC01 sheet contains the data for Test Case with id TC01, similarly TC02 and TC03 sheets contains test data for TC02 and TC03 test cases. The details of TC02 and TC03 will be filled in functional test cases spread sheet. The code for other two test scripts can be seen here.
Apart from this i made changes to the names of different methods in Base Module and added a couple of more methods to it.

Tuesday, May 29, 2012

GSoc 2012: Extension and Integration with External APIs: Week2


Hi 

It has been a week now since the coding period started and I have not
done much work yet, I was spending time with Javascript and jQuery basics.

This week Me, Madhusudan and Mario scheduled  meeting to discuss over
the strategy to integrate present Orcun's code (extended by Madhusudan)
to integrate with melange. Since during the year lot of code has been
pushed to melange I will require to work on merging conflicts and then
look at what the outcomes are in terms of functionality before merging.

Madhusudan has already shared the patches and the  git branch
shipmenttracking for me to work on. This week I will apply patches 
to current melange codebase and will do the  necessary changes to 
make it compatible with Melange.