summaryrefslogtreecommitdiff
path: root/qa/qa/tools/test_resource_data_processor.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-18 20:02:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-18 20:02:30 +0000
commit41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch)
tree9c8d89a8624828992f06d892cd2f43818ff5dcc8 /qa/qa/tools/test_resource_data_processor.rb
parent0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff)
downloadgitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'qa/qa/tools/test_resource_data_processor.rb')
-rw-r--r--qa/qa/tools/test_resource_data_processor.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/qa/qa/tools/test_resource_data_processor.rb b/qa/qa/tools/test_resource_data_processor.rb
index 965919dc516..a86c94b4914 100644
--- a/qa/qa/tools/test_resource_data_processor.rb
+++ b/qa/qa/tools/test_resource_data_processor.rb
@@ -49,10 +49,12 @@ module QA
# Otherwise create file and write data hash to file for the first time
#
# @return [void]
- def write_to_file
+ def write_to_file(suite_failed)
return if resources.empty?
- file = Pathname.new(Runtime::Env.test_resources_created_filepath)
+ start_str = suite_failed ? 'failed-test-resources' : 'test-resources'
+ file_name = Runtime::Env.running_in_ci? ? "#{start_str}-#{SecureRandom.hex(3)}.json" : "#{start_str}.json"
+ file = Pathname.new(File.join(Runtime::Path.qa_root, 'tmp', file_name))
FileUtils.mkdir_p(file.dirname)
data = resources.deep_dup
@@ -79,7 +81,7 @@ module QA
else
default
end
- rescue QA::Resource::Base::NoValueError
+ rescue QA::Resource::Base::NoValueError, QA::Resource::Errors::ResourceNotFoundError
default
end
end