SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
© 2011 @eriwen
Eric Wendelin
Blog: eriwen.com
Twitter: @eriwen
Code: git.io/eric
(      °□°                ɐpuǝƃV

• Tools that help your JS not suck
• How to create a build for your client-side
  code
• Automation with Jenkins
• The hard part
• Unicorns
The Situation
Programmers are expensive

Must prevent them from doing
 things below their pay grade
How do you do that?

Automate tasks that don't
require mental participation
Programmers are clever

 Must force them to write
code for the next engineer
Better for the next engineer?

Must enforce conventions
 that make the code more
      understandable
?
First things first

We need automation tools
Static Analysis
JSHint


jshint file.js --config config.json




          jshint.org
CSSLint


csslint --rules=rule,rule2 file.css




          csslint.net
Testing
Unit-testing

• Jasmine (pivotal.github.com/jasmine)
• QUnit (docs.jquery.com/QUnit)
• YUI Test (yuilibrary.com/yui/docs/test)
• Mocha (visionmedia.github.com/mocha)
• Lots of others...
PhantomJS


phantomjs your-runner.js file.html




        phantomjs.org
Xvfb
JsTestDriver


java -jar JsTestDriver.jar --tests all




code.google.com/p/js-test-driver/
Functional testing

• Selenium (seleniumhq.org)
• CasperJS (github.com/n1k0/casperjs)
• zombie.js (zombie.labnotes.org)
Documentation
jsduck


jsduck src/js --output target/docs




github.com/senchalabs/jsduck
Page Speed
Closure Compiler

 java -jar compiler.jar --js file.js
     --js_output_file file.min.js



code.google.com/closure/compiler
YUI Compressor

     java -jar yuicompressor.jar -o
         '.css$:-min.css' *.css



developer.yahoo.com/yui/compressor
Combine and gzip

cat file1.js file2.js >> combined.js
gzip combined.js
mv combined.js{.gz,}
?
The Build
Build Steps

• Static Analysis
• File Optimization (for production)
• Automated Testing
• Documentation
• Report Results
Gradle
Don't have a build?
html5boilerplate.com
Introducing the Gradle
      Web Suite
git.io/gradlejs
git.io/gradlecss
git.io/gradlehtml
jenkins-ci.org
Crazy Simple Setup

wget http://mirrors.jenkins-
ci.org/war/latest/jenkins.war


java -jar jenkins.war
Source Control Plugins
• Git
• Mercurial
• Bazaar
• Subversion
• CVS
• Lots more...
Build System Plugins

• Gradle
• Maven
• Ant
• Rake
• Lots more...
Runs pretty much
       everything
• Ruby
• Python
• NodeJS
• Groovy
• Shell
• Lots more...
Build Health Plugins

• Violations Plugin
• Selenium Plugin
• Cobertura Plugin
• Task Scanner Plugin
• ...and, of course, Chuck Norris Plugin
The really hard part
5 Stages of JS CI
• No build server
• Pulls from source control and runs metrics
• Runs unit tests and fails build if necessary.
  One button push to staging/production env
• Unit and acceptance tests run. Metrics
  affect build stability
• Code deployed on every push that passes
  the build
Helpful Tweeters
@ariyahidayat works on #phantomjs
@gseguin helped me with QUnit/Phantom
@builddoctor general CI advocate/guru
@jfroma does cool #jsci on Windows
@jamescarr could've given this talk well
One more thing...
LCOV to Cobertura converter


     git.io/ltc
Code at: git.io/eric

Blog: eriwen.com
Twitter: @eriwen

Weitere ähnliche Inhalte

Was ist angesagt?

Security operations center-SOC Presentation-مرکز عملیات امنیت
Security operations center-SOC Presentation-مرکز عملیات امنیتSecurity operations center-SOC Presentation-مرکز عملیات امنیت
Security operations center-SOC Presentation-مرکز عملیات امنیت
ReZa AdineH
 
Encoded Attacks And Countermeasures
Encoded Attacks And CountermeasuresEncoded Attacks And Countermeasures
Encoded Attacks And Countermeasures
Marco Morana
 

Was ist angesagt? (20)

CIS14: Physical and Logical Access Control Convergence
CIS14: Physical and Logical Access Control ConvergenceCIS14: Physical and Logical Access Control Convergence
CIS14: Physical and Logical Access Control Convergence
 
OWASP Top Ten in Practice
OWASP Top Ten in PracticeOWASP Top Ten in Practice
OWASP Top Ten in Practice
 
Computer security design principles
Computer security design principlesComputer security design principles
Computer security design principles
 
Cybersecurity Challenges in Healthcare
Cybersecurity Challenges in HealthcareCybersecurity Challenges in Healthcare
Cybersecurity Challenges in Healthcare
 
Security operations center-SOC Presentation-مرکز عملیات امنیت
Security operations center-SOC Presentation-مرکز عملیات امنیتSecurity operations center-SOC Presentation-مرکز عملیات امنیت
Security operations center-SOC Presentation-مرکز عملیات امنیت
 
2017 Security Report Presentation
2017 Security Report Presentation2017 Security Report Presentation
2017 Security Report Presentation
 
SOC presentation- Building a Security Operations Center
SOC presentation- Building a Security Operations CenterSOC presentation- Building a Security Operations Center
SOC presentation- Building a Security Operations Center
 
Owasp top 10 vulnerabilities
Owasp top 10 vulnerabilitiesOwasp top 10 vulnerabilities
Owasp top 10 vulnerabilities
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspective
 
Modern Requirements and Solutions for Privileged Access Management (PAM)
Modern Requirements and Solutions for Privileged Access Management (PAM)Modern Requirements and Solutions for Privileged Access Management (PAM)
Modern Requirements and Solutions for Privileged Access Management (PAM)
 
Integrating Security Across SDLC Phases
Integrating Security Across SDLC PhasesIntegrating Security Across SDLC Phases
Integrating Security Across SDLC Phases
 
Chapter2 the need to security
Chapter2 the need to securityChapter2 the need to security
Chapter2 the need to security
 
What We’ve Learned Building a Cyber Security Operation Center: du Case Study
What We’ve Learned Building a Cyber  Security Operation Center: du Case  StudyWhat We’ve Learned Building a Cyber  Security Operation Center: du Case  Study
What We’ve Learned Building a Cyber Security Operation Center: du Case Study
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
CyberArk Interview Questions and Answers for 2022.pdf
CyberArk Interview Questions and Answers for 2022.pdfCyberArk Interview Questions and Answers for 2022.pdf
CyberArk Interview Questions and Answers for 2022.pdf
 
Encoded Attacks And Countermeasures
Encoded Attacks And CountermeasuresEncoded Attacks And Countermeasures
Encoded Attacks And Countermeasures
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 
Security operations center 5 security controls
 Security operations center 5 security controls Security operations center 5 security controls
Security operations center 5 security controls
 

Ähnlich wie JavaScript + Jenkins = Winning!

.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012).NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
lancehilliard
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
Marcos Quesada
 

