Tuesday, July 17, 2012

Melange Functional Testing

Hi,

This week i worked  on writing a temporary script to start the server and seed_db automatically on giving command $bin/run-tests tests/functional and starts execution of functional tests. The data store file is also saved in a temporary location so that functional tests do not overwrite the local data store. I also worked on planning test scripts for:
GSOC Events  & Timeline Page.
GSoC Proposal Page.
GCI tasks Page.
Connect With Us Page.
GCI Events and Timeline
GCI Home Page
GCI Search Page.
FAQ page.

Next week i will work on creating specific test cases on the remaining scripts as mentioned in my proposal timeline.

P.S.: THANK YOU !!!

Monday, July 16, 2012

Improvements and Git Chaos

Hey all,

So in light of the recent Midterm Evaluations (and I'm still here, woot!) I haven't been very active with updating my branch in anticipation of a wave of feedback and suggested changes that I would need to make to be able to commit anything else. That said I got some feedback on things I needed to change in the connection module today and immediately applied them, mostly style issues but a couple of fixes including removing a gratuitous query and adding inheritance for the ConnectionForm. I had done this originally but it was clumsy and I ditched it, but it's a lot prettier now.

In keeping up with my timeline [0] I added a query in the connection module to essentially rate-limit the number of existing pending connections a User is allowed to have in order to try and prevent spamming. A user can have no more than three existing Connections without response for an org admin at a time, at which point they are prevented from creating any more. I've also been sketching up and thinking about how to add comments to the ShowConnection page in order to make it easier for users and org admins to communicate. It's likely going to almost identical to that of the proposal_review module and its pages since I like that format, but it's a work in progress.

I spent a good amount of time wrestling with my working directory in git since I remembered that I would not be able to make fast-forward commits once I reset my changes on connection_demo to master so that I could update the branch and then apply the connection templates and associated models. I should probably have merged the connection_demo branch back with my backup branch and then made my changes, but instead I added them on top of the existing chaotic working directory and threw a whole new headache into the mix. So what I did was end up branching off master and then applying all of these new changes in a nice super commit, so sorry about that to anyone who is fundamentally disturbed by my actions.

I don't think I shared my updated timeline with the development list correctly so I changed its permission settings, so you guys should be able to check it out now.

[0] Drew's Melange Timeline

Tuesday, July 10, 2012


Hi

I have been working on proposal sync this week. Initially “Sync with Google Documents” was not appearing as linked on proposal submit page, according to orcun’s design an authorization window pops up clicking on this link. Then a talk with Madhu made me realize that the view being rendered by v2.modules.gsoc.proposal.base.py on proposal submit page has a dependency block which contains melange.gdata.core melange.gdata and melange.autocomplete, which have been imported from soc.content.JS.  Present melange codebase does not have melange.gdata.js file. The Java Script view on proposal submit page is actually provided by files in JS folder (imported in dependency block). I had to copy melange.gdata.js file in current shipmenttracking branch from orcun’s code and its minimized version in js.min file folder.
This folder contains minimized version of javascript files. We run closure compiler, when we publish online and at that time these minimized files are loaded instead of files in js folder to make loading faster. Since I am working on local instance I have made changes in app.yaml to load JS files from js instead of js.min.

I learnt about using ‘firebug’ and ‘chome development console’ to check JS errors in the code while the web page loads. Working with these makes it very easy to find out where the error is being generated from. Initially the melange.gdata could not load and displayed LoginFactoryFunction is not a function which resides in melange.gdata.js file.
I renamed melange.gdata.core to melange.gdata in melange.dependencies and something started working now. There appeared a blank popup which was mainly meant for authorisation to access the Google Docs.

I have proposal syncing working to some extent now, there are no errors on the client side and I have to dissect the problem on the server side. I have updated my online instance[0] and you can check the demo when submitting a proposal.

[0] http://melange-aditi1.appspot.com/

Melange Functional Testing: Adding More Tests


Hi,

This week i worked on adding test cases to already existing test scripts. I also added code to subclass all the test cases from FunctionalTestCase class where FunctionalTestCase class now inherits from unittest.TestCase. Code cleaning continued this week too, added new comments in some test cases and updated comments in almost all tests cases. Added two more test cases to GSoC Student Registration Test, one test case to GSoC profile test case, one test case to both GCI dashboard and GSoC dashboard tests. Also i did changed the names of test methods so that in case a test fails it will be easy to locate which test case belonging to which tests script failed.

I also played with parallel execution of test cases. It saves a lot of time. To run tests in parallel we just have to pass the number of processes as argument i.e. $bin/run-tests  --processes=5  tests/functional/

Monday, July 9, 2012

Adjustments, Improvements, and seed_db Antics

Hey all, so this week has been rather low key as I've been awaiting feedback and suggestions from everyone, but I've gotten my branch to a point where it should theoretically be ready to be merged into the main code.

So far I've done mostly cleanup work, such as adding comments to the Connection model and fixing style issues in some of my other work. Some substantial modifications I've made include cleaning up the AccessChecker class in soc.views.helper, which got pretty cluttered between my hacked-together initial demo which basically just involved me switching out Request object stuff with the Connection object. I marked a bunch of methods in that class for future removal when my code gets merged into the main branch, stuff like _canAccessRequestEntity really won't need to be there anymore since the invite and request modules will be removed an as many methods related to them as possible without breaking anything. I also removed methods that I had written but were no longer using, which cleaned up a bunch of the accumulated clutter. The status messages needed some work so I changed how the status message presented to the user is determined when viewing a connection and it seems to be working, but I'll continue to improve upon it. While doing that I realized that there was a logical bug that allowed users promoted to org admins to view and modify their own connections, which I prevented by adding a line in the canViewConnection() method in ShowConnection's checkAccess method.

Also at Daniel's suggestion I moved the HTML template that the module was using into its proper location within the gsoc template subdirectory rather than the soc request one where it was previously located. I've begun working on the tests for the connection module but only have a skeleton for the moment and am going to dedicate time to working on that module very soon.

I emailed the list about this, but nothing I do seems to enable seed_db on my appengine instance. I've made soc.logic.system.isDebug() method return True and after that even took the if statement out of soc.views.legacy so that the seed_db url pattern will always get added in, yet when I deploy it nothing seems to work. Lennard's given me some great advice on setting this up but as to why this still isn't working I'm clueless. My next step might be to try just running the seed method on the GAE interactive console to populate some data, but I'm working to get this resolved so that you all can mess around with a running instance of my code.

For when I do manage to get this to work, here are some instructions as to how to test everything out:

  1. Create a mentor profile
  2. Log in with either the default admin profile or your new mentor profile
  3. If you're an org admin, go to My Dashboard -> My Organizations -> select an org -> Start Connection -> input either the email address or link_id of your mentor profile -> Submit. If you're a mentor, get to the "View all participating organizations" page -> select an org -> Start Connection -> Submit. 
  4. The connection should be available in Dashboard -> My Connections, though there is a bug I'm working out that has to do with the org_admin_for variable in the dashboard module in gsoc; it may be something to do with the data populated by seed_db. You can avoid this bug by doing everything through Organization 0
That's it. Let me know if anything isn't working and I'll fix it, I'm on a straight sprint right now trying to get seed_db to work/populate the datastore asap. 

Tuesday, July 3, 2012

Hi

The week spent in struggling to find the difference between the online instance and the local instance of melange, since the same online instance was not showing shipment, projects and proposals on student dashboard, which I could see in the  local instance. I used localhost:8080/_ah/admin/interactive console to create entities as Lennard said that it was the right way but unfortunately it did not work too.

Actually, I did not realize that I was signed in as an admin in the online instance instead of as a student while accessing the student dashboard via the URL. The code in gsoc.views.dashboard only allows a student, who has project to see the shipment, proposal and project components.
We have specifics about the spreadsheet too, like it should have exactly the same columns as listed in the task/trackings.py and two worksheets with gid=0 and gid=1, otherwise, the syncing fails.

So I created a student profile to see if I can see the shipment details after syncing. I also manually set student_info.number_of_projects=1 so that the student components are rendered. The syncing now can be done successfully. You can see the demo in my instance.
The details are:
Instance: http://melange-aditi1.appspot.com/

Student username:
atmelange@gmail.com
password:               

Public Spreadsheet: https://docs.google.com/spreadsheet/ccc?key=0AuENNrqFbxWEdFVIaVJSczZOSkVPUWc0MWFrOEo2cXc#gid=0

After this I started working on proposal syncing. I added useGDataJS function in soc.views.helper.response.py for proposal syncing which was missing in the patches supplied by Orcun. I am stuck now at “Sync with Google Documents” not being
appearing as linked. I have mailed Orcun for his help and will proceed further.

Melange Functional Tests.


Hello everyone.

This past week i worked on cleaning the scripts and making the code better. I am making an entire framework using selenium and python for the first time, so its obvious there will be mistakes and i am making a lot of mistakes but this is how i am learning. Everyday i learn something new and its not only about coding skills , but a lot more. My communications skills are improving , i am learning about processes and many other things. I have made a couple of scripts till now, they are running fine but there is lot more space to improve. Oh wait, do they really run. Everybody likes screenshots. How about a video !!!

                                

Speed of exceution as shown in the video is different as compared to original execution. If you wish to see that please clone my branch at google code [0] and give a shot to functional tests. However execution of these tests does not mean that these test scripts are done. There is a lot of space for improvement and a lot more to be done. In the video you will see the execution of following scripts:

test_gci_about_page.py
test_gci_dashboard.py
test_gci_leader_board.py
test_gci_student_registration.py
test_gsoc_about_page.py
test_gsoc_accepted_orgs_page.py
test_gsoc_dashboard.py
test_gsoc_profile_page.py
test_gsoc_search_page.py
test_gsoc_student_registration.py  

Most of all i am enjoying a lot  working on this project. Not only this project is adding to my coding skills but also educating me on  how effectively we can contribute to open source projects.

[0] http://code.google.com/p/soc/source/browse/?name=functional_testing