SlideShare a Scribd company logo
1 of 33
Continuous Integration
   For Rails Project
       IN-SRC Studio
        Louie Zhao
Continuous Integration

• A software development practice
  where members of a team integrate
  their work frequently
• Each integration is verified by an
  automated build (including test)
• significantly reduced integration
  problems
Firefox Tinderbox
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox
Continuous Integration
• Maintain a code repository
• Automate the build
• Every commit should be built
• Make the build self-testing
• Keep the build fast
• Everyone can see the results
CI Solutions for Rails


• CruiseControl.rb             http://cruisecontrolrb.thoughtworks.com/



• Cerberus    http://cerberus.rubyforge.org/



• Run Code Run           http://runcoderun.com/



• Integrity   http://integrityapp.com/
Integrity


• light-weighted
• easy to configure
• good support for git
• works on our own install.
Integrity
                                           Production


developer   Git Push
                              git
                                           Build Notification
developer                  repository
developer
developer                                   CI Server
                       Email Notification
Integrity - Installation

• Server Configuration
 • SUSE Linux
 • Apache
 • Passenger
 • MySQL 5.x
Integrity - Build

• The building environment is almost
  identical to your development
  environment

 • Standalone CI server
 • DB Server
 • rake ci WITH_PACKAGE_TEST=1
Integrity - Installation
 http://www.in-src.com/continuous_integration_for_rails_project




• $ gem install --passenger integrity
• $ integrity install [integrity-diretory]
• $ integrity migrate_db config.yml
Integrity - Source


• local git repository
  •   /var/git/[project-name].git



• remote git repository
  •   ssh://[user]@[hostname]/var/git/[project-name].git
Integrity - Git Hook Up


• git post-receive
• POST_RECEIVE_URL
• Daemons
Integrity - Email
  Notification
Integrity - Build
Integrity - Build
Integrity - Build
Integrity



• Trouble Shooting
   • http://www.in-src.com/
      continuous_integration_for_rails_project
Metric Fu

• a set of rake tasks
• Saikuro, Flog, Flay, Rcov, Reek, Roodi
• sudo gem install jscruggs-metric_fu
• rake metrics:all
• generate metrics reports
Metric Fu - Configuration
Metric Fu
Rcov
Rcov
Churn
Flay
Flog
       The higher
       the score, the
       harder it is to
       test
Flog
    Code                   Seen as flog                        flog report

class Test          class Test                                Test#blah: (11.2)
 def blah            def blah           # 11.2 =                 6.0: eval
   a = eval "1+1"      a = eval "1+1"   # 1.2 + 6.0 +            1.2: branch
   if a == 2 then      if a == 2 then   # 1.2 + 1.2 + 0.4 +      1.2: ==
     puts "yay"          puts "yay"     # 1.2                    1.2: puts
   end                 end                                       1.2: assignment
 end                 end                                         0.4: lit_fixnum
end                 end
Reek

• detects common code smells
                              might be hard to read,
 •   Class Variable           maintain or evolve,
 •   Control Couple           rather than things
                              that are specifically
 •   Data Clump               wrong

 •   Duplication
 •   Feature Envy
 •   Large Class
 •   Long Method
 •   Long Parameter List
 •   Nested Iterators
 •   Simulated Polymorphism
 •   Uncommunicative Name
 •   Utility Function
Reek
Duplication                       Feature Envy

def double_thing()                class Cart
  @other.thing + @other.thing       def price
end                                   @item.price + @item.tax
                                    end
                                  end



def double_thing()                class Cart
  thing = @other.thing              def price
  thing + thing                       @item.price_with_tax
end                                 end
                                  end

                                  class Item
                                    def price_with_tax
                                      price + tax
                                    end
                                  end
Reek
Roodi
Roodi
• warns you about design issues
 •   AssignmentInConditionalCheck

 •   CaseMissingElseCheck

 •   ClassLineCountCheck

 •   ClassNameCheck

 •   CyclomaticComplexityBlockCheck

 •   CyclomaticComplexityMethodCheck

 •   EmptyRescueBodyCheck

 •   ForLoopCheck

 •   MethodLineCountCheck

 •   MethodNameCheck

 •   ModuleLineCountCheck

 •   ModuleNameCheck

 •   ParameterNumberCheck
Stats
Thank You!
louiezhao@in-src.com

More Related Content

What's hot

A Taste of Pharo 7.0
A Taste of Pharo 7.0A Taste of Pharo 7.0
A Taste of Pharo 7.0
ESUG
 

What's hot (20)

JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch API
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Dynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesDynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection Promises
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Fast C++ Web Servers
Fast C++ Web ServersFast C++ Web Servers
Fast C++ Web Servers
 
Adobe AEM - From Eventing to Job Processing
Adobe AEM - From Eventing to Job ProcessingAdobe AEM - From Eventing to Job Processing
Adobe AEM - From Eventing to Job Processing
 
EVOLVE'13 | Enhance | Eventing to job Processing | Carsten Zeigler
EVOLVE'13 | Enhance | Eventing to job Processing | Carsten ZeiglerEVOLVE'13 | Enhance | Eventing to job Processing | Carsten Zeigler
EVOLVE'13 | Enhance | Eventing to job Processing | Carsten Zeigler
 
React Native Evening
React Native EveningReact Native Evening
React Native Evening
 
A Taste of Pharo 7.0
A Taste of Pharo 7.0A Taste of Pharo 7.0
A Taste of Pharo 7.0
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
SP24S053 Introduction to PowerShell for SharePoint Developers and AdministratorsSP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
 
The dark side of Akka and the remedy - bp.scala meetup
The dark side of Akka and the remedy - bp.scala meetupThe dark side of Akka and the remedy - bp.scala meetup
The dark side of Akka and the remedy - bp.scala meetup
 
The dark side of Akka and the remedy
The dark side of Akka and the remedyThe dark side of Akka and the remedy
The dark side of Akka and the remedy
 
Testing swagger contracts without contract based testing
Testing swagger contracts without contract based testingTesting swagger contracts without contract based testing
Testing swagger contracts without contract based testing
 
Inter-Sling communication with message queue
Inter-Sling communication with message queueInter-Sling communication with message queue
Inter-Sling communication with message queue
 
2014-02-20 | Akka Concurrency (Vienna Scala User Group)
2014-02-20 | Akka Concurrency (Vienna Scala User Group)2014-02-20 | Akka Concurrency (Vienna Scala User Group)
2014-02-20 | Akka Concurrency (Vienna Scala User Group)
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
 
Testing Automaton - CFSummit 2016
Testing Automaton - CFSummit 2016Testing Automaton - CFSummit 2016
Testing Automaton - CFSummit 2016
 
Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJS
 

Similar to Continuous Integration For Rails Project

Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1
Yi-Huan Chan
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02
Kdeepapal Mishra
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 

Similar to Continuous Integration For Rails Project (20)

Selenium Tips & Tricks - StarWest 2015
Selenium Tips & Tricks - StarWest 2015Selenium Tips & Tricks - StarWest 2015
Selenium Tips & Tricks - StarWest 2015
 
Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Basic Selenium Training
Basic Selenium TrainingBasic Selenium Training
Basic Selenium Training
 
Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02
 
Workshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects - phpdublinWorkshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects - phpdublin
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Rails 3 (beta) Roundup
Rails 3 (beta) RoundupRails 3 (beta) Roundup
Rails 3 (beta) Roundup
 
Ruby On Rails Pitfalls
Ruby On Rails PitfallsRuby On Rails Pitfalls
Ruby On Rails Pitfalls
 
Building XWiki
Building XWikiBuilding XWiki
Building XWiki
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
Lecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdf
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
Refactoring Workshop (Rails Pacific 2014)
Refactoring Workshop (Rails Pacific 2014)Refactoring Workshop (Rails Pacific 2014)
Refactoring Workshop (Rails Pacific 2014)
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
 
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to IntegrateDeveloper testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
 
Rethinking Testing
Rethinking TestingRethinking Testing
Rethinking Testing
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 

Continuous Integration For Rails Project

  • 1. Continuous Integration For Rails Project IN-SRC Studio Louie Zhao
  • 2. Continuous Integration • A software development practice where members of a team integrate their work frequently • Each integration is verified by an automated build (including test) • significantly reduced integration problems
  • 4. Continuous Integration • Maintain a code repository • Automate the build • Every commit should be built • Make the build self-testing • Keep the build fast • Everyone can see the results
  • 5. CI Solutions for Rails • CruiseControl.rb http://cruisecontrolrb.thoughtworks.com/ • Cerberus http://cerberus.rubyforge.org/ • Run Code Run http://runcoderun.com/ • Integrity http://integrityapp.com/
  • 6. Integrity • light-weighted • easy to configure • good support for git • works on our own install.
  • 7. Integrity Production developer Git Push git Build Notification developer repository developer developer CI Server Email Notification
  • 8. Integrity - Installation • Server Configuration • SUSE Linux • Apache • Passenger • MySQL 5.x
  • 9. Integrity - Build • The building environment is almost identical to your development environment • Standalone CI server • DB Server • rake ci WITH_PACKAGE_TEST=1
  • 10. Integrity - Installation http://www.in-src.com/continuous_integration_for_rails_project • $ gem install --passenger integrity • $ integrity install [integrity-diretory] • $ integrity migrate_db config.yml
  • 11. Integrity - Source • local git repository • /var/git/[project-name].git • remote git repository • ssh://[user]@[hostname]/var/git/[project-name].git
  • 12. Integrity - Git Hook Up • git post-receive • POST_RECEIVE_URL • Daemons
  • 13. Integrity - Email Notification
  • 17. Integrity • Trouble Shooting • http://www.in-src.com/ continuous_integration_for_rails_project
  • 18. Metric Fu • a set of rake tasks • Saikuro, Flog, Flay, Rcov, Reek, Roodi • sudo gem install jscruggs-metric_fu • rake metrics:all • generate metrics reports
  • 19. Metric Fu - Configuration
  • 21. Rcov
  • 22. Rcov
  • 23. Churn
  • 24. Flay
  • 25. Flog The higher the score, the harder it is to test
  • 26. Flog Code Seen as flog flog report class Test class Test Test#blah: (11.2) def blah def blah # 11.2 = 6.0: eval a = eval "1+1" a = eval "1+1" # 1.2 + 6.0 + 1.2: branch if a == 2 then if a == 2 then # 1.2 + 1.2 + 0.4 + 1.2: == puts "yay" puts "yay" # 1.2 1.2: puts end end 1.2: assignment end end 0.4: lit_fixnum end end
  • 27. Reek • detects common code smells might be hard to read, • Class Variable maintain or evolve, • Control Couple rather than things that are specifically • Data Clump wrong • Duplication • Feature Envy • Large Class • Long Method • Long Parameter List • Nested Iterators • Simulated Polymorphism • Uncommunicative Name • Utility Function
  • 28. Reek Duplication Feature Envy def double_thing() class Cart @other.thing + @other.thing def price end @item.price + @item.tax end end def double_thing() class Cart thing = @other.thing def price thing + thing @item.price_with_tax end end end class Item def price_with_tax price + tax end end
  • 29. Reek
  • 30. Roodi
  • 31. Roodi • warns you about design issues • AssignmentInConditionalCheck • CaseMissingElseCheck • ClassLineCountCheck • ClassNameCheck • CyclomaticComplexityBlockCheck • CyclomaticComplexityMethodCheck • EmptyRescueBodyCheck • ForLoopCheck • MethodLineCountCheck • MethodNameCheck • ModuleLineCountCheck • ModuleNameCheck • ParameterNumberCheck
  • 32. Stats