flash_flow 1.2.1 → 1.2.2.a

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,7 +59,7 @@ module FlashFlow
59
59
 
60
60
  current_branch_error = "ERROR: Your branch did not merge to test_acceptance. Run 'flash_flow --resolve', fix the merge conflict(s) and then re-run this script\n"
61
61
 
62
- @deploy.instance_variable_get('@git'.to_sym).stub(:working_branch, 'pushing_branch') do
62
+ @deploy.instance_variable_get('@local_git'.to_sym).stub(:working_branch, 'pushing_branch') do
63
63
  assert_equal(current_branch_error, @deploy.format_errors)
64
64
  end
65
65
  end
@@ -73,12 +73,10 @@ module FlashFlow
73
73
  end
74
74
 
75
75
  def test_check_out_to_working_branch
76
- @deploy.stub(:in_shadow_repo, true) do
77
- @deploy.stub(:check_repo, true) do
78
- @deploy.stub(:check_version, true) do
79
- Lock::Base.stub_any_instance(:with_lock, -> { raise Lock::Error }) do
80
- assert_output(/Failure!/) { @deploy.run }
81
- end
76
+ @deploy.stub(:check_repo, true) do
77
+ @deploy.stub(:check_version, true) do
78
+ Lock::Base.stub_any_instance(:with_lock, -> { raise Lock::Error }) do
79
+ assert_output(/Failure!/) { @deploy.run }
82
80
  end
83
81
  end
84
82
  end
@@ -137,7 +135,7 @@ module FlashFlow
137
135
 
138
136
  def test_ignore_pushing_master_or_acceptance
139
137
  ['test_master', 'test_acceptance'].each do |branch|
140
- @deploy.instance_variable_get('@git'.to_sym).stub(:working_branch, branch) do
138
+ @deploy.instance_variable_get('@local_git'.to_sym).stub(:working_branch, branch) do
141
139
  refute(@deploy.open_pull_request)
142
140
  end
143
141
  end
data/test/lib/test_git.rb CHANGED
@@ -40,15 +40,15 @@ module FlashFlow
40
40
  @cmd_runner.expect(:run, true, ['rm -rf rr-cache/*'])
41
41
  @cmd_runner.expect(:run, true, ['cp -R .git/rr-cache/xyz rr-cache/'])
42
42
  @cmd_runner.expect(:run, true, ['cp -R .git/rr-cache/abc rr-cache/'])
43
- @cmd_runner.expect(:run, true, ['git add rr-cache/'])
44
- @cmd_runner.expect(:run, true, ["git commit -m 'Update rr-cache'"])
43
+ @cmd_runner.expect(:run, true, ['git add rr-cache/', {}])
44
+ @cmd_runner.expect(:run, true, ["git commit -m 'Update rr-cache'", {}])
45
45
 
46
46
  instance.commit_rerere(['xyz', 'abc'])
47
47
  @cmd_runner.verify
48
48
  end
49
49
 
50
50
  def test_read_file_from_merge_branch
51
- @cmd_runner.expect(:run, true, ["git show origin/acceptance:SomeFilename.txt"])
51
+ @cmd_runner.expect(:run, true, ["git show origin/acceptance:SomeFilename.txt", log: CmdRunner::LOG_CMD])
52
52
  @cmd_runner.expect(:last_stdout, 'some_json', [])
53
53
  @git_args['use_rerere'] = false
54
54
 
@@ -65,7 +65,7 @@ module FlashFlow
65
65
 
66
66
  def setup_cmd_runner
67
67
  cmd_runner = Minitest::Mock.new
68
- cmd_runner.expect(:run, true, ['git rev-parse --abbrev-ref HEAD'])
68
+ cmd_runner.expect(:run, true, ['git rev-parse --abbrev-ref HEAD', {}])
69
69
  cmd_runner.expect(:last_stdout, 'current_branch', [])
70
70
  cmd_runner
71
71
  end
@@ -10,6 +10,11 @@ module FlashFlow
10
10
  def stories_pushed; 'pushed!'; end
11
11
  def production_deploy; 'deployed!'; end
12
12
  def stories_delivered; 'delivered!'; end
13
+ def story_deployable?(story_id); "deployable: #{story_id}"; end
14
+ def story_link(story_id); "link: #{story_id}"; end
15
+ def story_title(story_id); "title: #{story_id}"; end
16
+ def release_keys(story_id); "release_keys: #{story_id}"; end
17
+ def stories_for_release(release_keys); "release stories: #{release_keys}"; end
13
18
  end
14
19
 
15
20
  def test_issue_tracker_class_not_set
@@ -19,6 +24,11 @@ module FlashFlow
19
24
  assert_nil(empty_issue_tracker.stories_pushed)
20
25
  assert_nil(empty_issue_tracker.stories_delivered)
21
26
  assert_nil(empty_issue_tracker.production_deploy)
27
+ assert_nil(empty_issue_tracker.story_deployable?('123'))
28
+ assert_nil(empty_issue_tracker.story_link('123'))
29
+ assert_nil(empty_issue_tracker.story_title('123'))
30
+ assert_nil(empty_issue_tracker.release_keys('123'))
31
+ assert_nil(empty_issue_tracker.stories_for_release('release'))
22
32
  end
23
33
  end
24
34
  end
@@ -29,6 +39,11 @@ module FlashFlow
29
39
  assert_equal(FakeIssueTracker.new.stories_pushed, issue_tracker.stories_pushed)
30
40
  assert_equal(FakeIssueTracker.new.stories_delivered, issue_tracker.stories_delivered)
31
41
  assert_equal(FakeIssueTracker.new.production_deploy, issue_tracker.production_deploy)
42
+ assert_equal(FakeIssueTracker.new.story_deployable?('123'), issue_tracker.story_deployable?('123'))
43
+ assert_equal(FakeIssueTracker.new.story_link('123'), issue_tracker.story_link('123'))
44
+ assert_equal(FakeIssueTracker.new.story_title('123'), issue_tracker.story_title('123'))
45
+ assert_equal(FakeIssueTracker.new.release_keys('123'), issue_tracker.release_keys('123'))
46
+ assert_equal(FakeIssueTracker.new.stories_for_release('release'), issue_tracker.stories_for_release('release'))
32
47
  end
33
48
  end
34
49
  end
@@ -4,10 +4,6 @@ module FlashFlow
4
4
  class TestResolve< Minitest::Test
5
5
 
6
6
  class ResolveTester < Resolve
7
- def in_shadow_repo
8
- yield
9
- end
10
-
11
7
  def in_working_branch
12
8
  yield
13
9
  end
@@ -71,30 +67,5 @@ module FlashFlow
71
67
  end
72
68
  end
73
69
 
74
-
75
-
76
- # def start
77
- # if unresolved_conflicts.empty?
78
- # puts "You have already resolved all conflicts."
79
- # else
80
- # launch_bash
81
- # @git.run("rerere")
82
- #
83
- # unless unresolved_conflicts.empty?
84
- # puts "There are still unresolved conflicts in these files:\n#{unresolved_conflicts.join("\n")}\n\n"
85
- # end
86
- # end
87
- #
88
- # @git.run("reset --hard HEAD")
89
- # end
90
- # end
91
- # end
92
-
93
-
94
- private
95
-
96
- def shadow_repo
97
- Minitest::Mock.new.expect(:in_dir, true)
98
- end
99
70
  end
100
71
  end
@@ -7,11 +7,13 @@ ENV['GH_TOKEN'] = 'fake_token'
7
7
  class Minitest::Test
8
8
 
9
9
  class TestCmdRunner < Minitest::Mock
10
+ LOG_NONE = :log_none
11
+ LOG_CMD = :log_cmd
12
+
10
13
  def initialize(opts={}); super(); end
11
- def run(_); end
12
- def last_success?
13
- true
14
- end
14
+ def run(_, opts={}); end
15
+ def last_success?; true; end
16
+ def dir=(other); other; end
15
17
  def last_stdout; ''; end
16
18
  def last_stderr; ''; end
17
19
  def last_command; ''; end
data/update_gem.sh ADDED
@@ -0,0 +1,5 @@
1
+ gem uninstall -x flash_flow
2
+ gem build flash_flow.gemspec
3
+ export VERSION=`ruby -r./lib/flash_flow/version -e "puts FlashFlow::VERSION"`
4
+ gem install flash_flow-$VERSION.gem --no-ri --no-rdoc
5
+ rbenv rehash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2.a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flashfunders
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ruby-graphviz
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +172,10 @@ files:
158
172
  - lib/flash_flow/issue_tracker/pivotal.rb
159
173
  - lib/flash_flow/lock.rb
160
174
  - lib/flash_flow/lock/github.rb
175
+ - lib/flash_flow/merge_master.rb
176
+ - lib/flash_flow/merge_master/merge_status.html.erb
177
+ - lib/flash_flow/merge_master/release_graph.rb
178
+ - lib/flash_flow/merge_master/status.rb
161
179
  - lib/flash_flow/notifier.rb
162
180
  - lib/flash_flow/notifier/hipchat.rb
163
181
  - lib/flash_flow/options.rb
@@ -173,6 +191,8 @@ files:
173
191
  - test/lib/data/test_store.rb
174
192
  - test/lib/issue_tracker/test_pivotal.rb
175
193
  - test/lib/lock/test_github.rb
194
+ - test/lib/merge_master/test_release_graph.rb
195
+ - test/lib/merge_master/test_status.rb
176
196
  - test/lib/test_branch_merger.rb
177
197
  - test/lib/test_config.rb
178
198
  - test/lib/test_deploy.rb
@@ -181,6 +201,7 @@ files:
181
201
  - test/lib/test_notifier.rb
182
202
  - test/lib/test_resolve.rb
183
203
  - test/minitest_helper.rb
204
+ - update_gem.sh
184
205
  homepage: https://github.com/FlashFunders/flash_flow
185
206
  licenses:
186
207
  - MIT
@@ -196,9 +217,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
217
  version: '0'
197
218
  required_rubygems_version: !ruby/object:Gem::Requirement
198
219
  requirements:
199
- - - ">="
220
+ - - ">"
200
221
  - !ruby/object:Gem::Version
201
- version: '0'
222
+ version: 1.3.1
202
223
  requirements: []
203
224
  rubyforge_project:
204
225
  rubygems_version: 2.2.2
@@ -213,6 +234,8 @@ test_files:
213
234
  - test/lib/data/test_store.rb
214
235
  - test/lib/issue_tracker/test_pivotal.rb
215
236
  - test/lib/lock/test_github.rb
237
+ - test/lib/merge_master/test_release_graph.rb
238
+ - test/lib/merge_master/test_status.rb
216
239
  - test/lib/test_branch_merger.rb
217
240
  - test/lib/test_config.rb
218
241
  - test/lib/test_deploy.rb