ci of js and apex using jasmine, phantom js and drone io df14
TRANSCRIPT
![Page 1: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/1.jpg)
Continuous Integration of JS and Apex code using Jasmine, Phantom.JS and Drone.ioKevin Poorman
Principle Architect
@CodeFriar
![Page 2: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/2.jpg)
Place
Customer or
Partner logo in
white area of
slide, centered
Kevin PoormanPrincipal Architect
![Page 3: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/3.jpg)
•Example build file
•Example Grunt file
•Recap
•Q & A
Agenda
•Introduction to CI and CD
•The (Opinionated) Stack
•Meet the players
•Putting it all together
![Page 4: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/4.jpg)
Introduction to Continuous Integration
•CI is the process of:
–Merging code
–Testing code
–Automatically!
• CI presumes:
– Version Control
–Test driven Development
– Coherent branching and
merging strategy
• For instance: Git flow:
http://nvie.com/posts/a-
successful-git-
branching-model/
![Page 5: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/5.jpg)
Introduction to Continuous Integration
Code Committed to fork or branch
Git commit hook triggers Ci build
Build script execution
Code Merged
Optionally re-run
tests on master
branch
![Page 6: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/6.jpg)
Use to
introduce a
demo, video,
Q&A, etc.
CI is only as good as the tests you write.
Introduction to Continuous Integration
![Page 7: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/7.jpg)
Introduction to Continuous Delivery
•CD is the process of
deploying successful
code changes to
runtime environments
automatically.
•CD almost never goes
to Production Orgs:
•Instead push from dev
org to Q/A Orgs or
Packaging Orgs.
![Page 8: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/8.jpg)
Introduction to Continuous Delivery
Merge Githook triggers Drone.io build
Build script execution
Deploy to 1 or more Environments
![Page 9: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/9.jpg)
•Grunt – gruntjs.com
•Drone.Io – drone.io
•Jasmine – jasmine.github.io
•Instanbul – gotwarlost.github.io/istanbul
•Ant – ant.apache.org
Our Opinionated Stack.
![Page 10: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/10.jpg)
The Players: Grunt
•Javascript based Task runner.
•Wealth of community contributed Plugins.
–Examples include: cssmin, copy, jasmine, ant-
sfdc
![Page 11: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/11.jpg)
The Players: Drone.io
•Docker based CI as a service app
•Polyglot language support.
•Automatic integration with Github and Bitbucket
![Page 12: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/12.jpg)
The Players: Jasmine
•Behavior driven development testing framework
for Javascript.
•Many frameworks supported. (Angular, Backbone)
•Uses Phantom.js (Headless Chrome based
browser)
–Can be used in any browser!
–Or multiple browsers!
![Page 13: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/13.jpg)
The Players: Istanbul
•Code coverage reports for Jasmine / Javascript
testing.
•Optional “meta” tests for Minimum code coverage
based on branch execution, % of Lines, % of
Methods etc.
•Outputs both LCOV and .html files
![Page 14: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/14.jpg)
The Players: Ant
•Similar to Grunt, ANT is a XML based Task runner
commonly used in the Java world.
•Salesforce provides the Ant Migration Toolkit, a
plugin for Ant that facilitates retrieving and
deploying metadata and code to Salesforce Orgs.
![Page 15: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/15.jpg)
Use to
introduce a
demo, video,
Q&A, etc. Show me the code!
Putting it all together
![Page 16: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/16.jpg)
Recap:
•We use CI to automatically run tests on our Js and Apex Code just after commit/merge.
•We use CD to deploy that new code to our Dev and Q/a Orgs
•Jasmine for JS testing
•Ant for Apex tests and
deploying to Orgs
•Grunt to define our
tasks
•Drone.io to automate
![Page 17: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/17.jpg)
Use to
introduce a
demo, video,
Q&A, etc. Questions & AnswersIf you don’t ask questions … I will.
Questions & Answers
![Page 18: Ci of js and apex using jasmine, phantom js and drone io df14](https://reader031.vdocuments.net/reader031/viewer/2022013111/55a7820f1a28ab1f3e8b474b/html5/thumbnails/18.jpg)
Github Repo: noeticpenguin/df14
Twitter me: @codefriar