Commit fbaf26a2 authored by David Fernandez's avatar David Fernandez

Merge branch 'db-restore-ignore-warn' into 'master'

Don't fail db restore for warnings

See merge request gitlab-org/gitlab!66094
parents 73dbf64b 3325d9cd
......@@ -9,6 +9,8 @@ module Backup
attr_reader :config, :db_file_name
IGNORED_ERRORS = [
# Ignore warnings
/WARNING:/,
# Ignore the DROP errors; recent database dumps will use --if-exists with pg_dump
/does not exist$/,
# User may not have permissions to drop extensions or schemas
......
......@@ -38,7 +38,7 @@ RSpec.describe Backup::Database do
context 'when the restore command prints errors' do
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}")] }
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