Your SlideShare is downloading. ×
Building and testing a desktop application written in Python
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Building and testing a desktop application written in Python

1,300
views

Published on

This presentation at OSDC 2013 discusses building and testing under CI a desktop application written in Python using Qt, nose and Jenkins.

This presentation at OSDC 2013 discusses building and testing under CI a desktop application written in Python using Qt, nose and Jenkins.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,300
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. OSDC 2013 - Paris Building and testing under CI a desktop application written in Python using Qt, nose and Jenkins Antoine Taillefer ataillefer@nuxeo.com
  • 2. 2 About me – Antoine Taillefer • Graduated from ENSEEIHT in 2006 • Worked for 5 years for an Open source solutions integrator • Working at Nuxeo since 2011 ✔ Software engineer ✔ Involved in consulting / training • Languages : ✔ Java ✔ Python
  • 3. 3 Agenda • Introduction: Nuxeo & Nuxeo Drive • Nuxeo Drive architecture • Coding session • Build and continuous integration • Roadmap
  • 4. 4 Introduction
  • 5. 5 Useful links • Source code: github.com/nuxeo/nuxeo-drive • Documentation: doc.nuxeo.com • Continuous integration: qa.nuxeo.org • Backlog: jira.nuxeo.com - "Nuxeo Drive" • Nuxeo: nuxeo.com / nuxeo.org
  • 6. 6 Nuxeo Platform • Open source content management platform • Repository available through: ✔ Web user interface ✔ REST services (Nuxeo Drive) ✔ Shell • Java based ● Modular and extensible => build business apps ● Configuration tools: Nuxeo Studio / Nuxeo IDE
  • 7. 7 Demo
  • 8. 8 Nuxeo Drive • Fully open source, on Github, LGPL • Desktop client for Nuxeo • Available for Windows and OS X • Roundtrip synchronization • Selection of the folders to synchronize • Synchronization of any type of content • Conflict management (allows offline work) • Quick edit
  • 9. 9 Main features • Command line • Systray GUI • Background synchronization • Robust to network errors: goes offline • Token based authentication + revocation • Multiple server bindings
  • 10. 10 Demo
  • 11. 11 Architecture
  • 12. 12 Server-side • Addon for Nuxeo • Token authentication service • Change detection based on audit log • Pluggable service layer • REST API: basic operations ✔ getChanges() ✔ downloadFile() ✔ createFile()
  • 13. 13 Client-side • UI thread / Synchronization thread • Local storage: maintain pair states • Token based authentication • Local file system client • Remote HTTP client (JSON) • Synchronization: infinite loop ✔ Polling for remote changes ✔ File system scan for local changes ✔ Resolution and synchronization
  • 14. 14 Main libraries • Threading: threading • Command-line : argparse • GUI: PyQt4 (GPL) • Storage / ORM: sqlalchemy • OS detection: sys • File system: os • HTTP exchanges: urllib2, json, poster • Logging: logging • Testing: nose
  • 15. 15 Coding session
  • 16. 16 Dev tools • git • vi / Sublime Text / Eclipse + PyDev • nose (+ ipdbplugin) / PyUnit • Jenkins
  • 17. 17 Test Driven Development (TDD) • Goal: PDF conversion of locally synchronized files • Steps : ✔ Write test scenario ✔ Write test ✔ Run it with nose / PyUnit => should fail ✔ Implement feature ✔ Run test again => should succeed
  • 18. 18 GUI with PyQt • Goal: add menu entry to open the PDF conversion output folder • Steps: ✔ Code function ✔ Add menu action ● Testing the PyQt GUI? ✔ Simulating clicks with PyQt API by sending signals ✔ PyQt QTest + unittest ✔ TDriver ✔ Squish
  • 19. 19 Build under continuous integration
  • 20. 20 Goal • Build standalone binary packages ✔ For Windows: .msi ✔ For OS X: .dmg ● Embed Python, Qt, PyQt and all required libraries ● Don't interfere with already installed packages
  • 21. 21 Build environment setup • Install Python 2 (using Homebrew for OS X) • Install Qt / PyQt ✔ Linux: sudo apt-get install python-qt4 ✔ OS X: sudo brew install pyqt ✔ Windows: install binary package ● Install pip with setuptools: sudo easy_install pip ● Install freeze program ✔ Os X: pip install py2app ✔ Windows: install cx_Freeze
  • 22. 22 Application freeze • Clone nuxeo-drive from Github git clone https://github.com/nuxeo/nuxeo-drive.git ● Grab dependencies sudo pip install -r requirements.txt • Run freeze • Windows python.exe setup.py --freeze –dev bdist_msi • OS X python setup.py py2app sh tools/osx/create-dmg.sh
  • 23. 23 Demo
  • 24. 24 Continuous integration • Jenkins • Several jobs ✔ Build Nuxeo addon with Maven ✔ Freeze for Windows => msi ✔ Freeze for OS X => dmg ✔ Functional tests (depends on previous jobs) ➔ Launch Nuxeo server with Drive addon ➔ Run tests with nose
  • 25. 25 Roadmap
  • 26. 26 Nuxeo 5.8 • HTTP proxy • Handle readonly documents • GUI improvements ✔ Unified settings menu ✔ Home folder configuration ✔ Status icon ✔ Last synchronization date
  • 27. 27 Nuxeo 5.x • GUI improvements ✔ Notifications ("10 files synchronized in 8 seconds") ✔ Recently modified files ✔ Suspend synchronization ✔ Multiple server bindings • Versioning and auto-upgrade • Explorer / Finder decoration + Right click • Optimization of local changes detection
  • 28. 28 Questions