-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84c048a
commit 60579e8
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This script is used to run tests in parallel in Github Actions. | ||
# parallel_test test -n 8 --only-group 1,2 | ||
|
||
CI_RUNNER_PROCESS_COUNT = 2 | ||
|
||
parallel_tests_is_one_indexed = 1 | ||
node_index = ENV['CI_NODE_INDEX'].to_i | ||
|
||
groups = "#{node_index * CI_RUNNER_PROCESS_COUNT + parallel_tests_is_one_indexed },#{node_index * CI_RUNNER_PROCESS_COUNT + parallel_tests_is_one_indexed + 1}" | ||
|
||
total_parallelism = CI_RUNNER_PROCESS_COUNT * ENV['CI_NODE_TOTAL'].to_i | ||
|
||
exec "bundle exec parallel_test ./spec -t rspec -n #{total_parallelism} --only-group #{groups}" |