Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: November 2008

Joe Moore

Standup 11/20/2008: Engine Yard ssh key changes

Joe Moore
Friday, November 21, 2008

Interesting Things

  • Engine Yard has made some changes to their ssh-key setup:

    …any non-approved keys will be removed from the root user’s
    authorized_keys file. It should be noted that customers should not log
    in directly as root but rather should log in as their user and use
    sudo for any commands that need super user privilege. If you are
    currently using the root user to log in and have your key in roots
    authorized_keys file it will be removed when this change is made.

    If you are having any ssh problems, contact them.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

Standup 11/19/2008: Team Strength, Fixtures, and Pivot Pong

Joe Moore
Thursday, November 20, 2008

Interesting Things

  • Pivotal Tracker tip: as the Holiday Season approaches, you can edit your Team Strength to account for vacationing team members. For example, if you are missing 1 out of a team of 4 next week, set next week’s Team Strength to 75%

    Pivotal Tracker team strength

  • Rescuing inside a transaction: ActiveRecord relies on catching a Rollback error in order to perform transaction rollbacks. If you are performing a begin..rescue block within a transaction, make sure you either (a) specify the Exception or Errors you want to catch, or (b) re-raise the Rollback error if caught.

  • Bring it! The Pivot Pong Tournament of Champions is on! Games will be played on the Pivotal breakfast tables/ping pong table.

    Pivot Pong table

Ask for Help

“What is the life-cycle of test fixtures when using transactional fixtures?”

  1. The testing framework clears the database of all data within tables that have fixtures files defined.
  2. A test/spec file is loaded and all fixtures declared within it (or all if fixtures :all is declared) are loaded into the database.
  3. A transaction is started.
  4. The test/spec runs.
  5. The transaction is rolled-back.
  6. Repeat!
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

Standup 11/18/2008: Unbelievable has_many :through Gotcha

Joe Moore
Tuesday, November 18, 2008
  • One team discovered a jaw-dropping issue with has_many :through. Given the following:

    class User < ActiveRecord::Base
      has_many :user_photos
      has_many :photos, :through => :user_photos
    
    • a_user.photos.create will create and persist both a Photo object and the UserPhoto join object
    • photo = a_user.photos.build followed by photo.save will create and persist the Photo object only, and will not persist an appropriate UserPhoto join object.
  • Rails 2.2: Test::Unit::TestCase extentions have been removed from Rails Core and are now in ActiveSupport::TestCase. As stated in the Groups Thread about this, use ActiveSupport::TestCase instead of Test::Unit::TestCase in test/test_helper.rb.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Chad Woolley

Notes on Google Chrome Compatiblity

Chad Woolley
Tuesday, November 18, 2008

Pivot Jonathan and I were recently working on support for Google Chrome in Pivotal Tracker. Tracker’s extensive JsUnit test suite made this a lot easier.

Here’s some quick notes I took on the issues we ran into.

Don’t try to directly mock the ‘reset’ method on a Form Element

This was the original mocking code in one of our JsUnit tests:

var resetCalled = false;
widget._uploadForm.reset = function() { resetCalled = true; };

This permanently blew away the “reset” method, so it was undefined when called in a subsequent. To fix it, we did this in our form builder method:

var element = Element.create("form");
element.nativeReset = element.reset;
element.reset = function() { element.nativeReset() };

Hash keys sort differently

