heroku_hatchet 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c903b4979a0e4002e76f54d76a91f4651d5dfb2f20701909fefa5ac48954298
4
- data.tar.gz: 5f54f9ebf2ec4b23a12109638aee44cc841d244c5e3f6f76994841eb47995950
3
+ metadata.gz: 4eff388a9b8a640e00f9a7d71dca8c63c044eb68133a3fab77c948e52d5b8e10
4
+ data.tar.gz: 005704cca536d304d4c59100aa70ac92da1230fb6a5f8d2deaab5acd68670407
5
5
  SHA512:
6
- metadata.gz: 7aed83bd81ea797e0626184d82d0cc0d9582db9b94741e2388020196600c0d4061ddcc17d913593c85098d2f3654979be81eb643f6710e640a9bf2d74f193893
7
- data.tar.gz: 34fe3e85dc3531538d84fcdfecdc204af64f3699cae3e77d89a361c999ddd1a75d1fd736a0772bcd5727a0605971176ca7cecb8ed1c9eae53dceee37e3ae9aa5
6
+ metadata.gz: ddedca5de3df3a7e677a6689eb06b4d7cda13a5593b6f46bd8f621b1ae954bc3ea4cd22c6f7872822f12424dcd2884192823ff458b9e2155d4f7e8236d73c746
7
+ data.tar.gz: 961a6edc1894a16668b001f692fca7976eba92123e16fc110f5275f38d4d780e097762642ad833a888fa4acaa7289c4beccb695c6e75f44f037e20633e84c097
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## HEAD
2
2
 
3
+ ## 5.0.2
4
+
5
+ - Fix `before_deploy` use with ci test runs (https://github.com/heroku/hatchet/pull/78)
6
+
7
+ ## 5.0.1
8
+
3
9
  - Circle CI support in `ci:setup` command (https://github.com/heroku/hatchet/pull/76)
4
10
 
5
11
  ## 5.0.0
data/lib/hatchet/app.rb CHANGED
@@ -315,31 +315,30 @@ module Hatchet
315
315
  end
316
316
 
317
317
  def run_ci(timeout: 300, &block)
318
- Hatchet::RETRIES.times.retry do
319
- result = create_pipeline
320
- @pipeline_id = result["id"]
321
- end
318
+ in_directory do
319
+ Hatchet::RETRIES.times.retry do
320
+ result = create_pipeline
321
+ @pipeline_id = result["id"]
322
+ end
322
323
 
323
- # when the CI run finishes, the associated ephemeral app created for the test run internally gets removed almost immediately
324
- # the system then sees a pipeline with no apps, and deletes it, also almost immediately
325
- # that would, with bad timing, mean our test run info poll in wait! would 403, and/or the delete_pipeline at the end
326
- # that's why we create an app explictly (or maybe it already exists), and then associate it with with the pipeline
327
- # the app will be auto cleaned up later
328
- self.setup!
329
- Hatchet::RETRIES.times.retry do
330
- couple_pipeline(@name, @pipeline_id)
331
- end
324
+ # when the CI run finishes, the associated ephemeral app created for the test run internally gets removed almost immediately
325
+ # the system then sees a pipeline with no apps, and deletes it, also almost immediately
326
+ # that would, with bad timing, mean our test run info poll in wait! would 403, and/or the delete_pipeline at the end
327
+ # that's why we create an app explictly (or maybe it already exists), and then associate it with with the pipeline
328
+ # the app will be auto cleaned up later
329
+ self.setup!
330
+ Hatchet::RETRIES.times.retry do
331
+ couple_pipeline(@name, @pipeline_id)
332
+ end
332
333
 
333
- test_run = TestRun.new(
334
- token: api_key,
335
- buildpacks: @buildpacks,
336
- timeout: timeout,
337
- app: self,
338
- pipeline: @pipeline_id,
339
- api_rate_limit: api_rate_limit
340
- )
341
- in_directory do
342
- call_before_deploy
334
+ test_run = TestRun.new(
335
+ token: api_key,
336
+ buildpacks: @buildpacks,
337
+ timeout: timeout,
338
+ app: self,
339
+ pipeline: @pipeline_id,
340
+ api_rate_limit: api_rate_limit
341
+ )
343
342
 
344
343
  Hatchet::RETRIES.times.retry do
345
344
  test_run.create_test_run
@@ -1,3 +1,3 @@
1
1
  module Hatchet
2
- VERSION = "5.0.1"
2
+ VERSION = "5.0.2"
3
3
  end
@@ -2,8 +2,19 @@ require 'test_helper'
2
2
 
3
3
  class CIThreeTest < Minitest::Test
4
4
  def test_error_with_bad_app
5
- Hatchet::GitApp.new("rails5_ci_fails_no_database", allow_failure: true).run_ci do |test_run|
5
+ @before_deploy_called = false
6
+ @before_deploy_dir_pwd = nil
7
+ before_deploy = -> {
8
+ @before_deploy_called = true
9
+ @before_deploy_dir_pwd = Dir.pwd
10
+ }
11
+ Hatchet::GitApp.new("rails5_ci_fails_no_database", allow_failure: true, before_deploy: before_deploy).run_ci do |test_run|
6
12
  assert_equal :errored, test_run.status
13
+ assert_equal Dir.pwd, @before_deploy_dir_pwd
14
+
15
+ assert @before_deploy_called
7
16
  end
17
+
18
+ refute_equal Dir.pwd, @before_deploy_dir_pwd
8
19
  end
9
20
  end
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: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-16 00:00:00.000000000 Z
11
+ date: 2020-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: platform-api