Tuesday, August 21, 2012

Melange Functional Testing

Hi,

This week i worked on creating a results directory feature for tests results. After every test case executes it takes a screenshot and save it in results directory with the test case name , works for both scenarios when a individual test case is executed or entire test suite is run. Also i worked to implement one more suggestion by Leo, i.e. Removing xpath locator's from the test case config wherever id of the web element is available.

I am reading a lot more these days about features provided by the python standard library and incorporating more features from it to the existing framework. I will continue to implement suggestions by Leo and also on some new features or test cases.

I really enjoy a lot working with melange and i enjoyed all this time i worked on framework. I felt happy every time i saw a test case ran successfully. It is fun to see functional tests executing. Leo is a really great guy, he helped me whenever i needed his help. I am really thankful to him for his valuable suggestions from time to time and his help on various aspects of my work. Also i am very thankful to Lennard for his code reviews and his help in improving the entire framework.

These three months i worked with you people were really awsome. Now I work harder than i used to do, I am more confident than i used to be. THANKS A TON  for everything :)

Monday, August 20, 2012

Wrapping Up GSoC 2012

Hey all,
     I've spent this week working on the connection tests (one of which I'm having trouble with) and working on fixes for what I thought were fixes for the anonymous connection activation, but with school around the corner (like tomorrow) I've been pretty busy. I'm not too worried though since I think I got a lot of stuff done this second midterm and I'm going to be hanging around anyway to make sure everything gets finished. I'd really really like to see my code end up in production and I think it's pretty close in terms of functionality - the tricky part will be removing all of the invite/request code that we don't need anymore. One thing I want to note is that I added a pass and a todo in one of the tests in connection so that it doesn't break anything, but if anyone wants to look at it you're more than welcome to.

    On another note, this will be my last post as part of the GSoC 2012 program! Again I'll still want to hang around and do what work I can while I'm in school and maintaining a part time job (among other things), but I've had an awesome experience working with the Melange team and I've learned a ton. I'm looking forward to working with everyone in the future, but I've really enjoyed working on Melange for my Google Summer of Code project.

- Drew

Tuesday, August 14, 2012

Wrapping Up and Testing

Hey all, sorry for the super late blog post this time. I've spent my Melange time this week working on a potpourri of issues that Lennard has kindly pointed out for me by volunteering to try to break my code. Some of these smaller fixes include:

  • Including the message from the form in the connection notification email
  • Sending connection emails to the person it's actually supposed to be sent to
  • Added an email field to AnonymousConnection that prevents sending duplicate invitations to the same email address
  • Added an error flash message to OrgConnectionPage and a url parameter in order to notify the user when the above condition arises
  • Added functionality to gsoc/views/profile that will automatically promote users to the role offered by the org
  • Changed the representation of a message in soc/models/connection/Connection to a db.TextProperty so that the form will render its Textarea widget correctly and allow for multiline input
    • Removed the widget override for message in Meta
  • Using commas instead of semicolons now for the emailed/dupes parameters that are posted back onto the OrgConnectionPage in order to support displaying multiple emails 
  • Fixed a bug that allowed the existence of a User entity to prevent a person from being marked as "anonymous" (no GSoCProfile) to establish an anonymous connection
  • Added an extra column to dashboard to display the status of a connection
    • Added a status() method to the connection model to get a quick, user friendly status and replaced the _determineStatus method (which I hated) in the ShowConnection page with a call to GSoCConnection.status() and display it in a single status field.
  • Now registering with an anonymous connection also redirects you to the dashboard
  • Incorporated Lennard's welcome email code for new mentors in this commit into connection for org admins and mentors
I've also been delving deeper into the testing suite and determining what to test and how to do it; this is what I'll be working on for the rest of the week. One dilemma I do have is when a user accepts an org admin connection and is promoted as such, they have the ability to view the status of their own connection. I need to either remove all actions from the connection form or delete the connection after it's been completed (assuming the user did not accept only the mentor position out of an org admin offer), which is a small shift in the logic of the connection and is something I want to discuss at the weekly conference today. Again, sorry for the late post!!!

Melange Functional Testing


Hi,

