heroku_hatchet 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +14 -0
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +2 -2
  5. data/Rakefile +6 -0
  6. data/hatchet.gemspec +3 -1
  7. data/hatchet.json +3 -2
  8. data/lib/hatchet.rb +2 -0
  9. data/lib/hatchet/anvil_app.rb +28 -18
  10. data/lib/hatchet/app.rb +19 -5
  11. data/lib/hatchet/git_app.rb +5 -2
  12. data/lib/hatchet/tasks.rb +17 -7
  13. data/lib/hatchet/version.rb +1 -1
  14. data/test/fixtures/buildpacks/heroku-buildpack-ruby/.gitignore +4 -0
  15. data/test/fixtures/buildpacks/heroku-buildpack-ruby/CHANGELOG.md +378 -0
  16. data/test/fixtures/buildpacks/heroku-buildpack-ruby/Gemfile +10 -0
  17. data/test/fixtures/buildpacks/heroku-buildpack-ruby/LICENSE +9 -0
  18. data/test/fixtures/buildpacks/heroku-buildpack-ruby/README.md +192 -0
  19. data/test/fixtures/buildpacks/heroku-buildpack-ruby/Rakefile +358 -0
  20. data/test/fixtures/buildpacks/heroku-buildpack-ruby/bin/compile +13 -0
  21. data/test/fixtures/buildpacks/heroku-buildpack-ruby/bin/detect +12 -0
  22. data/test/fixtures/buildpacks/heroku-buildpack-ruby/bin/release +9 -0
  23. data/test/fixtures/buildpacks/heroku-buildpack-ruby/hatchet.json +25 -0
  24. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack.rb +27 -0
  25. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/base.rb +175 -0
  26. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/bundler_lockfile.rb +19 -0
  27. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/disable_deploys.rb +17 -0
  28. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/no_lockfile.rb +16 -0
  29. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rack.rb +43 -0
  30. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails2.rb +91 -0
  31. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails3.rb +86 -0
  32. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails4.rb +66 -0
  33. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/ruby.rb +681 -0
  34. data/test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/shell_helpers.rb +62 -0
  35. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/bugs_spec.rb +11 -0
  36. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/no_lockfile_spec.rb +10 -0
  37. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails23_spec.rb +11 -0
  38. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails3_spec.rb +22 -0
  39. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails4_spec.rb +12 -0
  40. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rubies_spec.rb +38 -0
  41. data/test/fixtures/buildpacks/heroku-buildpack-ruby/spec/spec_helper.rb +35 -0
  42. data/test/fixtures/buildpacks/heroku-buildpack-ruby/support/s3/hmac +79 -0
  43. data/test/fixtures/buildpacks/heroku-buildpack-ruby/support/s3/s3 +223 -0
  44. data/test/fixtures/buildpacks/heroku-buildpack-ruby/vendor/syck_hack.rb +64 -0
  45. data/test/hatchet/allow_failure_anvil_test.rb +21 -0
  46. data/test/hatchet/allow_failure_git_test.rb +17 -0
  47. data/test/hatchet/anvil_test.rb +7 -7
  48. data/test/hatchet/config_test.rb +4 -2
  49. data/test/hatchet/git_test.rb +2 -2
  50. metadata +89 -8
