PyMNtos number 3

Posted in Uncategorized on May 22nd, 2009 by varikin

Last Thursday* was the 3rd PyMNtos meeting.

Kevin Marshall gave a good talk on using Windmill to test through the browser. Windmill makes testing through the browser extremely easy by recording what you do in the browser to Python files. Then you can automate running those tests to ensure all Ajax/Javascript/etc works correctly on different platforms and browsers. If you are not testing through the browser, one way or another, you should.

After that, Matt Westerburg gave a talk on meta classes. Who knew Python was so powerful! For those that don’t know, meta classes allow you specific how a class is created. Not to be confused with __init__ which is how class instances are created. It is all very meta, which is rather suiting.

There are plans for 3 topics at the next meeting.

  • Matt Westerburg will give a more indepth talk on meta classes
  • I (John Shimek) will talk about virtualenv and virtualenvwrapper
  • Nick Bauman will be talking about Pyjamas

There was more talked about, but it is hard to remember everything since I am bad about posting these things on time. It was a great time, and I hope the next meeting will be as well.

*If I would have finished this post on time, last Thursday would have been correct, but I didn’t so it isn’t. In fact, it was May 18, 2009, which is Thursday of last week.

Tags: , , ,

How To Be More Productive

Posted in Uncategorized on May 12th, 2009 by varikin

At work recently, our team was asked what would make us more productive. I said drop ClearCase and embrace something, anything better. My manager asked what Git (my preferred tool) has to offer that would make us more productive. I replied with the normal things like generally faster and branching.

Today’s Lack of Productivity:

A coworker and I were working on something that had to be added to another group’s code. We had about 4 new files and 4 changed files. The procedure is to create a branch, check-in, have the other group review, and merge to main. Due to the painfulness of branches in ClearCase, we had been hijacking the files and emailing them between ourselves for a couple days. Today was the day to bite the bullet and create the branch.

The ClearCase Process:

We created the branch with the command:

cleartool mkbrtype -nc -pbranch my-shiny-new-branch

Then we updated our config specs to pull in files off the branch and to add files to the branch when checking out. Then we waited 30 minutes for our views to update. Then I tried to checkout a file I had changed to the new branch. The branch didn’t exist on the VOB. We had accidently created the branch on the wrong VOB. Time to run the command to create the branch again but in the correct VOB.  At this time, I checked out some files I had hijacked and check them in on the new branch.

Then I move on to the new files. I checked out a directory and tried to add one file to ClearCase. It sort of succeeded, except where it lost my file. Any time I tried asking ClearCase the status of the file or directory, it complained that the file is not specified in my config spec, so it can’t tell me anything. It lost my file! I couldn’t check-in, I couldn’t delete it, and try again (never try this with ClearCase, it does not like it). I pulled up my dynamic view, played around with the config spec for a bit, and still didn’t find the file. I went back to the snapshot view and checked in the folder. Now the dynamic view could find the file. It was not on the branch and it was empty. I updated the config spec so it I could check it out in the dynamic view onto the branch. I copied everything into the file, and checked it in. Updated the folder on the snapshot view, and viola, my file appeared.

I spend another 45 minutes fiddling away like this with the rest of the files. One by one, adding them through the slow as molasses dynamic view, updating a folder in the snapshot view.

The last thing I had to do was recompile everything and test to ensure I got the right versions of every file checked in. Then I sent an email to my manager telling her how this is much easier in Git.

The Git Process:

We started with some new files and some changed files. From there I could run following commands:

git branch my-shiny-new-branch
git checkout my-shiny-new-branch
git commit -a

And then celebrate the wonderfulness of Git!

The Ultimate Conclusion:

Branching is incredibly difficult in ClearCase. I had a mistake in my config spec; I was missing “element * /main/0″ at the bottom, and I lost over 2 hours because of it. If I had been using Git, I would not need a config spec, I could branch lightening fast, and be done in 5 minutes. Even if I ran into no problems in ClearCase, it was still an hour task! I doubt we will move off of ClearCase anytime soon, but it I can feel the rumble of a change coming. I just hope it is for the better.

Note: I prefer Git, but I have nothing against the other VCS; I just want to be done with ClearCase.

Tags: ,