This week i worked on things like removing the need to specify manually whether we are identifying an element by xpath or id, instead let the modules do it for you. This was one of the suggestions from Leo which i implemented this week. Apart from that i worked on killing the server as soon as test case has finished execution although some minor changes can be made to it in course of time.

Also i fixed the clear function in seed_db.py and started to make changes in seed_db so that it fits my need. Now seed_db in my branch first clear the already present data in the datastore and after that it seed the datastore. Changes were also made to all the test cases so that they fit in with the changes in base module. Next week i am planning to add some more features to the existing framework.

Tuesday, August 7, 2012

Melange Functional Testing


Hi,

This week i worked on creating assertTextIn(), openUrl() and clearDatastore() methods, fixed import order, synchronization problems and changing names of few fields along with others. Major part of the week spent in reading and experimenting, trying to find out how the framework can be improved.

Currently local server starts at a random port and execute the tests, clears the datastore after every test but it has to be improved to get it working even for remote instances. Next week i am planning to improve clearDatastore() method  and start working on suggestions made by Leo.

Monday, August 6, 2012

Anonymous Connections, aka Mentor/Admin Invites

Hey all,
     So as you may (or may not) know, I flew home Monday morning to drive up the the Adirondacks in New York with my family to visit my neighbors and came back very late on Thursday. Incidentally, I had 0 internet or cell phone service for 3 days. None. Zilch. It was incredible. That said while I may have gone 100% dark on you guys, I didn't have a flood of emails waiting when I got back so hopefully you all weren't too mad at me. Better yet, I got a bunch of work done up there; so much that I only missed the timeline by like a day. Which probably should have been longer anyway.

So unfortunately I wasn't able to do the daily snippet emails, so if you'll bear with me and take a peek at my big ol' commit on my connection branch and tell me if I screwed anything up I'd really appreciate it. Style should be ok, I've made an effort to improve it for fear of death by Daniel. The process looks a little like this:

  1. Org admin clicks the "Start Connection" link inside an org homepage and is redirected to the OrgConnectionPage view, which looks pretty much the same.
  2. Admin enters the emails and/or link_ids of users they wish to connect with and clicks the submit button. 
  3. OrgConnectionForm separates the valid link_ids/emails and the emails without any GSoCProfiles to be used by the generate() method
  4. Page displays something like the picture above for all emails that were sent notifications.
  5. The users receives an email with a link that looks pretty much like this: <http://localhost:8081/gsoc/profile/mentor/google/gsoc2009/08b7e441bd0ede68f7b2421bd8e2f6e0>   where that last ugly section is an md5 hash of the AnonymousConnection object created as a placeholder.
  6. The user follows the link, signs in, and is directed to create a GSoCProfile
  7. Once the user clicks submit, the AnonymousConnection object is deleted and replaced with a GSoCConnection object.
  8. Normal interaction with the connection continues from here
All in all, this pretty much took a couple of modifications and a second transaction in OrgConnectionPage, an additional url configuration for gsoc/views/profile, a template and another method in notifications. 

I need to test this on the production server, which brings me to my current situation: my changes are taking effect locally but not on my appengine instance. I tried building with paver again but I'm kinda stuck here and am probably going to need help since complex build phases are not included in my list of string skills (yet :P). If you have a fix and would like to email me I'll keep an eye on it, but I'll probably just end up harassing you all on the conference call tomorrow.

Tuesday, July 31, 2012

Melange Functional Tests

Hello everyone,

This week i did not work much due to reasons concerning my health, although i managed to consolidate loginOnLocalhost() and loginByGoogleAccount() in to a single login() method. Also i deprecated the setup() method and merged its functionality with init() method. Renamed a few methods so that nose runner picks up them in order.

Next week i am looking forward to implement suggestions of Leo on running a separate dev server for each test process and clean the data store after each test case. It is a much better way as compared to the current implementation. Also i am looking forward to solve the problem of code duplication in tests and make the test suite clean and much better.

Tuesday, July 24, 2012

Melange Functional Testing: New Tests


Hello,

This week i worked on creating the following test scripts:

(1) test_gsoc_proposal.py
(2) test_gsoc_faq_page.py
(3) test_gsoc_events_and_timeline.py
(4) test_gsoc_connect_with_us.py
(5) test_gci_timeline.py
(6) test_gci_tasks_page.py

Next week i will work on improving the test scripts. GSoC Proposal test was quite fun, It involved iframe. Switching to iframe and then switching back was interesting. It is good to see executing functional tests :)


Monday, July 23, 2012

Comments & Connections Finally Play Nice

If you've been following my series of "Daily Snippet" posts to the melange-soc-dev list, you'll know that I've made a whole bunch of fixes and may even be eagerly awaiting to hear whether I actually got this working. I'm happy to say that the ShowConnection page now supports the user and org admins leaving comments on a connection now accompanied by more reliable buttons, reasonable status messages, and a bunch of stability fixes. At the risk of boring both of us to tears (you by reading this and me by typing it), I'm going to glaze over what I've done this week. If you want more details I would be happy to provide them, or you can dig back through the Daily Snippet messages.

  • Fixed Connection notifications in the User/Org ConnectionPage transactions
  • Modified template for above notification so that it's a little cleaner
  • Revamped ShowConnection's checkAccess() method so that it actually does what it's supposed to (and added a connectionFromKwargs() method to the Mutator class)
  • Added newCommentContext() to gsoc.logic.helper.notifications for notifications of new Connections
  • Added getComments() to and made associated changes in ShowConnection's conext() method
  • Modified/Stole code from proposal_review and put it in the show_connection template in order to display GSoCComment instances
  • Added PostHandler() class (also stolen from proposal_review) to gsoc/views/connection.py and modified it to work for Connections. Also added it to gsoc callback
  • Added associated URL patterns to gsoc/views/helper/url_patterns and url_names
  • Modified commentVisible() in soc/views/helper/access_checker to take an org argument so that it can be used by both proposal_review and connection without extensive modification - also modified where it is invoked in those two modules
There's probably more, but I think that this is a good list. Take a peek at the results:
User perspective:

Same data, org admin perspective:


This snippet idea was awesome, it really helps keep me on track and motivates me to get what I need done on time. I'm going to make one more change and try to eliminate the query in connectionFromKwargs() mentioned above and will commit everything tonight. The two big things on my radar right now are inviting users without profiles (or even entities) and integration; I need to start by fixing a link Daniel sent me on my production instance. 

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



Monday, July 2, 2012

Functional Connection Module

Hey there, so this past week I've been working out the kinks I've been avoiding having to deal with and "finalizing" as much as possible for the first fully working implementation of the connection module. And also doing pretty much all the work on ShowConnection. I feel like I've got an excellent handle on the URL configuration and redirect stuff, so I'm pretty pumped about this. This round the code seems to be free of stupid mistakes (e.g. if org_mentor is False and org_org_admin is False:, which Lenard pointed out to my amusement/horror) and does everything I think it's expected to. Excited? Wonderful, me too.


I had accidentally moved the line to run the method to create the entity inside of a transaction outside of the foor loop for users in OrgConnectionPage, so after fixing that and something else (I forget what it was) I got the form to start properly creating entities again. Speaking of the form, it also now supports either a drop-down or a radio button if you uncomment the code in order to allow an org admin to choose the role to offer the user. I also made some changes to the template that the views were using in order to properly display form erros this time around, which was causing a certain degree of frustration and occasional raging. So this is fully working by my expectations, but do let me know if there's anything else that this view is supposed to do other than create a GSoCConnection model. Oh, a screenshot you ask? Well alright.


Next, we have the user side of things. I modified pretty much the same stuff as OrgConnectionPage as I recall, which was basically just entity creation and template modification for errors. Here's what it looks like:

Most of the work was dedicated ShowConnectionPage. I messed around with the URL configuration in order to get it to display properly. You can get to this page through the dashboard, though now the dashboard will display ALL GSoCConnection objects rather than just those related to the current user or org admin. One thing I need to fix is the org_admin_for member of the RequestData object in the dashboard object that handles displaying the connections, as it's only populating with one org. In the meantime this view itself works with a proper checkAccess() method and template to display all of the buttons. Though the buttons could be spaced out and organized better; this will be a refinement I intend to tackle in the second half of GSoC :). A user and an org admin are presented with buttons that allow them to take action in response to the current state of the connection, notably that a user can accept only a mentoring role if they are offered an org admin role. There are a series of methods to handle promoting the user in the event that the org admin and user change their side of the connection to equivalent values. In the spirit of a gratuitous number of screenshots, here's a picture of a mentor invitation on the org admin side:


Among other modifications include changes to the show_connection() method in the soc/views/helper request_data module in order to reflect a change in URL schema, AccessChecker's canViewConnection() method in order to determine who can view a GSoCConnection, and the soc/views/helper/notification connectionContext() method and associated template for email messages when a new connection is formed.

All of the above changes can be found on the main repo in an updated version of the connection_demo branch, so feel free to give it a look. I won't go so far as to say that for a first version it's perfect, but I think it's a great basis upon which we can make refinements and improve this mechanism. I've still got a little time to make adjustments before the midterm evaluation, so if there's anything you would like to see added or done differently than let me know and I'll get it done.



Tuesday, June 26, 2012

Shipment Tracking and Proposal Sync

Last week I worked on making the shipment tracking work on a live instance. I deployed the working instance to appspot and I faced the same problems that I faced locally. The syncing did not work because of the missing program key. I am sure that a program is seeded because I use seed_db to seed the datastore. I select the program GSoC 2009 in /site/edit too if its available and sometimes the programs doesn’t even appear in /site/edit after multiple seeding too. I spent quite a lot time trying to figure out where the problem is but in vain. At last, I approached Madhu for help but we could not fix up any meeting as it was quite a busy week for him.
    Finally, I decided to work on proposal syncing and attack shipment tracking when Madhu is available. I spent most of my time studying how proposal syncing works and reading the relevant django docs for forms processing etc. First I tried to see if proposal syncing feature worked. When I visited the proposal submission page, I got an AttributeError in gsoc.views.proposal.ProposalPage stating that response_helper had no attribute useGDataJS. So, I just commented that line to see if there are no crashes. Proposal submission page loaded fine but “Sync With Google Documents” was disabled in the page. I could not find useGDataJS helper function in any of the patches given by Orcun. I guess I have to contact Orcun to know more about this function or figure it out myself. This pretty much sums up my work.

Melange Functional Testing

Hi,

This week i worked on creating the test scripts for  gci student registration, gci dashboard, gci leaderboard, gci about page, gsoc accepted organisation page. I also made few changes to base module melange_functional_actions.py, added a new method to login on melange using Google account in case functional test is exceuted against the melange instance hosted on App Engine. I was successfull in running test cases with nose. I can execute all the tests with $ bin/run-tests tests/functional. It picks all the test scripts and execute them one by one. I am currently in process of moving all the scripts from my repository on github to my soc functional_testing branch.

Now, I am planning to refine the test cases i have written so far and send them to Leo and list for review and suggestions. Next week i am planning to work on already written test cases and make them better.

Monday, June 25, 2012

Connection Module and Related Views

This week's work went towards finally implementing the connection module with the views I've been envisioning. I started off with two - ConnectionPage and ShowConnectionPage - to be replaced by OrgConnectionPage, UserConnectionPage, and ShowConnectionPage in order to divide up the logic between views and cut down on the (admittedly small) number of conditionals within these pages. You can find the updated model on the main repo, and also right here. Apologies to anybody who might get notifications of commits, I've pretty much been spamming them almost every time I do something substantial or interesting.

First let me start off by saying that I've made some adjustments to the ConnectionModel per Daniel's suggestion and a couple of my own design. The new method for determining the state of the connection relies on four boolean variables: user_mentor, user_org_admin, org_mentor, and org_org_admin. These little switches allow for easily determining the implied state and any promotions. I've also set the parent entity of this model to be the User instance from the org-user relationship and changed it so that the model contains the Profile instance for the User to make it easier to handle promotions and getting certain information in the ShowConnectionPage class.

OrgConnectionPage is fully working, allowing an org admin to initiate a connection between an organization that they are an admin for and a user, granting them the role of either org admin or mentor. Except for the fact that it won't show the ValidationErrors for the role checkboxes...still workin on that one. It will validate (I stole the existing link id cleaning methods for now), create a GSoCConnection entity, and post back onto itself.  The url configuration is pretty simple, just in the format of connect/sponsor/program/organization and you can get to it from the org admin dashboard by clicking on an organization under "My Organizations." I combined the two links for "Invite Mentor" and "Invite Org Admin" into "Start Connection," which I think will suffice until I come up with a more intuitive name. Within the view is a checkbox that allows you to pick either one or both roles to offer. Everybody likes screenshots, so here's a picture:




UserConnectionPage has been giving me a headache. It took me a while but I finally understand the URL configuration system (....I think)  and how it all fits into the big picture along with AccessChecker and RedirectHelper. It's giving me problems at the moment since my connect() method in AccessChecker requires a user keyword argument, and I'm linking it from the Apply class in gsoc/views/org_home which doesn't have the data I need and I'm not seeing a way to put it there. Once I figure that out though (most likely by harassing people on IRC), all I have to do is make a small change in the class's generate() method and it should be working.

The checkAccess() methods on both of these classes should be good to go, but it's likely that someone will point out something I missed and I'm going to feel like a moron. But it's an easy fix, so I'm not stressed out about that at the moment.

The notification module's connectionContext() method should also be very easy to whip together once I get the ShowConnectionPage working, it should just involve creating a template and finishing the rest of the method.

Speaking of ShowConnectionPage, I had this guy working for a little while. Originally I was redirecting to this page after a successful post in OrgConnectionPage and it was showing me everything I wanted to see, but I ended up not liking how it was working and the url configuration started to give me problems so I scrapped most of the work and will take it on this upcoming week. Right after I convince my friend dashboard.py to behave and show all of the GSoCConnection instances properly. Mario if you're reading this I'm probably going to try and track you down with Javascript questions! 

That's all for this week. I've got a couple of questions for the conference call tomorrow (the checkbox errors not showing up and making org_home cooperate for UserConnectionPage, if anyone wants to prepare :P) but if I can figure those out I'll have this fully working by the midterm evaluation.

Tuesday, June 19, 2012

Shipment Tracking and Data Syncing

Hi,

This week I spent time working on Syncing of shipment tracking data, available on admin dashboard with student shipment list which is available on student dashboard.  First I sorted out the consumer key and consumer key secret problem which were set to none, by creating an API access key for http://localhost:8080/ and then supplied them in respective fields in http://localhost:8080/site/edit page.  

And the whole week had been a great experience for learning by mistakes. I pushed a wrong commit “Change date format” in gsoc/views/trackings shipmenttracking branch and happened to mix up the commit messages of two patches “Change date format” and “Change worksheet id”  ‘.’ I learnt these situations can be avoided with extra carefulness  while pushing the branch to remote origin.

I also thought of changing the column names in soc.modules.gsoc.tasks.trackings and not to hardcore the worksheet id in spreadsheet link. A discussion with Madhu made me clear that since Google provides us data in the particular format and the code is written according to that so I need not think about that. So the shipment tracking and sync part has been integrated successfully to melange and this week I’ll be working on Proposal Sync and hoping that I’ll make it work by this weekend.

Melange Functional Testing

Hi,

This week i worked on developing test scripts for testing Profile Page and Search Page but i spent major part of this week on developing a script for loading and running these test scripts one by one. Initially i tried to run them with bin/run-tests in soc but i was not successful and faced a lot of issues so i made a new functional-run.py script for executing these test cases one by one in my local environment and the way i want them to run.

Options that i provided in this functional-run.py script:
(1) -r  for report format, whether you want result on console(default) or you want a html based report. If you give the option like this $ python functional-run.py -r "html", a result folder is created in the functional folder where all the test scripts are saved and then it pick up all the files whose name start with "test" and executes them one by one and finally a html based report is saved in functional/results folder.

(2) -v for virtual display, if you want to execute all the scripts in virtual display. when this option is provided script.  All the scripts are executed virtually and you will not see thier execution in firefox. you will only see the final result either on console or in result report depending upon the report format you had chosen.

Currently this script is only for executing functional tests in my local environment.

Monday, June 18, 2012

Planning and Bug Fixes

So this week really hasn't been as productive as I had been hoping it would be between a rather annoying bug in dashboard and a ludicrous amount of time at work. After implementing a less-than-optimal fix where I just manually store the name of the organization for a Connection for the getListData() query in dashboard.py (~line 1270), I have reached a point where:

  • Users and org admins can view Connections that they have initiated (e.g. if a user initiates a Connection, they can view it in their dashboard but the org admin cannot view it under "Requests for My Organizations")
  • The query for the user will actually fetch all GSoCConnection objects involving the User, but will not display them all so I'm assuming it's a Javascript problem
  • The above is true for the org admin side, but I don't thing that the org_admin_for property is being set correctly because it doesn't contain a full list of the organizations that the org admin is responsible for
  • If I had to guess, I'd say that the Javascript will likely be a problem as well once I figure out the above problem.
Given that this is a demo, I think that there are a bunch of changes I'd like to make and it would be counter-productive to spend a bunch of time fixing them. Instead, I think I'm going to try and combine all of the requirements into one module with ConnectionPage and ShowConnection views. Daniel and I have worked out some changes to the Connection module that will simplify the flow of the interaction. Plus, and doing so will give me the extra control I think I need. I have a design of the two views on a legal pad sitting next to me and can either scan them or whip up a Google doc (or Wiki on Google Code) to divulge the design if anyone would like to see it. In the meantime I think I'm going to put the dashboard fix on the back burner so that I can try to work on this connection view.

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.

Monday, May 28, 2012

Initial Connection Model Implementation

Hey all, this week I've been discussing the requirements and details of the model that I'm going to be using to represent both invitations and requests between an organization and a user. We've decided on using a model called GSoCConnection containing reference properties to the organization and the user involved in the request or invitation. Within this model also resides "private" properties to represent the actions taken by either a user or an organization. For example, a user sending a request to become a mentor will cause the user state to become 'mentor_request_accepted' and the org's state to become 'mentor_request_pending', since we'll be waiting on a response. If the org accepts, their action will be changed to 'mentor_request_accepted' and the calling class will be able to call the is_mutual_acceptance() method in order to determine whether the user needs to be promoted.

Right now I've thought up as many states as I think are relevant and added them to my GSoCConnection class as constants with methods to allow for changing the state. Another approach I've been toying with is just writing out methods for each of these to encapsulate some of the logic for determining the states and chaining them with an internal set_state method. I'm going to discuss this idea with Daniel this week and possibly discuss alternatives.

The code for my first implementation of this model can be found here (not the most elegant way to share code, I know). See you next week!

Update: Changed the pastebin link to reflect change to method names per style guide and changed my strategy for supporting states

Melange Functional Testing- Base Module & Test data

Hello everyone, This week i mainly focused on creating a base module Melange_functional_actions.py for the framework. In the base module i defined a base class funcTests which consists of many other methods which will will be used in creating test scripts for different scenarios. e.g:
  1. get_parameters(name_of_workbook)
  2. write_text_field()
  3. wait()
  4. toggle_checkbox()
  5. set_dropdown_list()
  6. wait_and_check_if_displayed()
  7. wait_and_click()
  8. wait_and_enter_text()
  9. wait_and_clear_field()
  10. assert_error()
  11. assert_link()
  12. click_on()
  13. assert_text()
  14. take_screenshot()
  15. clear_field_and_enter_new_data()
  16. setUp()
  17. tearDown()
  18. login()

I am using these methods to re write the test script for Student Registration Test . Student Registration Test has three test cases.

TC01 checks the normal path of registration.
TC02 checks for error messages when empty form is submitted.
TC03 checks for messages when wrong inputs are supplied to registration form, It assert all the messages and provide correct form data for successful registration.

Test data for the test script is here.

Monday, May 21, 2012

GSoC 2012 : Extension and Integration with External APIs : Introduction

Hi,

I am Aditi Mittal,  a 2012 Google Summer of Code student working with Melange community. It has been four weeks since the GSoC result came out but I had been quite busy with exams so couldn’t remain active, thanks to Mario for keeping his cool ( ^__^ ).

