Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Who's testing your infra

Who's testing your infra

Server infrastructure has traditionally lagged far behind our development practices in terms of code quality, testing, continuous integration and continuous development.

When you write your Chef recipes or Puppet manifests or any other CM, you are coding, and every code is prone to defects. All of us understand the benefits of test-driving the application code. The same applies to your infrastructure code. Testing becomes even more significant in case of deployments spanning large clusters of nodes.

Test-driving allows the infrastructure teams to have confidence that their configuration changes are being applied as intended across many different systems, and having the intended effect. This allows the whole system to be trusted, and then updated without fear for introducing breaking changes or otherwise causing instability.

Pooja Salpekar

December 23, 2014
Tweet

More Decks by Pooja Salpekar

Other Decks in Technology

Transcript

  1. What  did  we  miss?   Tests!   •  Do  I

     need  to  test  infra?   •  How  do  I  test?   •  When  is  the  right  )me  to  write  tests?  
  2. Tes)ng  Strategies     •  Unit  tes)ng   •  Integra)on

     tes)ng   •  A/c  tests  on  target  machine   •  Seman)c  monitoring            
  3. User  Story1     As  a  user,     I

     want  to  setup  5  node  servers  with  Ruby  and  Nginx   installed,   so  that  my  web  applica)on  can  run  seamlessly  on   them.    
  4.   •  Steps:   – Setup  vagrant   – Write  test  to

     verify  if  ruby  and  nginx  is  installed   – See  the  test  fail   – Write  the  code  to  install  ruby  and  nginx   – Green  build!  J   User  Story1  
  5. User  Story2     As  a  user,     I

     want  to  setup  2  postgres  servers   so  that  my  web  applica)on  data  is  persisted.    
  6.   •  Steps:   – Setup  vagrant   – Write  test  to

     verify  if  postgresql  is  installed   – See  the  test  fail   – Write  the  code  to  install  postgresql   – Green  build!  J     User  Story2  
  7. But,  remember  to   •  Put  infra  code  through  build,

     Qa/tes)ng  and  produc)on  along   with  app  code   •  Model  your  infra  code  beWer.  Use  design  paWerns   •  Test  con)nuously   •  Employ  infra  monitoring  for  tes)ng  and  preproduc)on   environments   •  Don’t  ignore  refactoring.