Skip to content

Commit 52cd61f

Browse files
committed
Test
1 parent 2e9edf2 commit 52cd61f

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

.github/workflows/cron-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
with:
5757
version: ${{ matrix.ios }}
5858
device: ${{ matrix.device }}
59+
- name: Build
60+
run: bundle exec fastlane build_test_app_and_frameworks
61+
timeout-minutes: 60
5962
- name: Launch Allure TestOps
6063
run: bundle exec fastlane allure_launch cron:true
6164
- name: Run UI Tests (Debug)

fastlane/Fastfile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -320,29 +320,23 @@ lane :test_e2e_mock do |options|
320320
number_of_retries: 3
321321
}
322322

323-
if is_localhost
324-
scan(scan_options)
325-
else
326-
parallelize_tests_on_ci(scan: scan_options, batch: options[:batch], cron: options[:cron])
323+
unless is_localhost || options[:cron]
324+
products_dir = File.expand_path("../#{derived_data_path}/Build/Products")
325+
xctestrun = Dir.glob(File.expand_path("#{products_dir}/*.xctestrun")).first
326+
tests = retrieve_xctest_names(xctestrun: xctestrun).values.flatten
327+
slice_size = (tests.size / ENV['MATRIX_SIZE'].to_f).ceil
328+
only_testing = []
329+
tests.each_slice(slice_size) { |test| only_testing << test }
330+
only_testing_batch = only_testing[options[:batch].to_i]
331+
scan_options[:only_testing] = only_testing_batch
327332
end
328-
end
329-
330-
private_lane :parallelize_tests_on_ci do |options|
331-
products_dir = File.expand_path("../#{derived_data_path}/Build/Products")
332-
xctestrun = Dir.glob(File.expand_path("#{products_dir}/*.xctestrun")).first
333-
tests = retrieve_xctest_names(xctestrun: xctestrun).values.flatten
334-
slice_size = options[:cron] ? tests.size : (tests.size / ENV['MATRIX_SIZE'].to_f).ceil
335-
only_testing = []
336-
tests.each_slice(slice_size) { |test| only_testing << test }
337-
only_testing_batch = only_testing[options[:batch].to_i]
338333

339334
begin
340-
UI.success("Tests in total: #{only_testing.flatten.size}. Running #{only_testing_batch.size} of them ⌛️")
341-
scan(options[:scan].merge(only_testing: only_testing_batch))
335+
scan(scan_options)
342336
rescue StandardError
343337
failed_tests = retreive_failed_tests
344338
UI.important("Re-running #{failed_tests.size} failed tests ⌛️")
345-
scan(options[:scan].merge(only_testing: failed_tests))
339+
scan(scan_options.merge(only_testing: failed_tests))
346340
end
347341
end
348342

0 commit comments

Comments
 (0)