Commit 5d67fa9c authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Mark Lapierre

Do not delete shared resource on live environments

parent da9f22f9
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
def initialize def initialize
super super
@name = @path = 'reusable_group' @name = @path = QA::Runtime::Env.reusable_group_path
@description = "QA reusable group" @description = "QA reusable group"
@reuse_as = :default_group @reuse_as = :default_group
end end
......
...@@ -15,7 +15,7 @@ module QA ...@@ -15,7 +15,7 @@ module QA
super super
@add_name_uuid = false @add_name_uuid = false
@name = @path = 'reusable_project' @name = @path = QA::Runtime::Env.reusable_project_path
@reuse_as = :default_project @reuse_as = :default_project
@initialize_with_readme = true @initialize_with_readme = true
end end
......
...@@ -404,6 +404,14 @@ module QA ...@@ -404,6 +404,14 @@ module QA
ENV.fetch('GITLAB_QA_LOOP_RUNNER_MINUTES', 1).to_i ENV.fetch('GITLAB_QA_LOOP_RUNNER_MINUTES', 1).to_i
end end
def reusable_project_path
ENV.fetch('QA_REUSABLE_PROJECT_PATH', 'reusable_project')
end
def reusable_group_path
ENV.fetch('QA_REUSABLE_GROUP_PATH', 'reusable_group')
end
def mailhog_hostname def mailhog_hostname
ENV['MAILHOG_HOSTNAME'] ENV['MAILHOG_HOSTNAME']
end end
......
...@@ -76,7 +76,8 @@ RSpec.configure do |config| ...@@ -76,7 +76,8 @@ RSpec.configure do |config|
QA::Resource::ReusableCollection.validate_resource_reuse if QA::Runtime::Env.validate_resource_reuse? QA::Resource::ReusableCollection.validate_resource_reuse if QA::Runtime::Env.validate_resource_reuse?
# If any tests failed, leave the resources behind to help troubleshoot, otherwise remove them. # If any tests failed, leave the resources behind to help troubleshoot, otherwise remove them.
QA::Resource::ReusableCollection.remove_all_via_api! unless suite.reporter.failed_examples.present? # Do not remove the shared resource on live environments
QA::Resource::ReusableCollection.remove_all_via_api! if !suite.reporter.failed_examples.present? && !QA::Runtime::Env.running_on_dot_com?
end end
config.append_after(:suite) do config.append_after(:suite) 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