Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Both pg_dump and pg_basebackup are supported ways to backup the database #221

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lib/manageiq/appliance_console/database_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ class DatabaseAdmin < HighLine
Example: 'mydomain.com/user'
PROMPT

DB_DUMP_WARNING = <<-WARN.strip_heredoc
WARNING: This is not the recommended and supported way of running a
database backup, and is strictly meant for exporting a database for
support/debugging purposes!


WARN

attr_reader :action, :backup_type, :database_opts, :delete_agree, :filename

def initialize(action = :restore, input = $stdin, output = $stdout)
Expand All @@ -43,7 +35,6 @@ def ask_questions
press_any_key
raise MiqSignalError
end
say(DB_DUMP_WARNING) if action == :dump
ask_file_location
ask_for_tables_to_exclude_in_dump
end
Expand Down
29 changes: 1 addition & 28 deletions spec/database_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,40 +461,13 @@ def confirm_and_execute
subject { described_class.new(:dump, input, output) }

describe "#ask_questions" do
let(:pg_dump_warning) do
<<-WARN.strip_heredoc
WARNING: This is not the recommended and supported way of running a
database backup, and is strictly meant for exporting a database for
support/debugging purposes!


WARN
end

it "warns about using pg_dump and asks for file location" do
it "asks for file location and tables to exclude" do
expect(subject).to receive(:say).with("Create Database Dump\n\n")
expect(subject).to receive(:say).with(pg_dump_warning)
expect(subject).to receive(:ask_file_location)
expect(subject).to receive(:ask_for_tables_to_exclude_in_dump)

subject.ask_questions
end

it "has proper formatting for the pg_dump warning" do
allow(subject).to receive(:ask_file_location)
allow(subject).to receive(:ask_for_tables_to_exclude_in_dump)
subject.ask_questions

expect_output <<-PROMPT.strip_heredoc
Create Database Dump

WARNING: This is not the recommended and supported way of running a
database backup, and is strictly meant for exporting a database for
support/debugging purposes!


PROMPT
end
end

describe "#activate" do
Expand Down