-
Notifications
You must be signed in to change notification settings - Fork 495
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
Is there a way to use the group number? #840
Comments
having an option for that sounds nice
the current behavior makes sense too (users only needed 2 dbs and can run different groups) so a simpler workaround might be to have a "test_env_offset" env var and then do TEST_ENV_NUMBER + offset to pick your db |
Looking at this a bit deeper, it looks like the parallel_tests/lib/parallel_tests/cli.rb Lines 349 to 363 in 01218db
where the group number is used as the process number. If the above works, might it make sense to update: parallel_tests/lib/parallel_tests/cli.rb Lines 67 to 69 in 01218db
to possibly look like: execute_in_parallel(groups_to_run, groups_to_run.size, options) do |group|
process_number = options[:group_as_test_env_number] ? group : groups_to_run.index(group)
run_tests(group, groups_to_run.index(group), 1, options)
end The thing that makes me wonder if it would be as straightforward as that would be the Also, it doesn't seem to have impact directly in parallel_tests/lib/parallel_tests.rb Lines 66 to 76 in e1bc5c5
The last part may be a moot point, as with the Just checking to make sure I am reading the code correctly and built up context on how this is working. |
idk why it's set to 1, might have to git-blame a bit to see when it was added |
Hey, @stevenproctor, did you get this working, eventually? I'm facing the same issue and was wondering where your investigations led you, as I couldn't find any related PR. |
We are getting errors in our CI builds when we matrix our test runs, with the only-group options enabled.
We set
PARALLEL_TEST_PROCESSORS
to 6, and do a matrix build where each of the matrix builds specifies an--only-groups
option of either1,2
,3,4
, or5,6
.This allows us to use 3 cheaper servers with 2 processors instead of a bigger server with 6 processors.
Through debugging, I saw that each matrix output is running the different groups, but the
TEST_ENV_NUMBER
always gets set to''
or'2'
that is coming from the number of processes being run, instead of using the test group number for that run, causing the different runs across machines to only use 2 of the 6 database prepared.Is it a possibility to get the
TEST_ENV_NUMBER
to refer to the GroupNumber instead of the process number in the group?Happy to take a shot at this, and make an option
--use-group-number
that would set the process number to the group number instead of the index of the group number in theonly_group
array, but not sure if there is a better, preferred, or already exiting, solution to this issue.The text was updated successfully, but these errors were encountered: