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

Automatically handle parallel execution #28

Open
andrewhampton opened this issue Aug 28, 2020 · 3 comments
Open

Automatically handle parallel execution #28

andrewhampton opened this issue Aug 28, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@andrewhampton
Copy link
Contributor

First, this gem is off to a great start! Thank you for putting your time into an open source library that helps the ruby community move forward!

I'm currently using parallel_tests for a test suite that takes a couple hours to run without parallelization. Two killer features it has are:

  • setup script: bin/rails parallel:setup
  • flag: -n [PROCESSES] How many processes to use, default: available CPUs

If you're not already familiar with these, the main idea here is parallel_tests expects you to run multiple processes on the same machine. Each process will get an env var set, TEST_ENV_NUMBER, which gives each process a distinct ID to use. This ID can be used in the Rails database.yml like database: test_<%= test_env_number %>, which allows each process to use the same DB server, but unique databases during the test run.

Are there plans to for rspecq to do something similar?

I think the main benefit of handling this in rpsecq is it solves the problem once, rather than requiring all consumers to do similar setup work. Of course, that setup work isn't necessary if your runners are distributed. But this would give parallelt_test users a convenient on ramp when switching to rspecq.

@agis
Copy link
Collaborator

agis commented Aug 31, 2020

Thanks for the kind words @andrewhampton! I'm open to incorporating a separate executable that would take care the job of spinning up multiple rspecq workers in the same host.

However, note that we don't currently use rspecq this way, instead we rely on containers each having its own set of services (MySQL, MongoDB, Elasticsearch etc.). Which means this executable naturally wouldn't be as supported as rspecq itself. On the other hand, I guess it'd be minimal so maybe it wouldn't need so much support. :)

@agis agis added the question Further information is requested label Sep 2, 2020
@agis
Copy link
Collaborator

agis commented Sep 2, 2020

Would something like that help with your use case?

@andrewhampton
Copy link
Contributor Author

andrewhampton commented Sep 2, 2020 via email

@agis agis added enhancement New feature or request and removed question Further information is requested labels Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants