grosser / parallel_tests

Ruby: 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber
3.38k stars 494 forks source link

parallel:rake, "Don't know how to build task..." #945

Open lunulu opened 5 months ago

lunulu commented 5 months ago

We decided to update parallel_tests from version 2.29.2 to the latest. But we encountered the following error. Do newer versions use different syntax?

$ time bundle exec rake parallel:rake["db:create db:schema:load db:migrate db:test:prepare schedule:create schedule:schema:load pg_log:drop pg_log:create pg_log:schema:load",8]
rake aborted!
Don't know how to build task 'db:create db:schema:load db:migrate db:test:prepare schedule:create schedule:schema:load pg_log:drop pg_log:create pg_log:schema:load' (See the list of available tasks with `rake --tasks`)
/usr/local/bundle/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
grosser commented 5 months ago

that's a lot of versions :D idk when this would have changed, good chance it's some random refactor that expected there to only be a single task name ... can you try a few inbetween versions to narrow it down to 1 specific version ? ... or check the code for a place where we should add a task.split(" ").each { |task|

reist commented 5 months ago

Wasn't this on purpose? I remember stalling for a while on upgrading the gem because of pull #857 in the 3.9 release

lunulu commented 5 months ago

Yes, I've checked. It's 3.9.0

lunulu commented 5 months ago

Soo, how to execute this command now? Write a cycle in sh?

grosser commented 5 months ago

the api you are using seems valid, so we should change the code to support it

grosser commented 5 months ago

this could do it:

      ParallelTests::Tasks.run_in_parallel([ParallelTests::Tasks.rake_bin, task_name], args)
->
      ParallelTests::Tasks.run_in_parallel([ParallelTests::Tasks.rake_bin, *task_name.split(" ")], args)
grosser commented 5 months ago

can you try that locally ?

lunulu commented 5 months ago

Using 4.6.1 image

grosser commented 5 months ago

I'm more thinking bundle open parallel_tests and then change the source and retry if it's tricky/not-working I can take a look soon ™️

lunulu commented 5 months ago

Sorry, I don't understand what needs to be done. So help with this please

grosser commented 5 months ago

run bundle open parallel_tests and change that line in lib/parallel_tests/tasks.rb then try again if this you get stuck I'll try to reproduce/fix later, just stay on old version a bit longer ...

lunulu commented 5 months ago
  1. Initial fix image

  2. Changed rake_bin to rails_env image

  3. Changed task_name to args.command image

grosser commented 5 months ago

kk, I'll take a look when I can find some time 👍

grosser commented 4 months ago

@lunulu does https://github.com/grosser/parallel_tests/pull/955 work / look right ?