pycon 2013 test driven infrastructure

7
Test Driven Infrastructure www.immobilienscout24.de Köln | 16.10.2013 | Schlomo Schapiro Systemarchitekt, Open Source Evangelist License: http://creativecommons.org/licenses/by-nc-nd/3.0/

Upload: schlomo-schapiro

Post on 08-May-2015

497 views

Category:

Technology


0 download

DESCRIPTION

Test Driven Infrastructure (with examples in RPM packages). How to save your butt by adding a few cheap and simple tests to your packages. Use visudo to validate sudo configuration (sudo will stop to work with broken configs!). Use bash and python to validate scripts against typos, forgotton braces etc. I gave this talk at the PyConDE 2013 (https://2013.de.pycon.org/), Original video with all lightning talks is http://pyvideo.org/video/2438/mittwoch-lightning-talks

TRANSCRIPT

Page 1: PyCon 2013 Test Driven Infrastructure

Test Driven Infrastructurewww.immobilienscout24.de

Köln | 16.10.2013 | Schlomo SchapiroSystemarchitekt, Open Source Evangelist

License: http://creativecommons.org/licenses/by-nc-nd/3.0/

Page 2: PyCon 2013 Test Driven Infrastructure

Untested=

Broken

Page 3: PyCon 2013 Test Driven Infrastructure

%prep%setup -q

%installinstall … %{buildroot}/…install … %{buildroot}/…

%files%defattr(-,root,root,-)/...

Page 4: PyCon 2013 Test Driven Infrastructure

BuildRequires: sudo%buildset -evisudo -c -f sudoers %installinstall -m 0440 sudoers -D \ %{buildroot}/etc/suoders.d/%{name} %files%defattr(-,root,root,-)/etc/suoders.d/%{name}

Page 5: PyCon 2013 Test Driven Infrastructure

BuildRequires: PyYAML, pylint%buildset -e# syntax checksbash -n my_script.sh# Should be valid python codepylint -E yum-repo-propagate# should be valid YAML filepython -c "import yaml yaml.safe_load( open('config.yaml') )"...

Page 6: PyCon 2013 Test Driven Infrastructure

RPM Build Jobs (Unit Tests) Build RPM_1 and upload to DEV YUM Repo

Build RPM_2 and upload to DEV YUM Repo

...

FOO Integration Test Job yadtshell update DEVFOO

rsh devfoo99 run-some-local-tests

curl http://devfoo99/deep-status

yum-repo-propagate -y DEVFOO -d PRO RPM_1 RPM_2

Update FOO in Production

Continuous Delivery

Page 7: PyCon 2013 Test Driven Infrastructure

8

Kontakt:Immobilien Scout GmbHAndreasstraße 1010243 Berlin

Fon: +49 30 243 01-1229 Email: [email protected]: www.immobilienscout24.de

Thank you very much!Please contact me for further questions and discussions.

All images are either public domain, used in appropriate context or taken from openclipart.org