Skip to content

Commit a73bca5

Browse files
author
Alexey Alter-Pesotskiy
committed
[BW] Update Allurefile
1 parent 9524568 commit a73bca5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

fastlane/Allurefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ desc 'Upload test results to Allure TestOps'
99
lane :allure_upload do |options|
1010
branch = github_run_details['head_branch']
1111
allure_args = "-e #{allure_endpoint} --project-id #{allure_project_id} --launch-id #{options[:launch_id]}"
12-
sh("./xcresults export test_output/StreamChatSwiftUITestsApp.xcresult #{allure_results_path}")
13-
sh("env BRANCH_NAME='#{branch}' ./allurectl upload #{allure_args} #{allure_results_path}")
12+
sh("./xcresults export test_output/StreamChatUITestsApp.xcresult #{allure_results_path} || true")
13+
sh("./allurectl launch reopen #{options[:launch_id]} || true") # to prevent allure from uploading results to a closed launch
14+
sh("env BRANCH_NAME='#{branch}' ./allurectl upload #{allure_args} #{allure_results_path} || true")
1415
UI.success("Check out test results in Allure TestOps: #{allure_endpoint}/launch/#{options[:launch_id]} 🎉")
1516
end
1617

1718
desc 'Create launch on Allure TestOps'
18-
lane :allure_launch do
19+
lane :allure_launch do |options|
1920
next unless check_required?(:e2e)
2021

2122
tags = []
2223
github_run = github_run_details
2324
launch_name =
24-
if ENV['GITHUB_EVENT_NAME'] == 'pull_request'
25+
if options[:cron]
26+
'Cron checks'
27+
elsif ENV['GITHUB_EVENT_NAME'] == 'pull_request'
2528
pull_request = JSON.parse(ENV['GITHUB_EVENT'])['pull_request']
2629
tags = pull_request['labels'].map { |label| { name: label['name'] } }
2730
pull_request['title']
@@ -59,7 +62,7 @@ lane :allure_start_regression do |options|
5962
UI.user_error!('Release version has to be provided ⚠️') if options[:release_version].nil?
6063

6164
response = allure_api(path: "/testplan/?projectId=#{allure_project_id}", http_method: 'GET')
62-
testplan_id = response['content'].filter { |plan| plan['name'] == allure_regression_testplan }.first['id']
65+
testplan_id = response['content'].find { |plan| plan['name'] == allure_regression_testplan }['id']
6366

6467
allure_api(path: "/testplan/#{testplan_id}/sync", http_method: 'POST')
6568
UI.success("#{rocket}\nTestplan with id #{testplan_id} synced successfully 🎉")

0 commit comments

Comments
 (0)