Skip to main content

Sepia: How LinkedIn Mobile Made Integration Testing Fast and Reliable in Node.js

Avik Das (LinkedIn)
Mobile Platforms
Portland 251
Average rating: ***..
(3.33, 3 ratings)

LinkedIn Mobile runs a node.js server powering clients on three platforms: iPhone, Android and mobile web. The server aggregates data from downstream services using HTTP, services such as Voldemort data stores and rest.li web services. At first, emulating a client and exercising the server API made sense to validate the server. As the integration test suite expanded to over 200 tests, and the number of developers grew, the test suite became too slow and unreliable to depend on. The downstream HTTP requests incurred network latencies and were subject to the health of the downstream services. This talk walks through how LinkedIn is addressing the challenges of scaling a complex testing infrastructure in order to release quality code, and how we developed a open-source tool called sepia to help other companies do the same.

  • The LinkedIn Mobile Architecture
  • The server API, downstream HTTP requests
  • The integration test suite
  • Why the integration test suite is unreliable
  • Old attempts and a solution
  • Why vcr.js doesn’t address our use case
  • Why not shim http#request?
  • Recording fixtures and playing them back
  • Fixture resolution edge-cases
  • Non-repeatable data in HTTP requests
  • Non-referentially transparent HTTP requests
  • Success!
  • Battle-testing sepia
  • Supporting multiple authentication schemes
  • Caching old fixtures, recording new ones
  • Bypassing fixtures for certain HTTP requests
  • Test-specific fixture directories
  • How YOU can use sepia to make your software more robust
Photo of Avik Das

Avik Das

LinkedIn

I graduated from UC Berkeley with Bachelor’s degrees in EECS and Math, and have since worked at LinkedIn as a software developer. I currently am the lead for the server that powers the LinkedIn iPad application.

In my free time, I love working out, and when I find the time, I like to dabble in cooking.

Leave a Comment or Question

Help us make this conference the best it can be for you. Have questions you'd like this speaker to address? Suggestions for issues that deserve extra attention? Feedback that you'd like to share with the speaker and other attendees?

Join the conversation here (requires login)

Comments

Picture of Avik Das
07/21/2014 10:58am PDT

Hi Yong. My understanding of your project is that it mocks out the server the tests connect to. If you look at the Motivation section of the README for sepia (https://github.com/linkedin/sepia#motivation), you’ll see that the architecture sepia targets a little different, in that the server is the one being tested, and so it can’t be mocked out.

Your project looks quite interesting (I like the detailed documentation), but unfortunately, in investigating similar tools, I found that they didn’t meet our needs, which is why I developed sepia in the first place.

07/20/2014 4:43pm PDT

I’m also working on projects intended to steer people away from WebDriver, and write tests that can be run in a browser. http://yguan.github.io/repos/presentations/index.html?name=browser-automation#/

07/20/2014 4:40pm PDT

Didn’t know about Sepia until now. I’m also building something similar, but more focus on service virtualization. https://github.com/yguan/http-replay-server