SlideShare une entreprise Scribd logo
1  sur  19
Using the
Power to Prove
DeNA Co., Ltd.
Kazuho Oku
Do you know prove?
Have you ever used it?
Sep 20 2013 Using the Power to Prove 2
Prove is…
command-line interface of Test::Harness
Test::Harness is the test runner
Sep 20 2013 Using the Power to Prove 3
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-base.t t/01-new.t t/02-use.t
t/03-use-error.t t/04-use-defaults.t
t/00-base.t .......... ok
t/01-new.t ........... ok
…
$ prove
t/00-base.t .......... ok
t/01-new.t ........... ok
…
Test Anything Protocol (TAP)
Test::Harness runs the scripts and
aggregates the results
test scripts return the data using TAP
Sep 20 2013 Using the Power to Prove 4
$ perl t/00-base.t
1..14
ok 1 - use Class::Accessor::Lite;
ok 2 - call mk_accessors
ok 3
ok 4
…
History of Test::Harness and TAP
TAP exists since Perl 1
Test::Harness is part of Perl core
and is part of Linux Standards Base
bindings exist for many programming
languages
 http://en.wikipedia.org/wiki/Test_Anything_Protocol
Sep 20 2013 Using the Power to Prove 5
Prove has many powerful options
Sep 20 2013 Using the Power to Prove 6
$ prove -j 8 --state hot,fast,save
- runs 8 tests in parallel
- run the tests that failed first
- run the fast tests first,
and then others that takes time
- update the test stats
Can we write tests in other programming
languages, and aggregate the results
using prove?
Sep 20 2013 Using the Power to Prove 7
Prove runs scripts written in any language
but how?
Sep 20 2013 Using the Power to Prove 8
$ cat bf.t
#! /usr/local/bin/yabi
-[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[--
>+++<]>+.>++++++++++.
$ yabi bf.t
1..1
ok 1
$ prove bf.t
bf.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)
Result: PASS
PerlProve runs scripts written in any language
Perl understands the shebang
Sep 20 2013 Using the Power to Prove 9
$ cat bf.t
#! /usr/local/bin/yabi
-[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[--
>+++<]>+.>++++++++++.
$ perl bf.t
1..1
ok 1
PerlProve runs scripts written in any language
but not binary executables…
Sep 20 2013 Using the Power to Prove 10
$ cat bin.c
#include <stdio.h>
int main(int argc, char** argv)
{
printf("1..1n");
printf("ok 1n");
return 0;
}
$ perl bin
Unrecognized character xCF; marked by <-- HERE after <-- HERE near
column 1 at bin line 1.
prove --exec '' solves the problem
why?
Sep 20 2013 Using the Power to Prove 11
$ prove –h
…
-e, --exec Interpreter to run the tests ('' for compiled tests.)
…
$ prove --exec '' bin
bin .. open3: exec of bin failed at
/System/Library/Perl/5.12/TAP/Parser/Iterator/Process.pm line 163.
bin .. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
prove --exec '' solves the problem
specify the paths, or add . to $PATH
but would test scripts stop running on Windows
Sep 20 2013 Using the Power to Prove 12
$ prove --exec '' t/bin
t/bin .. ok
All tests successful.
Files=1, Tests=1, 1 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
$ PATH=".:$PATH" prove --exec '' bin
bin .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
Extensions can be other than .t
use: --ext ""
Sep 20 2013 Using the Power to Prove 13
$ prove --ext '' --exec '' .
./test.bf ... ok
./test.out .. ok
./test.sh ... ok
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
.proverc
Save the prove options for the project
Sep 20 2013 Using the Power to Prove 14
$ cat .proverc
--ext '' --exec ''
$ prove .
./test.bf ... ok
./test.out .. ok
./test.sh ... ok
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
Test scripts are searched by default from t/
Sep 20 2013 Using the Power to Prove 15
$ cat .proverc
--ext '' --exec ''
$ prove
t/test.bf ... ok
t/test.out .. ok
t/test.sh ... ok
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
Prove is powerful! Can we run programs
other than test scripts?
Sep 20 2013 Using the Power to Prove 16
Running things other than test scripts
cron tasks
service monitoring
Sep 20 2013 Using the Power to Prove 17
$ ls t
http.t memcached.t mysql.t ping.t
smtp.t
$ prove
t/http.t ....... ok
t/memcached.t .. ok
t/mysql.t ...... ok
t/ping.t ....... ok
t/smtp.t ....... ok
All tests successful.
Conclusion
Sep 20 2013 Using the Power to Prove 18
Conclusion
Prove is a proven task runner
can run any kind of tasks and generate a report
preinstalled on most systems
uses TAP - an established protocol
Sep 20 2013 Using the Power to Prove 19

Contenu connexe

Tendances

Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)CODE BLUE
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash scriptSimon Su
 
