March 9, 2015
Andrii Dzynia Software Engineer in Quality
@adzynia
Hermetic environment for your
functional tests
2Spotify brings you the right music for
every moment!
Over 20,000 songs added every day
Started in 2006 (in Sweden)
Now 1500+ employees, 600+ engineers
5(STO, GBG, NYC, BOS, SF) engineering offices
Over 30 million songs available
Over 60 million active usersOver 15 million paying subscribers
3
https://labs.spotify.com/2013/03/15/backend-infrastructure-at-spotify/
High level architectural view
Persistent Test Environment4
you are not the only one who is using it test failures not always repeatable test data can be easily messed up
5
synchronise testing efforts between teams create environment for every team/person test in production
Hard way of solving test environment problem
8
Docker @ Spotify
https://gigaom.com/2015/02/22/how-spotify-is-ahead-of-the-pack-in-using-containers/https://blog.docker.com/2014/06/dockercon-video-docket-at-spotify-by-rohan-singh/
9
Helios Framework (c) Spotify
https://github.com/spotify/helios
Helios is a Docker orchestration platform for deploying and managing containers across an entire fleet of servers. Helios provides a HTTP API as well as a command line client to interact with servers running your containers. It also keeps history of events in your cluster including information such as deploys, restarts and version changes.
Not only for ‘selenium’ tests13
hermetic environment for verifying back-end services hermetic environment for verifying infrastructure jobs hermetic environment for verifying consumer clients*
*proof of concept only
Pros vs Cons
More deterministic test results
Repeatable test failures Decreased system failure
localisation time
Increased test run time Data sets are smaller than
in production
14
Alternatives15
Stub implementations
Mock servers
https://adamcod.es/2014/05/15/test-doubles-mock-vs-stub.html
16
Take AwaysConsider using container technologies Create test environment on-the-fly Check out Helios Framework
No silver bullets. Just an alternative to Mocks and Stubs.
https://github.com/spotify/helios