Ähnlich wie JavaScript + Jenkins = Winning! (20)

Introduction To Web Application Testing
Introduction To Web Application TestingIntroduction To Web Application Testing
Introduction To Web Application Testing
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012).NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
 
2015 jcconf-h2s-devops-practice
2015 jcconf-h2s-devops-practice2015 jcconf-h2s-devops-practice
2015 jcconf-h2s-devops-practice
 
Quick start with AngularJS
Quick start with AngularJSQuick start with AngularJS
Quick start with AngularJS
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
 
Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023
 
Selenium practical
Selenium practicalSelenium practical
Selenium practical
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
JavaScript all the things! - FullStack 2017
JavaScript all the things! - FullStack 2017JavaScript all the things! - FullStack 2017
JavaScript all the things! - FullStack 2017
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Spring insight what just happened
Spring insight   what just happenedSpring insight   what just happened
Spring insight what just happened
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Let's run JavaScript Everywhere
Let's run JavaScript EverywhereLet's run JavaScript Everywhere
Let's run JavaScript Everywhere
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
 

Mehr von Eric Wendelin

Mehr von Eric Wendelin (10)

What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 
Building the Web with Gradle
Building the Web with GradleBuilding the Web with Gradle
Building the Web with Gradle
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
 
Test your Javascript! v1.1
Test your Javascript! v1.1Test your Javascript! v1.1
Test your Javascript! v1.1
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
 
Intro to Hadoop
Intro to HadoopIntro to Hadoop
Intro to Hadoop
 
Javascript Stacktrace Ignite
Javascript Stacktrace IgniteJavascript Stacktrace Ignite
Javascript Stacktrace Ignite
 
Apache Avro and You
Apache Avro and YouApache Avro and You
Apache Avro and You
 
Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnit
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

JavaScript + Jenkins = Winning!