Penetration testing using python
Penetration testing using pythonPenetration testing using python
Penetration testing using pythonPurna Chander K
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMsunng87
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlHideaki Ohno
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationrjsmelo
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shellsascha_klein
 
Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shelllebse123
 
Augeas
AugeasAugeas
Augeaslutter
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In PythonMarwan Osman
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machinejulien pauli
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programmingkayalkarnan
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giantsIan Barber
 

Tendances (20)

Chap06
Chap06Chap06
Chap06
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
Penetration testing using python
Penetration testing using pythonPenetration testing using python
Penetration testing using python
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVM
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Shell Script
Shell ScriptShell Script
Shell Script
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
 
Unix 5 en
Unix 5 enUnix 5 en
Unix 5 en
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
 
Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shell
 
Augeas
AugeasAugeas
Augeas
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programming
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
Unix shell scripts
Unix shell scriptsUnix shell scripts
Unix shell scripts
 

En vedette

3rd Workshop on Social Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop on Social Information Retrieval for Technology-Enhanced Learnin...Hendrik Drachsler
 
Microsite – Macro Idea
Microsite – Macro IdeaMicrosite – Macro Idea
Microsite – Macro IdeaMaria Podolyak
 
Daily Lecture And Discussions
Daily Lecture And DiscussionsDaily Lecture And Discussions
Daily Lecture And Discussionsbsutton
 
Que no sera ni dia ni noche
Que no sera ni dia ni nocheQue no sera ni dia ni noche
Que no sera ni dia ni nochePaulo Arieu
 
'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecentostefanogambari
 
Тренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонкеТренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонкеMikhail Grafsky
 
Our school in winter
Our school in winterOur school in winter
Our school in winterGavranica
 
Marketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobileMarketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobileAmit Ambastha
 
Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Suthep Sangvirotjanaphat
 
Writing presentation
Writing presentationWriting presentation
Writing presentationJennifer Orr
 
Collecting and utilizing assessment information
Collecting and utilizing assessment informationCollecting and utilizing assessment information
Collecting and utilizing assessment informationJennifer Orr
 
Two Options - One Virtual World
Two Options - One Virtual WorldTwo Options - One Virtual World
Two Options - One Virtual WorldMartin Rehm
 
Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5Terri Weiss
 
Little Ones Learning Math Using Technology
Little Ones Learning Math Using TechnologyLittle Ones Learning Math Using Technology
Little Ones Learning Math Using TechnologyJennifer Orr
 
Examenopleiding energieconsulent mfl
Examenopleiding energieconsulent mflExamenopleiding energieconsulent mfl
Examenopleiding energieconsulent mflwweijmans
 
A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe  A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe Hendrik Drachsler
 

En vedette (20)

3rd Workshop on Social Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop on Social Information Retrieval for Technology-Enhanced Learnin...
 
Microsite – Macro Idea
Microsite – Macro IdeaMicrosite – Macro Idea
Microsite – Macro Idea
 
Daily Lecture And Discussions
Daily Lecture And DiscussionsDaily Lecture And Discussions
Daily Lecture And Discussions
 
Que no sera ni dia ni noche
Que no sera ni dia ni nocheQue no sera ni dia ni noche
Que no sera ni dia ni noche
 
'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento
 
Тренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонкеТренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонке
 
Our school in winter
Our school in winterOur school in winter
Our school in winter
 
Marketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobileMarketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobile
 
Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010
 
Writing presentation
Writing presentationWriting presentation
Writing presentation
 
Collecting and utilizing assessment information
Collecting and utilizing assessment informationCollecting and utilizing assessment information
Collecting and utilizing assessment information
 
Two Options - One Virtual World
Two Options - One Virtual WorldTwo Options - One Virtual World
Two Options - One Virtual World
 
D2.2.1 Evaluation Framework
D2.2.1 Evaluation FrameworkD2.2.1 Evaluation Framework
D2.2.1 Evaluation Framework
 
Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5
 
Devops down-under
Devops down-underDevops down-under
Devops down-under
 
Kieeds.com
Kieeds.comKieeds.com
Kieeds.com
 
Little Ones Learning Math Using Technology
Little Ones Learning Math Using TechnologyLittle Ones Learning Math Using Technology
Little Ones Learning Math Using Technology
 
Examenopleiding energieconsulent mfl
Examenopleiding energieconsulent mflExamenopleiding energieconsulent mfl
Examenopleiding energieconsulent mfl
 
A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe  A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe
 
Origen, filosofía
Origen, filosofíaOrigen, filosofía
Origen, filosofía
 

Similaire à Run tests and tasks of any language with Prove

LPW 2007 - Perl Plumbing
LPW 2007 - Perl PlumbingLPW 2007 - Perl Plumbing
LPW 2007 - Perl Plumbinglokku
 
Testing Code and Assuring Quality
Testing Code and Assuring QualityTesting Code and Assuring Quality
Testing Code and Assuring QualityKent Cowgill
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.Workhorse Computing
 
Perl Testing
Perl TestingPerl Testing
Perl Testinglichtkind
 
Tests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTapTests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTapRodolphe Quiédeville
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby CoreHiroshi SHIBATA
 
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Puppet
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in RustInfluxData
 
Intro to Testing in Zope, Plone
Intro to Testing in Zope, PloneIntro to Testing in Zope, Plone
Intro to Testing in Zope, PloneQuintagroup
 
Drupal Camp Brighton 2015: Ansible Drupal Medicine show
Drupal Camp Brighton 2015: Ansible Drupal Medicine showDrupal Camp Brighton 2015: Ansible Drupal Medicine show
Drupal Camp Brighton 2015: Ansible Drupal Medicine showGeorge Boobyer
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoPostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoMark Wong
 
How to master OpenStack in 2 hours
How to master OpenStack in 2 hoursHow to master OpenStack in 2 hours
How to master OpenStack in 2 hoursOpenCity Community
 

Similaire à Run tests and tasks of any language with Prove (20)

LPW 2007 - Perl Plumbing
LPW 2007 - Perl PlumbingLPW 2007 - Perl Plumbing
LPW 2007 - Perl Plumbing
 
Testing Code and Assuring Quality
Testing Code and Assuring QualityTesting Code and Assuring Quality
Testing Code and Assuring Quality
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 
Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
 
Perl Testing
Perl TestingPerl Testing
Perl Testing
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Metadata-driven Testing
Metadata-driven TestingMetadata-driven Testing
Metadata-driven Testing
 
Tests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTapTests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTap
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby Core
 
Go Replicator
Go ReplicatorGo Replicator
Go Replicator
 
Sge
SgeSge
Sge
 
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
Intro to Testing in Zope, Plone
Intro to Testing in Zope, PloneIntro to Testing in Zope, Plone
Intro to Testing in Zope, Plone
 
Drupal Camp Brighton 2015: Ansible Drupal Medicine show
Drupal Camp Brighton 2015: Ansible Drupal Medicine showDrupal Camp Brighton 2015: Ansible Drupal Medicine show
Drupal Camp Brighton 2015: Ansible Drupal Medicine show
 
Javantura v2 - Replication with MongoDB - what could go wrong... - Philipp Krenn
Javantura v2 - Replication with MongoDB - what could go wrong... - Philipp KrennJavantura v2 - Replication with MongoDB - what could go wrong... - Philipp Krenn
Javantura v2 - Replication with MongoDB - what could go wrong... - Philipp Krenn
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 HowtoPostgreSQL Portland Performance Practice Project - Database Test 2 Howto
PostgreSQL Portland Performance Practice Project - Database Test 2 Howto
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
 
How to master OpenStack in 2 hours
How to master OpenStack in 2 hoursHow to master OpenStack in 2 hours
How to master OpenStack in 2 hours
 

Plus de Kazuho Oku

HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときKazuho Oku
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7Kazuho Oku
 
HTTP/2の課題と将来
HTTP/2の課題と将来HTTP/2の課題と将来
HTTP/2の課題と将来Kazuho Oku
 
TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話Kazuho Oku
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondKazuho Oku
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyKazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsivenessKazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsivenessKazuho Oku
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 serverKazuho Oku
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95Kazuho Oku
 
HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向Kazuho Oku
 
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先Kazuho Oku
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Kazuho Oku
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計Kazuho Oku
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web fasterKazuho Oku
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP betterKazuho Oku
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP serverKazuho Oku
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedKazuho Oku
 
JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法Kazuho Oku
 
JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013Kazuho Oku
 

Plus de Kazuho Oku (20)

HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないとき
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7
 
HTTP/2の課題と将来
HTTP/2の課題と将来HTTP/2の課題と将来
HTTP/2の課題と将来
 
TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and Beyond
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using ruby
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95
 
HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向
 
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web faster
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons Learned
 
JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法
 
JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013
 

Dernier

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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 AutomationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Dernier (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Run tests and tasks of any language with Prove

  • 1. Using the Power to Prove DeNA Co., Ltd. Kazuho Oku
  • 2. Do you know prove? Have you ever used it? Sep 20 2013 Using the Power to Prove 2
  • 3. Prove is… command-line interface of Test::Harness Test::Harness is the test runner Sep 20 2013 Using the Power to Prove 3 $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-base.t t/01-new.t t/02-use.t t/03-use-error.t t/04-use-defaults.t t/00-base.t .......... ok t/01-new.t ........... ok … $ prove t/00-base.t .......... ok t/01-new.t ........... ok …
  • 4. Test Anything Protocol (TAP) Test::Harness runs the scripts and aggregates the results test scripts return the data using TAP Sep 20 2013 Using the Power to Prove 4 $ perl t/00-base.t 1..14 ok 1 - use Class::Accessor::Lite; ok 2 - call mk_accessors ok 3 ok 4 …
  • 5. History of Test::Harness and TAP TAP exists since Perl 1 Test::Harness is part of Perl core and is part of Linux Standards Base bindings exist for many programming languages  http://en.wikipedia.org/wiki/Test_Anything_Protocol Sep 20 2013 Using the Power to Prove 5
  • 6. Prove has many powerful options Sep 20 2013 Using the Power to Prove 6 $ prove -j 8 --state hot,fast,save - runs 8 tests in parallel - run the tests that failed first - run the fast tests first, and then others that takes time - update the test stats
  • 7. Can we write tests in other programming languages, and aggregate the results using prove? Sep 20 2013 Using the Power to Prove 7
  • 8. Prove runs scripts written in any language but how? Sep 20 2013 Using the Power to Prove 8 $ cat bf.t #! /usr/local/bin/yabi -[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[-- >+++<]>+.>++++++++++. $ yabi bf.t 1..1 ok 1 $ prove bf.t bf.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) Result: PASS
  • 9. PerlProve runs scripts written in any language Perl understands the shebang Sep 20 2013 Using the Power to Prove 9 $ cat bf.t #! /usr/local/bin/yabi -[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[-- >+++<]>+.>++++++++++. $ perl bf.t 1..1 ok 1
  • 10. PerlProve runs scripts written in any language but not binary executables… Sep 20 2013 Using the Power to Prove 10 $ cat bin.c #include <stdio.h> int main(int argc, char** argv) { printf("1..1n"); printf("ok 1n"); return 0; } $ perl bin Unrecognized character xCF; marked by <-- HERE after <-- HERE near column 1 at bin line 1.
  • 11. prove --exec '' solves the problem why? Sep 20 2013 Using the Power to Prove 11 $ prove –h … -e, --exec Interpreter to run the tests ('' for compiled tests.) … $ prove --exec '' bin bin .. open3: exec of bin failed at /System/Library/Perl/5.12/TAP/Parser/Iterator/Process.pm line 163. bin .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run
  • 12. prove --exec '' solves the problem specify the paths, or add . to $PATH but would test scripts stop running on Windows Sep 20 2013 Using the Power to Prove 12 $ prove --exec '' t/bin t/bin .. ok All tests successful. Files=1, Tests=1, 1 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS $ PATH=".:$PATH" prove --exec '' bin bin .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 13. Extensions can be other than .t use: --ext "" Sep 20 2013 Using the Power to Prove 13 $ prove --ext '' --exec '' . ./test.bf ... ok ./test.out .. ok ./test.sh ... ok All tests successful. Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 14. .proverc Save the prove options for the project Sep 20 2013 Using the Power to Prove 14 $ cat .proverc --ext '' --exec '' $ prove . ./test.bf ... ok ./test.out .. ok ./test.sh ... ok All tests successful. Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 15. Test scripts are searched by default from t/ Sep 20 2013 Using the Power to Prove 15 $ cat .proverc --ext '' --exec '' $ prove t/test.bf ... ok t/test.out .. ok t/test.sh ... ok All tests successful. Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 16. Prove is powerful! Can we run programs other than test scripts? Sep 20 2013 Using the Power to Prove 16
  • 17. Running things other than test scripts cron tasks service monitoring Sep 20 2013 Using the Power to Prove 17 $ ls t http.t memcached.t mysql.t ping.t smtp.t $ prove t/http.t ....... ok t/memcached.t .. ok t/mysql.t ...... ok t/ping.t ....... ok t/smtp.t ....... ok All tests successful.
  • 18. Conclusion Sep 20 2013 Using the Power to Prove 18
  • 19. Conclusion Prove is a proven task runner can run any kind of tasks and generate a report preinstalled on most systems uses TAP - an established protocol Sep 20 2013 Using the Power to Prove 19