diff options
Diffstat (limited to 'spec/support/database/auto_explain.rb')
-rw-r--r-- | spec/support/database/auto_explain.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/database/auto_explain.rb b/spec/support/database/auto_explain.rb index 799457034a1..11f8f1f899b 100644 --- a/spec/support/database/auto_explain.rb +++ b/spec/support/database/auto_explain.rb @@ -119,9 +119,10 @@ module AutoExplain return false if ENV['CI_JOB_NAME_SLUG'] == 'db-migrate-non-superuser' return false if connection.database_version.to_s[0..1].to_i < 14 return false if connection.select_one('SHOW is_superuser')['is_superuser'] != 'on' + return false if connection.select_one('SELECT pg_stat_file(\'log/pglog.csv\', true)')['pg_stat_file'].nil? - # This condition matches the pipeline rules for if-merge-request-labels-record-queries - return true if ENV['CI_MERGE_REQUEST_LABELS']&.include?('pipeline:record-queries') + # This condition matches the pipeline rules for if-merge-request + return true if %w[detached merged_result].include?(ENV['CI_MERGE_REQUEST_EVENT_TYPE']) # This condition matches the pipeline rules for if-default-branch-refs ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] && !ENV['CI_MERGE_REQUEST_IID'] |