-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add CircleCI Test Split Feature #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few comments for you to have a look at. Thanks Vandit!
I think it's worth discussing this design some more. The - matlab/run-tests:
select-by-filename: $(circleci tests glob 'tests/**/*.m' | circleci tests split --split-by=timings)
test-results-junit: results With With |
I agree that we need a naming pass for the new parameter. I prefer |
@@ -40,6 +40,11 @@ parameters: | |||
parameter requires a Parallel Computing Toolbox license. | |||
type: boolean | |||
default: false | |||
split-type: | |||
description: > | |||
Option to use CircleCI Test Split feature, specified as 'timings', 'filename' or 'filesize'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to use the same terminology as in CircleCI documentation. Instead of "CircleCI Test Split feature" CircleCI uses "CircleCI test splitting" in their documentation: https://circleci.com/docs/parallelism-faster-jobs/#:~:text=CircleCI%20test%20splitting
The information in this description is minimal. For example, it doesn't say anything about the parallelism
key. At a minimum, we should link to this page: https://circleci.com/docs/parallelism-faster-jobs/. Alternatively, the description can be expanded to include some important details.
Also, it might be good to clarify how one should use the new parameter alongside use-parallel
.
Hey @mcafaro, Following up on our conversation, we identified a couple of limitations with the above implementation:
|
@vanditaMW Here is the same effect achieved with a Split alphabetically: - matlab/run-tests:
select-by-name: $(circleci tests glob 'tests/**/*.m' | circleci tests split | awk -F'[/.]' '{print $(NF-1) "/*"}') Split by file size: - matlab/run-tests:
select-by-name: $(circleci tests glob 'tests/**/*.m' | circleci tests split --split-by=filesize | awk -F'[/.]' '{print $(NF-1) "/*"}') Split by timings: - matlab/run-tests:
select-by-name: $(circleci tests glob 'tests/**/*.m' | awk -F'[/.]' '{print $(NF-1)}' | circleci tests split --split-by=timings | awk '{print $0 "/*"}') This can be implemented without a new selector or JUnit modifications. No doubt the commands are complex but an example of each can be added to our CircleCI doc. The command complexity is also consistent with other languages where CircleCI provides examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanditaMW you could resolve the conversation for ease of review
Closing this PR since there is a change in the design. I have raised a new PR which has the updated design
Added the "split-type" parameter to enable the CircleCI Test Split feature within the "run-tests" command. The "split-type" parameter will accept inputs such as "filename," "filesize," and "timings" to perform the CircleCI Test Split functionality. Unit tests were added, and the interactive workflow was reviewed to ensure proper integration.
For more details, refer to the Confluence page below:
https://mathworks.atlassian.net/wiki/spaces/CI/pages/57271792/D+Support+Test+Splitting+in+CircleCI