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