I want to thank a zillion time to Madhusudan for his continuous guidance and help since the time I started with Melange and Orcun for walking me through his code which I will be extending during the summers. Every time I talk to Melange people I learn a new thing from them. This will be my first major contribution to open source community so I am very excited about it.

After getting free from exams I asked Mario for jQuery and Javascript books. I started with The Good Parts by Douglas Crockford and Javascript: The Definitive Guide by David Flanagan and for jQuery I am reading jQuery Cookbook by Cody Lindley.

During the summers I will enhance melange user interface by adding new features such as shipment tracking, proposal syncing and data export to other formats other than CSV export of melange lists. I will also be adding Picker API functionality. Carol must be liking it :-) .

I attended the G+ hangouts(Melange conference call) and it was a unique experience talking to all the Melange members. It was like all of us were sitting in one room and discussing the project.

Talking to very experienced and supporting mentors has already strengthened my morale.
I will talk to Orcun for better understanding of his code and Mario to give the project a real start.

I can’t keep myself less excited as this going to be one of the most productive summer of my  life!!




Sunday, May 20, 2012

Melange Functional Testing


Hi everyone, my name is Syed Armani. This summer i will be working with Melange community as a student  under Google Summer of Code.

I am  very happy that i am working with melange community this summer. Its a pleasure to work with people like Chong Liu, Sverre, Lennard, Madhu, Mario and many others. Madhu is a very nice person and Lennard is always there when you need help. Leo is a great guy and i am thankful to him that he chose me for this project. Till now i have not got enough chance to speak with other members of the community, i hope to meet them soon and  I really love the cool t-shirts that Sverre and Lennard wear in G+ Hangouts.

This summer i will be working on creating a  Data Driven Framework for Functional Testing of  Melange. A test suite consisting of all the possible test cases covering all the possible scenarios of using melange application. Test scripts for executing the test cases will be written in python and executed using Selenium Webdriver. The proposed test suite of functional tests will consist of Test cases and test data, User actions and assertions in Python, Data parametrization, Headless (xvfb) mode , Screenshots on errors.

I will write test scripts for various scenarios as "user stories".  A story depicting how a user interact with GSoC and GCI apps. We will use xlrd module to read the cells of excel sheet, these cells will contain the unique identity of the objects present in the application as well as there values, The values will be taken from the cells and they will be used to fill the forms. Assert statements will check the presence of various error messages, headings, title and text present on the pages.  Test output can be displayed to the console or saved as an HTML report. If any of the test fails a screen shot will be taken on failure to see where the test failed.

Functional test cases will be included for both GSoC & GCI applications:

GSoC:  Melange Home Page, Student Registration Page, Mentor Registration Page, Login Page, My Profile Page, My Dashboard Page, About Page, Events and Timeline Page, Connect With Us Page, Search Page, FAQ page.

GCI:  Home Page, My Dashboard, Register As Student, Events and Timeline,  The official Leader board, Tasks Page, Login, Invites to me

Monday, May 7, 2012

GSoC 2012 Introduction

Hi, my name is Andrew (Drew) Rodman and I'm going to be working as a student for Melange this summer as my Google Summer of Code Project.

I'm excited to work with my mentor Daniel Hans, Lennard, Sverre, Madhu, and all of the other contributors that I have not yet had the opportunity to meet. I'll be working on rebuilding the invite and request modules for both gsoc and gci more or less from scratch in order to take into account issues that have arisen so that they can be eliminated without requiring heavy patching. I'll also be doing a little bit of template design work in order to make it more apparent how to invite mentors and organization admins to a program. I have worked previously with Google App Engine and have refreshed and expanded my knowledge by re-reading the GAE Python 2.7 docs regarding the datastore. I am also reasonably familiar with the Django framework and am currently in the process of figuring out "the big picture," or improving my conceptual overview of how Melange works. I'm also working on determining the specific requirements of the invite and request modules that I'll be working on since Daniel asked me not to look at the current implementation.

I'm excited to start this project and even more so to be working with a community of incredibly proficient developers in order to improve my own skill-set and hopefully make some friends within the Open Source world...in addition to gaining a long-term project to which I can contribute after the program ends.