Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-parallel_tests for openSUSE:Factory checked in at 2024-06-24 20:51:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-parallel_tests (Old) and /work/SRC/openSUSE:Factory/.rubygem-parallel_tests.new.18349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-parallel_tests" Mon Jun 24 20:51:20 2024 rev:19 rq:1182818 version:4.7.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-parallel_tests/rubygem-parallel_tests.changes 2024-02-27 22:45:23.180093858 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-parallel_tests.new.18349/rubygem-parallel_tests.changes 2024-06-24 20:52:19.090170306 +0200 @@ -1,0 +2,5 @@ +Fri Jun 21 10:22:16 UTC 2024 - Dan Čermák <dan.cermak@posteo.net> + +- New upstream release 4.7.1, no changelog found + +------------------------------------------------------------------- Old: ---- parallel_tests-4.4.0.gem New: ---- parallel_tests-4.7.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-parallel_tests.spec ++++++ --- /var/tmp/diff_new_pack.hLQAOE/_old 2024-06-24 20:52:20.326215488 +0200 +++ /var/tmp/diff_new_pack.hLQAOE/_new 2024-06-24 20:52:20.326215488 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-parallel_tests -Version: 4.4.0 +Version: 4.7.1 Release: 0 %define mod_name parallel_tests %define mod_full_name %{mod_name}-%{version} ++++++ parallel_tests-4.4.0.gem -> parallel_tests-4.7.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Readme.md new/Readme.md --- old/Readme.md 2023-12-25 05:12:45.000000000 +0100 +++ new/Readme.md 2024-04-25 21:57:55.000000000 +0200 @@ -33,35 +33,45 @@ ### Create additional database(s) rake parallel:create +### (Multi-DB) Create individual database + rake parallel:create:<database> + rake parallel:create:secondary + ### Copy development schema (repeat after migrations) rake parallel:prepare ### Run migrations in additional database(s) (repeat after migrations) rake parallel:migrate +### (Multi-DB) Run migrations in individual database + rake parallel:migrate:<database> + ### Setup environment from scratch (create db and loads schema, useful for CI) rake parallel:setup ### Drop all test databases rake parallel:drop +### (Multi-DB) Drop individual test database + rake parallel:drop:<database> + ### Run! rake parallel:test # Minitest rake parallel:spec # RSpec rake parallel:features # Cucumber rake parallel:features-spinach # Spinach - rake parallel:test[1] --> force 1 CPU --> 86 seconds + rake "parallel:test[1]" --> force 1 CPU --> 86 seconds rake parallel:test --> got 2 CPUs? --> 47 seconds rake parallel:test --> got 4 CPUs? --> 26 seconds ... Test by pattern with Regex (e.g. use one integration server per subfolder / see if you broke any 'user'-related tests) - rake parallel:test[^test/unit] # every test file in test/unit folder - rake parallel:test[user] # run users_controller + user_helper + user tests - rake parallel:test['user|product'] # run user and product related tests - rake parallel:spec['spec\/(?!features)'] # run RSpec tests except the tests in spec/features + rake "parallel:test[^test/unit]" # every test file in test/unit folder + rake "parallel:test[user]" # run users_controller + user_helper + user tests + rake "parallel:test['user|product']" # run user and product related tests + rake "parallel:spec['spec\/(?!features)']" # run RSpec tests except the tests in spec/features ### Example output @@ -77,9 +87,9 @@ ```Bash RAILS_ENV=test parallel_test -e "rake my:custom:task" # or -rake parallel:rake[my:custom:task] +rake "parallel:rake[my:custom:task]" # limited parallelism -rake parallel:rake[my:custom:task,2] +rake "parallel:rake[my:custom:task,2]" ``` @@ -240,8 +250,9 @@ -m, --multiply-processes [FLOAT] use given number as a multiplier of processes to run -s, --single [PATTERN] Run all matching files in the same process -i, --isolate Do not run any other tests in the group used by --single(-s) - --isolate-n [PROCESSES] Use 'isolate' singles with number of processes, default: 1. + --isolate-n [PROCESSES] Use 'isolate' singles with number of processes, default: 1 --highest-exit-status Exit with the highest exit status provided by test run(s) + --failure-exit-code [INT] Specify the exit code to use when tests fail --specify-groups [SPECS] Use 'specify-groups' if you want to specify multiple specs running in multiple processes in a specific formation. Commas indicate specs in the same process, pipes indicate specs in a new process. Cannot use with --single, --isolate, or @@ -250,9 +261,8 @@ Process 1 will contain 1_spec.rb and 2_spec.rb Process 2 will contain 3_spec.rb Process 3 will contain all other specs - --only-group INT[,INT] Only run the given group numbers. Note that this will force the 'filesize' - grouping strategy (even when the runtime log is present) unless you explicitly - set it otherwise via the '-group-by' flag. + --only-group INT[,INT] Only run the given group numbers. + Changes `--group-by` default to 'filesize'. -e, --exec [COMMAND] execute this code parallel and with ENV['TEST_ENV_NUMBER'] -o, --test-options '[OPTIONS]' execute test commands with those options -t, --type [TYPE] test(default) / rspec / cucumber / spinach @@ -269,11 +279,14 @@ --nice execute test commands with low priority. --runtime-log [PATH] Location of previously recorded test runtimes --allowed-missing [INT] Allowed percentage of missing runtimes (default = 50) + --allow-duplicates When detecting files to run, allow duplicates --unknown-runtime [FLOAT] Use given number as unknown runtime (otherwise use average time) --first-is-1 Use "1" as TEST_ENV_NUMBER to not reuse the default test environment --fail-fast Stop all groups when one group fails (best used with --test-options '--fail-fast' if supported --verbose Print debug output - --verbose-command Displays the command that will be executed by each process and when there are failures displays the command executed by each process that failed + --verbose-command Combines options --verbose-process-command and --verbose-rerun-command + --verbose-process-command Print the command that will be executed by each process before it begins + --verbose-rerun-command After a process fails, print the command executed by that process --quiet Print only tests output -v, --version Show Version -h, --help Show this. @@ -427,6 +440,9 @@ - [Jon Dufresne](https://github.com/jdufresne) - [Eric Kessler](https://github.com/enkessler) - [Adis Osmonov](https://github.com/adis-io) + - [Josh Westbrook](https://github.com/joshwestbrook) + - [Jay Dorsey](https://github.com/jaydorsey) + - [hatsu](https://github.com/hatsu38) [Michael Grosser](http://grosser.it)<br/> michael@grosser.it<br/> Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/parallel_tests/cli.rb new/lib/parallel_tests/cli.rb --- old/lib/parallel_tests/cli.rb 2023-12-25 05:12:45.000000000 +0100 +++ new/lib/parallel_tests/cli.rb 2024-04-25 21:57:55.000000000 +0200 @@ -57,8 +57,8 @@ Tempfile.open 'parallel_tests-lock' do |lock| ParallelTests.with_pid_file do simulate_output_for_ci options[:serialize_stdout] do - Parallel.map(items, in_threads: num_processes) do |item| - result = yield(item) + Parallel.map_with_index(items, in_threads: num_processes) do |item, index| + result = yield(item, index) reprint_output(result, lock.path) if options[:serialize_stdout] ParallelTests.stop_all_processes if options[:fail_fast] && result[:exit_status] != 0 result @@ -81,8 +81,8 @@ end report_number_of_tests(groups) unless options[:quiet] - test_results = execute_in_parallel(groups, groups.size, options) do |group| - run_tests(group, groups.index(group), num_processes, options) + test_results = execute_in_parallel(groups, groups.size, options) do |group, index| + run_tests(group, index, num_processes, options) end report_results(test_results, options) unless options[:quiet] end @@ -96,8 +96,9 @@ if any_test_failed?(test_results) warn final_fail_message - # return the highest exit status to allow sub-processes to send things other than 1 - exit_status = if options[:highest_exit_status] + exit_status = if options[:failure_exit_code] + options[:failure_exit_code] + elsif options[:highest_exit_status] test_results.map { |data| data.fetch(:exit_status) }.max else 1 @@ -145,7 +146,7 @@ failing_sets = test_results.reject { |r| r[:exit_status] == 0 } return if failing_sets.none? - if options[:verbose] || options[:verbose_command] + if options[:verbose] || options[:verbose_rerun_command] puts "\n\nTests have failed for a parallel_test group. Use the following command to run the group again:\n\n" failing_sets.each do |failing_set| command = failing_set[:command] @@ -223,12 +224,19 @@ opts.on( "--isolate-n [PROCESSES]", Integer, - "Use 'isolate' singles with number of processes, default: 1." + "Use 'isolate' singles with number of processes, default: 1" ) { |n| options[:isolate_count] = n } - opts.on("--highest-exit-status", "Exit with the highest exit status provided by test run(s)") do - options[:highest_exit_status] = true - end + opts.on( + "--highest-exit-status", + "Exit with the highest exit status provided by test run(s)" + ) { options[:highest_exit_status] = true } + + opts.on( + "--failure-exit-code [INT]", + Integer, + "Specify the exit code to use when tests fail" + ) { |code| options[:failure_exit_code] = code } opts.on( "--specify-groups [SPECS]", @@ -237,7 +245,7 @@ processes in a specific formation. Commas indicate specs in the same process, pipes indicate specs in a new process. Cannot use with --single, --isolate, or --isolate-n. Ex. - $ parallel_test -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb' + $ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb' Process 1 will contain 1_spec.rb and 2_spec.rb Process 2 will contain 3_spec.rb Process 3 will contain all other specs @@ -278,11 +286,14 @@ opts.on("--nice", "execute test commands with low priority.") { options[:nice] = true } opts.on("--runtime-log [PATH]", "Location of previously recorded test runtimes") { |path| options[:runtime_log] = path } opts.on("--allowed-missing [INT]", Integer, "Allowed percentage of missing runtimes (default = 50)") { |percent| options[:allowed_missing_percent] = percent } + opts.on('--allow-duplicates', 'When detecting files to run, allow duplicates') { options[:allow_duplicates] = true } opts.on("--unknown-runtime [FLOAT]", Float, "Use given number as unknown runtime (otherwise use average time)") { |time| options[:unknown_runtime] = time } opts.on("--first-is-1", "Use \"1\" as TEST_ENV_NUMBER to not reuse the default test environment") { options[:first_is_1] = true } opts.on("--fail-fast", "Stop all groups when one group fails (best used with --test-options '--fail-fast' if supported") { options[:fail_fast] = true } opts.on("--verbose", "Print debug output") { options[:verbose] = true } - opts.on("--verbose-command", "Displays the command that will be executed by each process and when there are failures displays the command executed by each process that failed") { options[:verbose_command] = true } + opts.on("--verbose-command", "Combines options --verbose-process-command and --verbose-rerun-command") { options.merge! verbose_process_command: true, verbose_rerun_command: true } + opts.on("--verbose-process-command", "Print the command that will be executed by each process before it begins") { options[:verbose_process_command] = true } + opts.on("--verbose-rerun-command", "After a process fails, print the command executed by that process") { options[:verbose_rerun_command] = true } opts.on("--quiet", "Print only tests output") { options[:quiet] = true } opts.on("-v", "--version", "Show Version") do puts ParallelTests::VERSION @@ -330,6 +341,10 @@ raise "Can't pass --specify-groups with any of these keys: --single, --isolate, or --isolate-n" end + if options[:failure_exit_code] && options[:highest_exit_status] + raise "Can't pass --failure-exit-code and --highest-exit-status" + end + options end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/parallel_tests/spinach/runner.rb new/lib/parallel_tests/spinach/runner.rb --- old/lib/parallel_tests/spinach/runner.rb 2023-12-25 05:12:45.000000000 +0100 +++ new/lib/parallel_tests/spinach/runner.rb 2024-04-25 21:57:55.000000000 +0200 @@ -15,7 +15,7 @@ def runtime_logging # Not Yet Supported - "" + [] end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/parallel_tests/tasks.rb new/lib/parallel_tests/tasks.rb --- old/lib/parallel_tests/tasks.rb 2023-12-25 05:12:45.000000000 +0100 +++ new/lib/parallel_tests/tasks.rb 2024-04-25 21:57:55.000000000 +0200 @@ -48,6 +48,9 @@ activate_pipefail = "set -o pipefail" remove_ignored_lines = %{(grep -v #{Shellwords.escape(ignore_regex)} || true)} + # remove nil values (ex: #purge_before_load returns nil) + command.compact! + if system('/bin/bash', '-c', "#{activate_pipefail} 2>/dev/null") shell_command = "#{activate_pipefail} && (#{Shellwords.shelljoin(command)}) | #{remove_ignored_lines}" ['/bin/bash', '-c', shell_command] @@ -125,6 +128,24 @@ command end + def configured_databases + return [] unless defined?(ActiveRecord) && rails_61_or_greater? + + @@configured_databases ||= ActiveRecord::Tasks::DatabaseTasks.setup_initial_database_yaml + end + + def for_each_database(&block) + # Use nil to represent all databases + block&.call(nil) + + # skip if not rails or old rails version + return if !defined?(ActiveRecord::Tasks::DatabaseTasks) || !ActiveRecord::Tasks::DatabaseTasks.respond_to?(:for_each) + + ActiveRecord::Tasks::DatabaseTasks.for_each(configured_databases) do |name| + block&.call(name) + end + end + private def rails_7_or_greater? @@ -145,25 +166,33 @@ ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args) end - desc "Create test databases via db:create --> parallel:create[num_cpus]" - task :create, :count do |_, args| - ParallelTests::Tasks.run_in_parallel( - [$0, "db:create", "RAILS_ENV=#{ParallelTests::Tasks.rails_env}"], - args - ) + ParallelTests::Tasks.for_each_database do |name| + task_name = 'create' + task_name += ":#{name}" if name + desc "Create test#{" #{name}" if name} database via db:#{task_name} --> parallel:#{task_name}[num_cpus]" + task task_name.to_sym, :count do |_, args| + ParallelTests::Tasks.run_in_parallel( + [$0, "db:#{task_name}", "RAILS_ENV=#{ParallelTests::Tasks.rails_env}"], + args + ) + end end - desc "Drop test databases via db:drop --> parallel:drop[num_cpus]" - task :drop, :count do |_, args| - ParallelTests::Tasks.run_in_parallel( - [ - $0, - "db:drop", - "RAILS_ENV=#{ParallelTests::Tasks.rails_env}", - "DISABLE_DATABASE_ENVIRONMENT_CHECK=1" - ], - args - ) + ParallelTests::Tasks.for_each_database do |name| + task_name = 'drop' + task_name += ":#{name}" if name + desc "Drop test#{" #{name}" if name} database via db:#{task_name} --> parallel:#{task_name}[num_cpus]" + task task_name.to_sym, :count do |_, args| + ParallelTests::Tasks.run_in_parallel( + [ + $0, + "db:#{task_name}", + "RAILS_ENV=#{ParallelTests::Tasks.rails_env}", + "DISABLE_DATABASE_ENVIRONMENT_CHECK=1" + ], + args + ) + end end desc "Update test databases by dumping and loading --> parallel:prepare[num_cpus]" @@ -190,12 +219,16 @@ end # when dumping/resetting takes too long - desc "Update test databases via db:migrate --> parallel:migrate[num_cpus]" - task :migrate, :count do |_, args| - ParallelTests::Tasks.run_in_parallel( - [$0, "db:migrate", "RAILS_ENV=#{ParallelTests::Tasks.rails_env}"], - args - ) + ParallelTests::Tasks.for_each_database do |name| + task_name = 'migrate' + task_name += ":#{name}" if name + desc "Update test#{" #{name}" if name} database via db:#{task_name} --> parallel:#{task_name}[num_cpus]" + task task_name.to_sym, :count do |_, args| + ParallelTests::Tasks.run_in_parallel( + [$0, "db:#{task_name}", "RAILS_ENV=#{ParallelTests::Tasks.rails_env}"], + args + ) + end end desc "Rollback test databases via db:rollback --> parallel:rollback[num_cpus]" @@ -207,16 +240,24 @@ end # just load the schema (good for integration server <-> no development db) - desc "Load dumped schema for test databases via db:schema:load --> parallel:load_schema[num_cpus]" - task :load_schema, :count do |_, args| - command = [ - $0, - ParallelTests::Tasks.purge_before_load, - "db:schema:load", - "RAILS_ENV=#{ParallelTests::Tasks.rails_env}", - "DISABLE_DATABASE_ENVIRONMENT_CHECK=1" - ] - ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args) + ParallelTests::Tasks.for_each_database do |name| + rails_task = 'db:schema:load' + rails_task += ":#{name}" if name + + task_name = 'load_schema' + task_name += ":#{name}" if name + + desc "Load dumped schema for test#{" #{name}" if name} database via #{rails_task} --> parallel:#{task_name}[num_cpus]" + task task_name.to_sym, :count do |_, args| + command = [ + $0, + ParallelTests::Tasks.purge_before_load, + rails_task, + "RAILS_ENV=#{ParallelTests::Tasks.rails_env}", + "DISABLE_DATABASE_ENVIRONMENT_CHECK=1" + ] + ParallelTests::Tasks.run_in_parallel(ParallelTests::Tasks.suppress_schema_load_output(command), args) + end end # load the structure from the structure.sql file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/parallel_tests/test/runner.rb new/lib/parallel_tests/test/runner.rb --- old/lib/parallel_tests/test/runner.rb 2023-12-25 05:12:45.000000000 +0100 +++ new/lib/parallel_tests/test/runner.rb 2024-04-25 21:57:55.000000000 +0200 @@ -238,8 +238,9 @@ suffix_pattern = options[:suffix] || test_suffix include_pattern = options[:pattern] || // exclude_pattern = options[:exclude_pattern] + allow_duplicates = options[:allow_duplicates] - (tests || []).flat_map do |file_or_folder| + files = (tests || []).flat_map do |file_or_folder| if File.directory?(file_or_folder) files = files_in_folder(file_or_folder, options) files = files.grep(suffix_pattern).grep(include_pattern) @@ -248,7 +249,9 @@ else file_or_folder end - end.uniq + end + + allow_duplicates ? files : files.uniq end def files_in_folder(folder, options = {}) @@ -290,7 +293,7 @@ end def report_process_command?(options) - options[:verbose] || options[:verbose_command] + options[:verbose] || options[:verbose_process_command] end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/parallel_tests/version.rb new/lib/parallel_tests/version.rb --- old/lib/parallel_tests/version.rb 2023-12-25 05:12:45.000000000 +0100 +++ new/lib/parallel_tests/version.rb 2024-04-25 21:57:55.000000000 +0200 @@ -1,4 +1,4 @@ # frozen_string_literal: true module ParallelTests - VERSION = '4.4.0' + VERSION = '4.7.1' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/parallel_tests.rb new/lib/parallel_tests.rb --- old/lib/parallel_tests.rb 2023-12-25 05:12:45.000000000 +0100 +++ new/lib/parallel_tests.rb 2024-04-25 21:57:55.000000000 +0200 @@ -44,6 +44,8 @@ def stop_all_processes pids.all.each { |pid| Process.kill(:INT, pid) } + rescue Errno::ESRCH + # Process already terminated, do nothing end # copied from http://github.com/carlhuda/bundler Bundler::SharedHelpers#find_gemfile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2023-12-25 05:12:45.000000000 +0100 +++ new/metadata 2024-04-25 21:57:55.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: parallel_tests version: !ruby/object:Gem::Version - version: 4.4.0 + version: 4.7.1 platform: ruby authors: - Michael Grosser autorequire: bindir: bin cert_chain: [] -date: 2023-12-25 00:00:00.000000000 Z +date: 2024-04-25 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: parallel @@ -69,8 +69,8 @@ - MIT metadata: bug_tracker_uri: https://github.com/grosser/parallel_tests/issues - documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.4.0/Readme.md - source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.4.0 + documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.7.1/Readme.md + source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.7.1 wiki_uri: https://github.com/grosser/parallel_tests/wiki post_install_message: rdoc_options: [] @@ -87,7 +87,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.3.3 +rubygems_version: 3.4.10 signing_key: specification_version: 4 summary: Run Test::Unit / RSpec / Cucumber / Spinach in parallel