We had a testHash.keys() being compared to a hardcoded array. Chrome sorted the keys differently (apparently non-deterministically, so we had to do an explicit sort:

assertArrayEquals(['10001', '10002', '10003', 'endOfList'].sort(), $H(itemListWidget.draggables).keys().sort());

It wasn’t good to depend on the keys order in the first place, but it worked under IE, Firefox, and Safari.

The same hash sorting bug bit us in a much more obscure way. There was some threading test code that simulated timeouts/concurrency using a mock clock. Previously, the test code was dependent on the order in which the functions were added to a hash the mock “clock”. This broke with a different hash sorting order. We had to simulate some additional “ticks” to make the test pass.

Mozilla, but not Gecko

The browser string returned for Chrome by one of our utility functions, BrowserDetect.browser(), is “Mozilla”. However, for some of our simulated keypress events in tests, the “Gecko” version did not work.

Specifically, we had to use “KeyboardEvent” instead of “KeyEvents”, and “initKeyboardEvent” instead of “initKeyEvent”. See the table in this mozilla doc page.

Here’s the code we used to handle both cases:

evt = document.createEvent('KeyboardEvent');
if (typeof(evt.initKeyboardEvent) != 'undefined') {
  evt.initKeyboardEvent(eventName, true, true, window, false, false, false, false, options.keyCode, options.keyCode);
} else {
  evt.initKeyEvent(eventName, true, true, window, false, false, false, false, options.keyCode, options.keyCode);
}

The UserAgent (request.user_agent) returns

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.3.154.9 Safari/525.19

The ‘sort’ function does not preserve order of equivalent elements

The following page outputs ‘ACBD’ under Chrome:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<a href="#" onclick="alert(doSort()); return false;">Sort</a>
<script type="text/javascript">
  function doSort() {
    var myArray = [
      {id: "A", sortVal: 0},
      {id: "B", sortVal: 1},
      {id: "C", sortVal: 1},
      {id: "D", sortVal: 2}
    ];
    var sorted = myArray.sort(function(a,b) {return a.sortVal - b.sortVal});
    return sorted[0].id + sorted[1].id + sorted[2].id + sorted[3].id;
  }
</script>
</body>
</html>
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

Standup 11/17/2008: Google Chrome Gotchas

Joe Moore
Monday, November 17, 2008

Interesting Things

  • We recently updated Pivotal Tracker‘s extensive JSUnit test suite to be compatible with the Google Chrome browser. Check out the extensive Notes on Google Chrome Compatiblity post by Pivot Chad.

  • ActiveScaffold + Rails 2.2 = BOOM. ActiveScaffold will work with Rails 2.1 if you get the version from github. Read about it.

  • Rails 2.2 + Rspec 1.11 = FAIL
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Plaxo

Monday, November 17, 2008 | Run time: 47:30

Joseph Smarr from Plaxo discusses the rise of the Social Web and the sites and tools that enable it.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Adam Milligan

Why is the sky blue? When does the wind blow? Why do tests fail?

Adam Milligan
Monday, November 17, 2008

Here’s an interesting mental exercise that recently I’ve found more and more valuable:

  1. Test drive your code (duh).
  2. Before each time you run your tests, no matter how small the changes you’ve made, ask yourself why the tests will fail. Don’t just gloss over this; be explicit. Say it out loud or write it down, if that helps. If you have a pair, tell your pair.

You might be surprised how often your assumptions turn out wrong. And, you might be surprised what you learn when you explicitly state those assumptions and then have to justify them when they do turn out wrong.

If you don’t test drive, or you don’t always test drive, (and you’re still reading), ask yourself this: what happens those times when my assumptions are wrong and I don’t have tests to protect me?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Meshing Gears

Monday, November 17, 2008 | Run time: 1:26:46

William Pietri and Amanda Willoughby revisit their Agile2008 talk “Meshing Gears: Real-world examples of how design and development integrate – and fail to”

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Project Startup: Competitive Strategy

Monday, November 17, 2008 | Run time: 1:11:12

Hosted by Pivotal Labs and VentureArchetypes.

Moderated panel discussion: Competitive strategies & tactics (offensive vs. defensive…e.g., first mover vs. fast follower), Dealing with copy cats, both domestic and international, Standing out in a crowded space when resources are limited, Creative competitive research, analysis and tracking

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

DTrace

Monday, November 17, 2008 | Run time: 29:28

Brian Cantrill and Adam Leventhal from Sun Microsystems give a talk on the dynamic tracing framework, DTrace.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (778)
  • rails (113)
  • testing (86)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (54)
  • techtalk (44)
  • rspec (38)
  • activerecord (29)
  • productivity (29)
  • gogaruco (29)
  • ironblogger (29)
  • git (28)
  • nyc (27)
  • rubymine (25)
  • mobile (22)
  • bloggerdome (20)
  • cucumber (20)
  • process (19)
  • pivotal tracker (19)
  • jasmine (19)
  • design (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • selenium (12)
  • css (12)
  • goruco (12)
  • bundler (12)
  • tdd (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • rubygems (9)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >