Tuesday, August 21, 2012

Melange Functional Testing


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


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


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.