pogo 2.32.14 → 2.39.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -2
- data/lib/heroku/auth.rb +3 -1
- data/lib/heroku/client.rb +8 -5
- data/lib/heroku/client/cisaurus.rb +25 -0
- data/lib/heroku/client/heroku_postgresql.rb +0 -3
- data/lib/heroku/client/rendezvous.rb +2 -1
- data/lib/heroku/command.rb +1 -1
- data/lib/heroku/command/addons.rb +11 -2
- data/lib/heroku/command/apps.rb +105 -20
- data/lib/heroku/command/base.rb +1 -1
- data/lib/heroku/command/certs.rb +95 -34
- data/lib/heroku/command/config.rb +5 -5
- data/lib/heroku/command/domains.rb +4 -4
- data/lib/heroku/command/fork.rb +160 -0
- data/lib/heroku/command/git.rb +19 -20
- data/lib/heroku/command/help.rb +18 -2
- data/lib/heroku/command/keys.rb +1 -1
- data/lib/heroku/command/labs.rb +1 -1
- data/lib/heroku/command/logs.rb +3 -56
- data/lib/heroku/command/maintenance.rb +2 -2
- data/lib/heroku/command/pg.rb +7 -16
- data/lib/heroku/command/pgbackups.rb +37 -17
- data/lib/heroku/command/ps.rb +82 -35
- data/lib/heroku/command/regions.rb +23 -0
- data/lib/heroku/command/releases.rb +3 -3
- data/lib/heroku/command/run.rb +40 -27
- data/lib/heroku/command/sharing.rb +4 -4
- data/lib/heroku/command/ssl.rb +7 -25
- data/lib/heroku/command/stack.rb +1 -1
- data/lib/heroku/helpers/heroku_postgresql.rb +13 -17
- data/lib/heroku/helpers/log_displayer.rb +70 -0
- data/lib/heroku/plugin.rb +3 -0
- data/lib/heroku/updater.rb +11 -2
- data/lib/heroku/version.rb +1 -1
- data/spec/heroku/auth_spec.rb +10 -0
- data/spec/heroku/client/ssl_endpoint_spec.rb +12 -12
- data/spec/heroku/client_spec.rb +100 -100
- data/spec/heroku/command/addons_spec.rb +63 -59
- data/spec/heroku/command/apps_spec.rb +68 -65
- data/spec/heroku/command/base_spec.rb +21 -21
- data/spec/heroku/command/certs_spec.rb +31 -31
- data/spec/heroku/command/config_spec.rb +18 -18
- data/spec/heroku/command/db_spec.rb +3 -3
- data/spec/heroku/command/domains_spec.rb +13 -13
- data/spec/heroku/command/drains_spec.rb +3 -3
- data/spec/heroku/command/fork_spec.rb +56 -0
- data/spec/heroku/command/git_spec.rb +57 -29
- data/spec/heroku/command/labs_spec.rb +8 -8
- data/spec/heroku/command/logs_spec.rb +3 -3
- data/spec/heroku/command/maintenance_spec.rb +5 -5
- data/spec/heroku/command/pg_spec.rb +11 -25
- data/spec/heroku/command/pgbackups_spec.rb +13 -8
- data/spec/heroku/command/ps_spec.rb +23 -23
- data/spec/heroku/command/releases_spec.rb +22 -24
- data/spec/heroku/command/run_spec.rb +12 -15
- data/spec/heroku/command/sharing_spec.rb +9 -9
- data/spec/heroku/command/stack_spec.rb +4 -4
- data/spec/heroku/command_spec.rb +12 -12
- data/spec/heroku/helpers/heroku_postgresql_spec.rb +35 -14
- data/spec/spec_helper.rb +17 -2
- data/spec/support/openssl_mock_helper.rb +1 -1
- metadata +11 -6
- data/spec/heroku/command/ssl_spec.rb +0 -32
@@ -5,7 +5,7 @@ describe Heroku::Command::Drains do
|
|
5
5
|
|
6
6
|
describe "drains" do
|
7
7
|
it "can list drains" do
|
8
|
-
stub_core.list_drains("
|
8
|
+
stub_core.list_drains("example").returns("drains")
|
9
9
|
stderr, stdout = execute("drains")
|
10
10
|
stderr.should == ""
|
11
11
|
stdout.should == <<-STDOUT
|
@@ -14,7 +14,7 @@ STDOUT
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "can add drains" do
|
17
|
-
stub_core.add_drain("
|
17
|
+
stub_core.add_drain("example", "syslog://localhost/add").returns("added")
|
18
18
|
stderr, stdout = execute("drains:add syslog://localhost/add")
|
19
19
|
stderr.should == ""
|
20
20
|
stdout.should == <<-STDOUT
|
@@ -23,7 +23,7 @@ STDOUT
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "can remove drains" do
|
26
|
-
stub_core.remove_drain("
|
26
|
+
stub_core.remove_drain("example", "syslog://localhost/remove").returns("removed")
|
27
27
|
stderr, stdout = execute("drains:remove syslog://localhost/remove")
|
28
28
|
stderr.should == ""
|
29
29
|
stdout.should == <<-STDOUT
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "heroku/command/fork"
|
3
|
+
require "heroku/client/cisaurus"
|
4
|
+
|
5
|
+
module Heroku::Command
|
6
|
+
|
7
|
+
describe Fork do
|
8
|
+
|
9
|
+
before(:each) do
|
10
|
+
stub_core
|
11
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
12
|
+
end
|
13
|
+
|
14
|
+
after(:each) do
|
15
|
+
api.delete_app("example")
|
16
|
+
api.delete_app("example-fork")
|
17
|
+
end
|
18
|
+
|
19
|
+
context "successfully" do
|
20
|
+
|
21
|
+
before(:each) do
|
22
|
+
stub_cisaurus.copy_slug.returns("/v1/jobs/4099d263-bf67-4c0b-80f5-64a5d25598fd")
|
23
|
+
stub_cisaurus.job_done?.returns(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "forks an app" do
|
27
|
+
stderr, stdout = execute("fork example-fork")
|
28
|
+
stderr.should == ""
|
29
|
+
stdout.should == <<-STDOUT
|
30
|
+
Creating fork example-fork... done
|
31
|
+
Copying slug... done
|
32
|
+
Copying config vars... done
|
33
|
+
Fork complete, view it at http://example-fork.herokuapp.com/
|
34
|
+
STDOUT
|
35
|
+
end
|
36
|
+
|
37
|
+
it "copies config vars" do
|
38
|
+
config_vars = {
|
39
|
+
"SECRET" => "imasecret",
|
40
|
+
"FOO" => "bar",
|
41
|
+
"LANG_ENV" => "production"
|
42
|
+
}
|
43
|
+
api.put_config_vars("example", config_vars)
|
44
|
+
execute("fork example-fork")
|
45
|
+
api.get_config_vars("example-fork").body.should == config_vars
|
46
|
+
end
|
47
|
+
|
48
|
+
it "re-provisions add-ons" do
|
49
|
+
addons = ["pgbackups:basic", "deployhooks:http"].sort
|
50
|
+
addons.each { |a| api.post_addon("example", a) }
|
51
|
+
execute("fork example-fork")
|
52
|
+
api.get_addons("example-fork").body.collect { |info| info["name"] }.sort.should == addons
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -11,52 +11,80 @@ module Heroku::Command
|
|
11
11
|
context("clone") do
|
12
12
|
|
13
13
|
before(:each) do
|
14
|
-
api.post_app("name" => "
|
15
|
-
FileUtils.mkdir('myapp')
|
16
|
-
FileUtils.chdir('myapp') { `git init` }
|
14
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
17
15
|
end
|
18
16
|
|
19
17
|
after(:each) do
|
20
|
-
api.delete_app("
|
21
|
-
FileUtils.rm_rf('myapp')
|
18
|
+
api.delete_app("example")
|
22
19
|
end
|
23
20
|
|
24
21
|
it "clones and adds remote" do
|
25
22
|
any_instance_of(Heroku::Command::Git) do |git|
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
mock(git).system("git clone -o heroku git@heroku.com:example.git") do
|
24
|
+
puts "Cloning into 'example'..."
|
25
|
+
end
|
29
26
|
end
|
30
|
-
stderr, stdout = execute("git:clone")
|
27
|
+
stderr, stdout = execute("git:clone example")
|
31
28
|
stderr.should == ""
|
32
29
|
stdout.should == <<-STDOUT
|
33
|
-
Cloning
|
34
|
-
|
30
|
+
Cloning from app 'example'...
|
31
|
+
Cloning into 'example'...
|
35
32
|
STDOUT
|
36
33
|
end
|
37
34
|
|
38
|
-
it "clones
|
35
|
+
it "clones into another dir" do
|
39
36
|
any_instance_of(Heroku::Command::Git) do |git|
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
mock(git).system("git clone -o heroku git@heroku.com:example.git somedir") do
|
38
|
+
puts "Cloning into 'somedir'..."
|
39
|
+
end
|
43
40
|
end
|
44
|
-
stderr, stdout = execute("git:clone
|
41
|
+
stderr, stdout = execute("git:clone example somedir")
|
45
42
|
stderr.should == ""
|
46
43
|
stdout.should == <<-STDOUT
|
47
|
-
Cloning
|
48
|
-
|
44
|
+
Cloning from app 'example'...
|
45
|
+
Cloning into 'somedir'...
|
46
|
+
STDOUT
|
47
|
+
end
|
48
|
+
|
49
|
+
it "can specify app with -a" do
|
50
|
+
any_instance_of(Heroku::Command::Git) do |git|
|
51
|
+
mock(git).system("git clone -o heroku git@heroku.com:example.git") do
|
52
|
+
puts "Cloning into 'example'..."
|
53
|
+
end
|
54
|
+
end
|
55
|
+
stderr, stdout = execute("git:clone -a example")
|
56
|
+
stderr.should == ""
|
57
|
+
stdout.should == <<-STDOUT
|
58
|
+
Cloning from app 'example'...
|
59
|
+
Cloning into 'example'...
|
60
|
+
STDOUT
|
61
|
+
end
|
62
|
+
|
63
|
+
it "can specify app with -a and a dir" do
|
64
|
+
any_instance_of(Heroku::Command::Git) do |git|
|
65
|
+
mock(git).system("git clone -o heroku git@heroku.com:example.git somedir") do
|
66
|
+
puts "Cloning into 'somedir'..."
|
67
|
+
end
|
68
|
+
end
|
69
|
+
stderr, stdout = execute("git:clone -a example somedir")
|
70
|
+
stderr.should == ""
|
71
|
+
stdout.should == <<-STDOUT
|
72
|
+
Cloning from app 'example'...
|
73
|
+
Cloning into 'somedir'...
|
49
74
|
STDOUT
|
50
75
|
end
|
51
76
|
|
52
|
-
it "clones and
|
77
|
+
it "clones and sets -r remote" do
|
53
78
|
any_instance_of(Heroku::Command::Git) do |git|
|
54
|
-
|
79
|
+
mock(git).system("git clone -o other git@heroku.com:example.git") do
|
80
|
+
puts "Cloning into 'example'..."
|
81
|
+
end
|
55
82
|
end
|
56
|
-
stderr, stdout = execute("git:clone
|
83
|
+
stderr, stdout = execute("git:clone example -r other")
|
57
84
|
stderr.should == ""
|
58
85
|
stdout.should == <<-STDOUT
|
59
|
-
Cloning
|
86
|
+
Cloning from app 'example'...
|
87
|
+
Cloning into 'example'...
|
60
88
|
STDOUT
|
61
89
|
end
|
62
90
|
|
@@ -65,20 +93,20 @@ Cloning into 'myapp'...
|
|
65
93
|
context("remote") do
|
66
94
|
|
67
95
|
before(:each) do
|
68
|
-
api.post_app("name" => "
|
69
|
-
FileUtils.mkdir('
|
70
|
-
FileUtils.chdir('
|
96
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
97
|
+
FileUtils.mkdir('example')
|
98
|
+
FileUtils.chdir('example') { `git init` }
|
71
99
|
end
|
72
100
|
|
73
101
|
after(:each) do
|
74
|
-
api.delete_app("
|
75
|
-
FileUtils.rm_rf('
|
102
|
+
api.delete_app("example")
|
103
|
+
FileUtils.rm_rf('example')
|
76
104
|
end
|
77
105
|
|
78
106
|
it "adds remote" do
|
79
107
|
any_instance_of(Heroku::Command::Git) do |git|
|
80
108
|
stub(git).git('remote').returns("origin")
|
81
|
-
stub(git).git('remote add heroku git@heroku.com:
|
109
|
+
stub(git).git('remote add heroku git@heroku.com:example.git')
|
82
110
|
end
|
83
111
|
stderr, stdout = execute("git:remote")
|
84
112
|
stderr.should == ""
|
@@ -90,7 +118,7 @@ Git remote heroku added
|
|
90
118
|
it "adds -r remote" do
|
91
119
|
any_instance_of(Heroku::Command::Git) do |git|
|
92
120
|
stub(git).git('remote').returns("origin")
|
93
|
-
stub(git).git('remote add other git@heroku.com:
|
121
|
+
stub(git).git('remote add other git@heroku.com:example.git')
|
94
122
|
end
|
95
123
|
stderr, stdout = execute("git:remote -r other")
|
96
124
|
stderr.should == ""
|
@@ -7,11 +7,11 @@ module Heroku::Command
|
|
7
7
|
|
8
8
|
before(:each) do
|
9
9
|
stub_core
|
10
|
-
api.post_app("name" => "
|
10
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
11
11
|
end
|
12
12
|
|
13
13
|
after(:each) do
|
14
|
-
api.delete_app("
|
14
|
+
api.delete_app("example")
|
15
15
|
end
|
16
16
|
|
17
17
|
it "lists available features" do
|
@@ -21,21 +21,21 @@ module Heroku::Command
|
|
21
21
|
=== User Features (email@example.com)
|
22
22
|
[ ] sumo-rankings Heroku Sumo ranks and visualizes the scale of your app, and suggests the optimum combination of dynos and add-ons to take it to the next level.
|
23
23
|
|
24
|
-
=== App Features (
|
24
|
+
=== App Features (example)
|
25
25
|
[+] sigterm-all When stopping a dyno, send SIGTERM to all processes rather than only to the root process.
|
26
26
|
[ ] user_env_compile Add user config vars to the environment during slug compilation
|
27
27
|
STDOUT
|
28
28
|
end
|
29
29
|
|
30
30
|
it "lists enabled features" do
|
31
|
-
stub_core.list_features("
|
31
|
+
stub_core.list_features("example").returns([])
|
32
32
|
stderr, stdout = execute("labs")
|
33
33
|
stderr.should == ""
|
34
34
|
stdout.should == <<-STDOUT
|
35
35
|
=== User Features (email@example.com)
|
36
36
|
[ ] sumo-rankings Heroku Sumo ranks and visualizes the scale of your app, and suggests the optimum combination of dynos and add-ons to take it to the next level.
|
37
37
|
|
38
|
-
=== App Features (
|
38
|
+
=== App Features (example)
|
39
39
|
[+] sigterm-all When stopping a dyno, send SIGTERM to all processes rather than only to the root process.
|
40
40
|
[ ] user_env_compile Add user config vars to the environment during slug compilation
|
41
41
|
STDOUT
|
@@ -64,7 +64,7 @@ STDERR
|
|
64
64
|
stderr, stdout = execute("labs:enable user_env_compile")
|
65
65
|
stderr.should == ""
|
66
66
|
stdout.should == <<-STDOUT
|
67
|
-
Enabling user_env_compile for
|
67
|
+
Enabling user_env_compile for example... done
|
68
68
|
WARNING: This feature is experimental and may change or be removed without notice.
|
69
69
|
For more information see: http://devcenter.heroku.com/articles/labs-user-env-compile
|
70
70
|
STDOUT
|
@@ -80,11 +80,11 @@ STDERR
|
|
80
80
|
end
|
81
81
|
|
82
82
|
it "disables a feature" do
|
83
|
-
api.post_feature('user_env_compile', '
|
83
|
+
api.post_feature('user_env_compile', 'example')
|
84
84
|
stderr, stdout = execute("labs:disable user_env_compile")
|
85
85
|
stderr.should == ""
|
86
86
|
stdout.should == <<-STDOUT
|
87
|
-
Disabling user_env_compile for
|
87
|
+
Disabling user_env_compile for example... done
|
88
88
|
STDOUT
|
89
89
|
end
|
90
90
|
|
@@ -4,12 +4,12 @@ require "heroku/command/logs"
|
|
4
4
|
describe Heroku::Command::Logs do
|
5
5
|
describe "logs" do
|
6
6
|
it "runs with no options" do
|
7
|
-
stub_core.read_logs("
|
7
|
+
stub_core.read_logs("example", [])
|
8
8
|
execute "logs"
|
9
9
|
end
|
10
10
|
|
11
11
|
it "runs with options" do
|
12
|
-
stub_core.read_logs("
|
12
|
+
stub_core.read_logs("example", [
|
13
13
|
"tail=1",
|
14
14
|
"num=2",
|
15
15
|
"ps=ps.3",
|
@@ -20,7 +20,7 @@ describe Heroku::Command::Logs do
|
|
20
20
|
|
21
21
|
describe "with log output" do
|
22
22
|
before(:each) do
|
23
|
-
stub_core.read_logs("
|
23
|
+
stub_core.read_logs("example", []).yields("2011-01-01T00:00:00+00:00 app[web.1]: test")
|
24
24
|
end
|
25
25
|
|
26
26
|
it "prettifies tty output" do
|
@@ -6,11 +6,11 @@ module Heroku::Command
|
|
6
6
|
|
7
7
|
before(:each) do
|
8
8
|
stub_core
|
9
|
-
api.post_app("name" => "
|
9
|
+
api.post_app("name" => "example", "stack" => "cedar")
|
10
10
|
end
|
11
11
|
|
12
12
|
after(:each) do
|
13
|
-
api.delete_app("
|
13
|
+
api.delete_app("example")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "displays off for maintenance mode of an app" do
|
@@ -22,7 +22,7 @@ STDOUT
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "displays on for maintenance mode of an app" do
|
25
|
-
api.post_app_maintenance('
|
25
|
+
api.post_app_maintenance('example', '1')
|
26
26
|
|
27
27
|
stderr, stdout = execute("maintenance")
|
28
28
|
stderr.should == ""
|
@@ -35,7 +35,7 @@ STDOUT
|
|
35
35
|
stderr, stdout = execute("maintenance:on")
|
36
36
|
stderr.should == ""
|
37
37
|
stdout.should == <<-STDOUT
|
38
|
-
Enabling maintenance mode for
|
38
|
+
Enabling maintenance mode for example... done
|
39
39
|
STDOUT
|
40
40
|
end
|
41
41
|
|
@@ -43,7 +43,7 @@ STDOUT
|
|
43
43
|
stderr, stdout = execute("maintenance:off")
|
44
44
|
stderr.should == ""
|
45
45
|
stdout.should == <<-STDOUT
|
46
|
-
Disabling maintenance mode for
|
46
|
+
Disabling maintenance mode for example... done
|
47
47
|
STDOUT
|
48
48
|
end
|
49
49
|
|
@@ -6,10 +6,9 @@ module Heroku::Command
|
|
6
6
|
before do
|
7
7
|
stub_core
|
8
8
|
|
9
|
-
api.post_app "name" => "
|
10
|
-
api.put_config_vars "
|
9
|
+
api.post_app "name" => "example"
|
10
|
+
api.put_config_vars "example", {
|
11
11
|
"DATABASE_URL" => "postgres://database_url",
|
12
|
-
"SHARED_DATABASE_URL" => "postgres://shared_database_url",
|
13
12
|
"HEROKU_POSTGRESQL_IVORY_URL" => "postgres://database_url",
|
14
13
|
"HEROKU_POSTGRESQL_RONIN_URL" => "postgres://ronin_database_url"
|
15
14
|
}
|
@@ -36,40 +35,30 @@ module Heroku::Command
|
|
36
35
|
end
|
37
36
|
|
38
37
|
after do
|
39
|
-
api.delete_app "
|
38
|
+
api.delete_app "example"
|
40
39
|
end
|
41
40
|
|
42
41
|
it "resets the app's database if user confirms" do
|
43
42
|
stub_pg.reset
|
44
43
|
|
45
|
-
stderr, stdout = execute("pg:reset RONIN --confirm
|
44
|
+
stderr, stdout = execute("pg:reset RONIN --confirm example")
|
46
45
|
stderr.should == ""
|
47
46
|
stdout.should == <<-STDOUT
|
48
47
|
Resetting HEROKU_POSTGRESQL_RONIN_URL... done
|
49
48
|
STDOUT
|
50
49
|
end
|
51
50
|
|
52
|
-
it "resets shared databases" do
|
53
|
-
Heroku::Client.any_instance.should_receive(:database_reset).with('myapp')
|
54
|
-
|
55
|
-
stderr, stdout = execute("pg:reset SHARED_DATABASE --confirm myapp")
|
56
|
-
stderr.should == ''
|
57
|
-
stdout.should == <<-STDOUT
|
58
|
-
Resetting SHARED_DATABASE... done
|
59
|
-
STDOUT
|
60
|
-
end
|
61
|
-
|
62
51
|
it "doesn't reset the app's database if the user doesn't confirm" do
|
63
52
|
stub_pg.reset
|
64
53
|
|
65
54
|
stderr, stdout = execute("pg:reset RONIN")
|
66
55
|
stderr.should == <<-STDERR
|
67
|
-
! Confirmation did not match
|
56
|
+
! Confirmation did not match example. Aborted.
|
68
57
|
STDERR
|
69
58
|
stdout.should == "
|
70
59
|
! WARNING: Destructive Action
|
71
|
-
! This command will affect the app:
|
72
|
-
! To proceed, type \"
|
60
|
+
! This command will affect the app: example
|
61
|
+
! To proceed, type \"example\" or re-run this command with --confirm example
|
73
62
|
|
74
63
|
> "
|
75
64
|
end
|
@@ -120,9 +109,6 @@ Fork/Follow: Available
|
|
120
109
|
Created: 2011-12-13 00:00 UTC
|
121
110
|
Maintenance: not required
|
122
111
|
|
123
|
-
=== SHARED_DATABASE
|
124
|
-
Data Size: (empty)
|
125
|
-
|
126
112
|
STDOUT
|
127
113
|
end
|
128
114
|
end
|
@@ -161,12 +147,12 @@ STDOUT
|
|
161
147
|
|
162
148
|
context "promotion" do
|
163
149
|
it "promotes the specified database" do
|
164
|
-
stderr, stdout = execute("pg:promote RONIN --confirm
|
150
|
+
stderr, stdout = execute("pg:promote RONIN --confirm example")
|
165
151
|
stderr.should == ""
|
166
152
|
stdout.should == <<-STDOUT
|
167
153
|
Promoting HEROKU_POSTGRESQL_RONIN_URL to DATABASE_URL... done
|
168
154
|
STDOUT
|
169
|
-
api.get_config_vars("
|
155
|
+
api.get_config_vars("example").body["DATABASE_URL"].should == "postgres://ronin_database_url"
|
170
156
|
end
|
171
157
|
|
172
158
|
it "fails if no database is specified" do
|
@@ -192,7 +178,7 @@ STDOUT
|
|
192
178
|
|
193
179
|
it "does not update DATABASE_URL if it's not the main db" do
|
194
180
|
stub_pg.rotate_credentials
|
195
|
-
api.put_config_vars "
|
181
|
+
api.put_config_vars "example", {
|
196
182
|
"DATABASE_URL" => "postgres://to_reset_credentials",
|
197
183
|
"HEROKU_POSTGRESQL_RESETME_URL" => "postgres://something_else"
|
198
184
|
}
|
@@ -222,7 +208,7 @@ STDOUT
|
|
222
208
|
{"name"=>"Maintenance", "values"=>["not required"]}
|
223
209
|
]
|
224
210
|
)
|
225
|
-
stderr, stdout = execute("pg:unfollow HEROKU_POSTGRESQL_FOLLOW_URL --confirm
|
211
|
+
stderr, stdout = execute("pg:unfollow HEROKU_POSTGRESQL_FOLLOW_URL --confirm example")
|
226
212
|
stderr.should == ""
|
227
213
|
stdout.should == <<-STDOUT
|
228
214
|
! HEROKU_POSTGRESQL_FOLLOW_URL will become writable and no longer
|
@@ -7,9 +7,9 @@ module Heroku::Command
|
|
7
7
|
@pgbackups = prepare_command(Pgbackups)
|
8
8
|
@pgbackups.heroku.stub!(:info).and_return({})
|
9
9
|
|
10
|
-
api.post_app("name" => "
|
10
|
+
api.post_app("name" => "example")
|
11
11
|
api.put_config_vars(
|
12
|
-
"
|
12
|
+
"example",
|
13
13
|
{
|
14
14
|
"DATABASE_URL" => "postgres://database",
|
15
15
|
"HEROKU_POSTGRESQL_IVORY" => "postgres://database",
|
@@ -30,15 +30,17 @@ module Heroku::Command
|
|
30
30
|
}
|
31
31
|
|
32
32
|
after do
|
33
|
-
api.delete_app("
|
33
|
+
api.delete_app("example")
|
34
34
|
end
|
35
35
|
|
36
36
|
it "requests a pgbackups transfer list for the index command" do
|
37
37
|
stub_core
|
38
38
|
stub_pgbackups.get_transfers.returns([{
|
39
39
|
"created_at" => "2012-01-01 12:00:00 +0000",
|
40
|
+
"started_at" => "2012-01-01 12:00:01 +0000",
|
40
41
|
"from_name" => "DATABASE",
|
41
42
|
"size" => "1024",
|
43
|
+
"progress" => "dump 2048",
|
42
44
|
"to_name" => "BACKUP",
|
43
45
|
"to_url" => "s3://bucket/userid/b001.dump"
|
44
46
|
}])
|
@@ -46,9 +48,9 @@ module Heroku::Command
|
|
46
48
|
stderr, stdout = execute("pgbackups")
|
47
49
|
stderr.should == ""
|
48
50
|
stdout.should == <<-STDOUT
|
49
|
-
ID Backup Time Size Database
|
50
|
-
---- ------------------------- ---- --------
|
51
|
-
b001 2012-01-01 12:00:00 +0000 1024 DATABASE
|
51
|
+
ID Backup Time Status Size Database
|
52
|
+
---- ------------------------- --------- ---- --------
|
53
|
+
b001 2012-01-01 12:00:00 +0000 Capturing 1024 DATABASE
|
52
54
|
STDOUT
|
53
55
|
end
|
54
56
|
|
@@ -130,7 +132,7 @@ STDOUT
|
|
130
132
|
end
|
131
133
|
|
132
134
|
it "aborts if no database addon is present" do
|
133
|
-
api.delete_config_var("
|
135
|
+
api.delete_config_var("example", "DATABASE_URL")
|
134
136
|
stub_core
|
135
137
|
stderr, stdout = execute("pgbackups:capture")
|
136
138
|
stderr.should == <<-STDERR
|
@@ -163,6 +165,7 @@ STDERR
|
|
163
165
|
stderr, stdout = execute("pgbackups:capture")
|
164
166
|
stderr.should == <<-STDERR
|
165
167
|
! An error occurred and your backup did not finish.
|
168
|
+
! Please run `heroku logs --ps pgbackups` for details.
|
166
169
|
STDERR
|
167
170
|
stdout.should == <<-STDOUT
|
168
171
|
|
@@ -177,6 +180,7 @@ STDOUT
|
|
177
180
|
stderr, stdout = execute("pgbackups:capture")
|
178
181
|
stderr.should == <<-STDERR
|
179
182
|
! An error occurred and your backup did not finish.
|
183
|
+
! Please run `heroku logs --ps pgbackups` for details.
|
180
184
|
! The database is not yet online. Please try again.
|
181
185
|
STDERR
|
182
186
|
stdout.should == <<-STDOUT
|
@@ -192,6 +196,7 @@ STDOUT
|
|
192
196
|
stderr, stdout = execute("pgbackups:capture")
|
193
197
|
stderr.should == <<-STDERR
|
194
198
|
! An error occurred and your backup did not finish.
|
199
|
+
! Please run `heroku logs --ps pgbackups` for details.
|
195
200
|
! The database credentials are incorrect.
|
196
201
|
STDERR
|
197
202
|
stdout.should == <<-STDOUT
|
@@ -287,7 +292,7 @@ STDOUT
|
|
287
292
|
|
288
293
|
it 'aborts for a generic error' do
|
289
294
|
stub_error_backup_with_log 'something generic'
|
290
|
-
@pgbackups.should_receive(:error).with("An error occurred and your restore did not finish.")
|
295
|
+
@pgbackups.should_receive(:error).with("An error occurred and your restore did not finish.\nPlease run `heroku logs --ps pgbackups` for details.")
|
291
296
|
@pgbackups.restore
|
292
297
|
end
|
293
298
|
|