@@ -0,0 +1,64 @@
1
+ # :stopdoc:
2
+
3
+ # Hack to handle syck's DefaultKey bug
4
+ #
5
+ # This file is always loaded AFTER either syck or psych are already
6
+ # loaded. It then looks at what constants are available and creates
7
+ # a consistent view on all rubys.
8
+ #
9
+ # All this is so that there is always a YAML::Syck::DefaultKey
10
+ # class no matter if the full yaml library has loaded or not.
11
+ #
12
+
13
+ $: << ENV['BUNDLER_LIB_PATH'] if ENV['BUNDLER_LIB_PATH']
14
+ require 'bundler/psyched_yaml'
15
+
16
+ module YAML
17
+ # In newer 1.9.2, there is a Syck toplevel constant instead of it
18
+ # being underneith YAML. If so, reference it back under YAML as
19
+ # well.
20
+ if defined? ::Syck
21
+ Syck = ::Syck
22
+
23
+ # Otherwise, if there is no YAML::Syck, then we've got just psych
24
+ # loaded, so lets define a stub for DefaultKey.
25
+ elsif !defined? YAML::Syck
26
+ module Syck
27
+ class DefaultKey
28
+ end
29
+ end
30
+ end
31
+
32
+ # Now that we've got something that is always here, define #to_s
33
+ # so when code tries to use this, it at least just shows up like it
34
+ # should.
35
+ module Syck
36
+ class DefaultKey
37
+ def to_s
38
+ '='
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ # Sometime in the 1.9 dev cycle, the Syck constant was moved from under YAML
45
+ # to be a toplevel constant. So gemspecs created under these versions of Syck
46
+ # will have references to Syck::DefaultKey.
47
+ #
48
+ # So we need to be sure that we reference Syck at the toplevel too so that
49
+ # we can always load these kind of gemspecs.
50
+ #
51
+ if !defined?(Syck)
52
+ Syck = YAML::Syck
53
+ end
54
+
55
+ # Now that we've got Syck setup in all the right places, store
56
+ # a reference to the DefaultKey class inside Gem. We do this so that
57
+ # if later on YAML, etc are redefined, we've still got a consistent
58
+ # place to find the DefaultKey class for comparison.
59
+
60
+ module Gem
61
+ SyckDefaultKey = YAML::Syck::DefaultKey
62
+ end
63
+
64
+ # :startdoc:
@@ -0,0 +1,21 @@
1
+ require 'test_helper'
2
+
3
+ class AllowFailureAnvilTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @buildpack_path = File.expand_path 'test/fixtures/buildpacks/heroku-buildpack-ruby'
7
+ end
8
+
9
+ def test_allowed_failure
10
+ Hatchet::AnvilApp.new("no_lockfile", buildpack: @buildpack_path, allow_failure: true).deploy do |app, heroku, output|
11
+ refute app.deployed?
12
+ assert_match "Gemfile.lock required", output
13
+ end
14
+ end
15
+
16
+ def test_failure_with_no_flag
17
+ assert_raise(Anvil::Builder::BuildError) do
18
+ Hatchet::AnvilApp.new("no_lockfile", buildpack: @buildpack_path).deploy
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+ class AllowFailureGitTest < Test::Unit::TestCase
4
+
5
+ def test_allowed_failure
6
+ Hatchet::GitApp.new("no_lockfile", allow_failure: true).deploy do |app|
7
+ refute app.deployed?
8
+ assert_match "Gemfile.lock required", app.output
9
+ end
10
+ end
11
+
12
+ def test_failure_with_no_flag
13
+ assert_raise(Hatchet::App::FailedDeploy) do
14
+ Hatchet::GitApp.new("no_lockfile").deploy
15
+ end
16
+ end
17
+ end
@@ -1,21 +1,21 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class AnvilTest < Test::Unit::TestCase
4
- def test_deploy
5
- ruby_buildpack_path = File.expand_path 'test/fixtures/buildpacks/heroku-buildpack-ruby'
6
4
 
7
- Hatchet::AnvilApp.new("rails3_mri_193", buildpack: ruby_buildpack_path).deploy do |app, heroku, output|
5
+
6
+ def setup
7
+ @buildpack_path = File.expand_path 'test/fixtures/buildpacks/heroku-buildpack-ruby'
8
+ end
9
+
10
+ def test_deploy
11
+ Hatchet::AnvilApp.new("rails3_mri_193", buildpack: @buildpack_path).deploy do |app, heroku, output|
8
12
  assert true
9
13
 
10
14
  assert_match '1.9.3', app.run("ruby -v")
11
15
  app.run("bash") do |cmd|
12
-
13
16
  assert cmd.run("cat Gemfile").include?("gem 'pg'")
14
-
15
17
  assert cmd.run("ls public/assets").include?("application.css")
16
18
  end
17
-
18
19
  end
19
20
  end
20
21
  end
21
-
@@ -12,13 +12,15 @@ class ConfigTest < Test::Unit::TestCase
12
12
 
13
13
  def test_config_dirs
14
14
  expected_dirs = { "test/fixtures/repos/rails3/rails3_mri_193" => "git://github.com/sharpstone/rails3_mri_193.git",
15
- "test/fixtures/repos/rails2/rails2blog" => "git://github.com/sharpstone/rails2blog.git" }
15
+ "test/fixtures/repos/rails2/rails2blog" => "git://github.com/sharpstone/rails2blog.git",
16
+ "test/fixtures/repos/bundler/no_lockfile" => "git://github.com/sharpstone/no_lockfile.git" }
16
17
  assert_equal expected_dirs, @config.dirs
17
18
  end
18
19
 
19
20
  def test_config_repos
20
21
  expected_repos = { "rails3_mri_193" => "test/fixtures/repos/rails3/rails3_mri_193",
21
- "rails2blog" => "test/fixtures/repos/rails2/rails2blog" }
22
+ "rails2blog" => "test/fixtures/repos/rails2/rails2blog",
23
+ "no_lockfile" =>"test/fixtures/repos/bundler/no_lockfile"}
22
24
  assert_equal expected_repos, @config.repos
23
25
  end
24
26
 
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
- class TriageTest < Test::Unit::TestCase
4
- def test_foo
3
+ class GitAppTest < Test::Unit::TestCase
4
+ def test_can_deploy_git_app
5
5
  Hatchet::GitApp.new("rails3_mri_193").deploy do |app|
6
6
  assert true
7
7
  assert_match '1.9.3', app.run("ruby -v")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_hatchet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-20 00:00:00.000000000 Z
11
+ date: 2013-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroku-api
@@ -39,13 +39,13 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: anvil-cli
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
- type: :development
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: anvil-cli
56
+ name: excon
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '>='
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: excon
70
+ name: thor
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '>='
@@ -81,13 +81,27 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: thor
84
+ name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
- type: :runtime
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: parallel_tests
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
@@ -103,6 +117,7 @@ extensions: []
103
117
  extra_rdoc_files: []
104
118
  files:
105
119
  - .gitignore
120
+ - .travis.yml
106
121
  - CHANGELOG.md
107
122
  - Gemfile
108
123
  - LICENSE.txt
@@ -120,11 +135,44 @@ files:
120
135
  - lib/hatchet/stream_exec.rb
121
136
  - lib/hatchet/tasks.rb
122
137
  - lib/hatchet/version.rb
138
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/.gitignore
139
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/CHANGELOG.md
140
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/Gemfile
141
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/LICENSE
142
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/README.md
143
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/Rakefile
144
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/bin/compile
145
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/bin/detect
146
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/bin/release
147
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/hatchet.json
148
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack.rb
149
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/base.rb
150
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/bundler_lockfile.rb
151
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/disable_deploys.rb
152
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/no_lockfile.rb
153
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rack.rb
154
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails2.rb
155
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails3.rb
156
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails4.rb
157
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/ruby.rb
158
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/shell_helpers.rb
159
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/bugs_spec.rb
160
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/no_lockfile_spec.rb
161
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails23_spec.rb
162
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails3_spec.rb
163
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails4_spec.rb
164
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rubies_spec.rb
165
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/spec_helper.rb
166
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/support/s3/hmac
167
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/support/s3/s3
168
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/vendor/syck_hack.rb
123
169
  - test/fixtures/buildpacks/null-buildpack/bin/compile
124
170
  - test/fixtures/buildpacks/null-buildpack/bin/detect
125
171
  - test/fixtures/buildpacks/null-buildpack/bin/release
126
172
  - test/fixtures/buildpacks/null-buildpack/hatchet.json
127
173
  - test/fixtures/buildpacks/null-buildpack/readme.md
174
+ - test/hatchet/allow_failure_anvil_test.rb
175
+ - test/hatchet/allow_failure_git_test.rb
128
176
  - test/hatchet/anvil_test.rb
129
177
  - test/hatchet/config_test.rb
130
178
  - test/hatchet/git_test.rb
@@ -154,11 +202,44 @@ signing_key:
154
202
  specification_version: 4
155
203
  summary: Hatchet is a an integration testing library for developing Heroku buildpacks.
156
204
  test_files:
205
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/.gitignore
206
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/CHANGELOG.md
207
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/Gemfile
208
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/LICENSE
209
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/README.md
210
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/Rakefile
211
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/bin/compile
212
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/bin/detect
213
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/bin/release
214
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/hatchet.json
215
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack.rb
216
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/base.rb
217
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/bundler_lockfile.rb
218
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/disable_deploys.rb
219
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/no_lockfile.rb
220
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rack.rb
221
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails2.rb
222
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails3.rb
223
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/rails4.rb
224
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/ruby.rb
225
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/lib/language_pack/shell_helpers.rb
226
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/bugs_spec.rb
227
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/no_lockfile_spec.rb
228
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails23_spec.rb
229
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails3_spec.rb
230
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rails4_spec.rb
231
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/rubies_spec.rb
232
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/spec/spec_helper.rb
233
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/support/s3/hmac
234
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/support/s3/s3
235
+ - test/fixtures/buildpacks/heroku-buildpack-ruby/vendor/syck_hack.rb
157
236
  - test/fixtures/buildpacks/null-buildpack/bin/compile
158
237
  - test/fixtures/buildpacks/null-buildpack/bin/detect
159
238
  - test/fixtures/buildpacks/null-buildpack/bin/release
160
239
  - test/fixtures/buildpacks/null-buildpack/hatchet.json
161
240
  - test/fixtures/buildpacks/null-buildpack/readme.md
241
+ - test/hatchet/allow_failure_anvil_test.rb
242
+ - test/hatchet/allow_failure_git_test.rb
162
243
  - test/hatchet/anvil_test.rb
163
244
  - test/hatchet/config_test.rb
164
245
  - test/hatchet/git_test.rb