Commit 3325d9cd authored by DJ Mountney's avatar DJ Mountney Committed by David Fernandez

Don't fail db restore for warnings

parent 7c8c5936
...@@ -9,6 +9,8 @@ module Backup ...@@ -9,6 +9,8 @@ module Backup
attr_reader :config, :db_file_name attr_reader :config, :db_file_name
IGNORED_ERRORS = [ IGNORED_ERRORS = [
# Ignore warnings
/WARNING:/,
# Ignore the DROP errors; recent database dumps will use --if-exists with pg_dump # Ignore the DROP errors; recent database dumps will use --if-exists with pg_dump
/does not exist$/, /does not exist$/,
# User may not have permissions to drop extensions or schemas # User may not have permissions to drop extensions or schemas
......
...@@ -38,7 +38,7 @@ RSpec.describe Backup::Database do ...@@ -38,7 +38,7 @@ RSpec.describe Backup::Database do
context 'when the restore command prints errors' do context 'when the restore command prints errors' do
let(:visible_error) { "This is a test error\n" } let(:visible_error) { "This is a test error\n" }
let(:noise) { "Table projects does not exist\nmust be owner of extension pg_trgm\n" } let(:noise) { "Table projects does not exist\nmust be owner of extension pg_trgm\nWARNING: no privileges could be revoked for public\n" }
let(:cmd) { %W[#{Gem.ruby} -e $stderr.write("#{noise}#{visible_error}")] } let(:cmd) { %W[#{Gem.ruby} -e $stderr.write("#{noise}#{visible_error}")] }
it 'filters out noise from errors' do it 'filters out noise from errors' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment