Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lunulu opened this issue Apr 11, 2024 · 13 comments
Open

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

lunulu opened this issue Apr 11, 2024 · 13 comments

Comments

@lunulu
Copy link

lunulu commented Apr 11, 2024

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
Copy link
Owner

grosser commented Apr 11, 2024

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
Copy link

reist commented Apr 11, 2024

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
Copy link
Author

lunulu commented Apr 11, 2024

Yes, I've checked. It's 3.9.0

@lunulu
Copy link
Author

lunulu commented Apr 11, 2024

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

@grosser
Copy link
Owner

grosser commented Apr 11, 2024

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

@grosser
Copy link
Owner

grosser commented Apr 11, 2024

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
Copy link
Owner

grosser commented Apr 11, 2024

can you try that locally ?

@lunulu
Copy link
Author

lunulu commented Apr 11, 2024

Using 4.6.1
image

@grosser
Copy link
Owner

grosser commented Apr 11, 2024

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
Copy link
Author

lunulu commented Apr 11, 2024

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

@grosser
Copy link
Owner

grosser commented Apr 11, 2024

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
Copy link
Author

lunulu commented Apr 11, 2024

  1. Initial fix
    image

  2. Changed rake_bin to rails_env
    image

  3. Changed task_name to args.command
    image

@grosser
Copy link
Owner

grosser commented Apr 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants