We have
platform tests
(they’re not
buildpack
specific)
Slide 61
Slide 61 text
No content
Slide 62
Slide 62 text
MVP
Slide 63
Slide 63 text
Minimum
Viable
Patch
Slide 64
Slide 64 text
The smallest
possible code
change
Slide 65
Slide 65 text
Rarely
the most
Maintainable
Slide 66
Slide 66 text
Rarely
the most
Flexible
Slide 67
Slide 67 text
Rarely
the
Fastest
Slide 68
Slide 68 text
Too many
MVPs and your
code becomes
difficult
Slide 69
Slide 69 text
What’s the
cure for the
MVP?
Slide 70
Slide 70 text
Tests!
(& Refactoring)
Slide 71
Slide 71 text
No content
Slide 72
Slide 72 text
Black box
testing
Slide 73
Slide 73 text
Given a set of
inputs
Slide 74
Slide 74 text
Expect a
known output
Slide 75
Slide 75 text
Ignore the
how
Slide 76
Slide 76 text
So how do we
actually test a
buildpack?
Slide 77
Slide 77 text
Real Ruby
apps, real
deploys
Slide 78
Slide 78 text
Let’s start
with the the
framework:
Slide 79
Slide 79 text
Hatchet
Slide 80
Slide 80 text
Hacks tests
github.com/heroku/hatchet
Slide 81
Slide 81 text
clone repo
create heroku app
deploy
Slide 82
Slide 82 text
git repo is
input
Slide 83
Slide 83 text
Output is
deploy log
Slide 84
Slide 84 text
Output is
`heroku run`
Slide 85
Slide 85 text
Who has
used?
$ heroku run bash
Slide 86
Slide 86 text
$ heroku run bash
Running `bash` attached to terminal…
~ $ ruby -v
ruby 2.1.0p0
~ $ rails -v
Rails 4.0.2
Heroku run
bash
Slide 87
Slide 87 text
Anyone not
using Ruby
2.1.1 right
now?
Slide 88
Slide 88 text
PHP?
Slide 89
Slide 89 text
github.com/
schneems/
repl_runner
Slide 90
Slide 90 text
Hatchet::Runner.new("rails3").deploy do |app|
app.run("rails console") do |console|
console.run("'hello' + 'world'") do |r|
expect(r).to match('helloworld')
end
end
end
repl_runner
Slide 91
Slide 91 text
Hatchet::Runner.new("rails3").deploy do |app|
app.run("rails console") do |console|
console.run("'hello' + 'world'") do |r|
expect(r).to match('helloworld')
end
end
end
repl_runner
Slide 92
Slide 92 text
Hatchet::Runner.new("rails3").deploy do |app|
app.run("rails console") do |console|
console.run("'hello' + 'world'") do |r|
expect(r).to match('helloworld')
end
end
end
repl_runner
Slide 93
Slide 93 text
Hatchet::Runner.new("rails3").deploy do |app|
app.run("rails console") do |console|
console.run("'hello' + 'world'") do |r|
expect(r).to match('helloworld')
end
end
end
repl_runner
Slide 94
Slide 94 text
Looks simple,
but took me
days
Slide 95
Slide 95 text
Process
deadlock is
no joke
Slide 96
Slide 96 text
Where did
“rails3” come
from?
Slide 97
Slide 97 text
No content
Slide 98
Slide 98 text
github.com/
sharpstone
Slide 99
Slide 99 text
47 Repos
of edge cases
(and counting)
Slide 100
Slide 100 text
Sidenote!
Slide 101
Slide 101 text
Threads in
Ruby are easy
+ awesome
Slide 102
Slide 102 text
Threaded
Slide 103
Slide 103 text
Threaded.later do
require “YAML"
url = “https://s3-external-1.amazonaws.com/” #...
YAML.load `curl #{url} 2>/dev/null`
end
Threaded.
later