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

Closed
lunulu opened this issue Apr 11, 2024 · 16 comments · May be fixed by #955
Closed

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

lunulu opened this issue Apr 11, 2024 · 16 comments · May be fixed by #955

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 👍

@grosser
Copy link
Owner

grosser commented May 18, 2024

@lunulu does #955 work / look right ?

@lunulu
Copy link
Author

lunulu commented Nov 14, 2024

I'm sorry, I completely forgot about this issue.

It works! Thank you very much

bundle exec rake parallel:rake["db:create db:schema:load db:migrate db:test:prepare pg_log:create pg_log:schema:load"] RAILS_ENV=test 
Database 'db_test' already exists
...

And this one too

bundle exec rake parallel:rake["time:zones[US] stats",1]

* UTC -10:00 *
America/Adak
...

Also noticed, that ,1 is space sensitive:

bundle exec rake parallel:rake["time:zones[US] stats", 2]
rake aborted!
Don't know how to build task 'parallel:rake[time:zones[US] stats,' (See the list of available tasks with `rake --tasks`)

But I don't think it's a problem

@grosser
Copy link
Owner

grosser commented Nov 14, 2024

thx for the update!

@grosser grosser closed this as completed Nov 14, 2024
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

Successfully merging a pull request may close this issue.

3 participants