-
Notifications
You must be signed in to change notification settings - Fork 17
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 sequential execution mode option #103
Conversation
I believe some users would prefer more control over the concurrency (eg. 1 to Infinity) Have a look at p-map by sindresorhus: Maybe refactor the |
Btw. sindre has moved all his packages to ESM modules, which we don't support. If you see a related error, just install an older version of p-map |
Thanks for checking and answering.
I'd prefer to have user control, as you say. Let me ask you a few questions
Am I correct in understanding that the file specified in the include syntax is the target? For example, for the following workflow files, allow the user to choose which of the included files to execute sequentially or in concurrency?
sequentially_1.yml and sequentially_2.yml are executed sequentially (sequentially_2.yml is executed when sequentially_1yml is completed)
What value do you expect to input from CLI as option? |
Workflow level: version: "1.1"
name: Status Check
config:
concurrency: 3 # Run 3 tests concurrently
include:
- 1.yml
- 2.yml
- 3.yml CLI option:
Hope this helps. Let me know if you need more |
When |
There's also this library, which is similar to p-map: |
Thanks for replay. You mean to allow parallel execution of included files with specified number of parallel. Please give me a few days to fix the current implementation and update the pull request. |
45f0ab6
to
a354502
Compare
Of course! Glad to help further. Yes, if you set concurrency setting is set to 0, the tests should run sequentially, just as you wanted Don't feel pressured though. In open-source you can contribute at your own pace 😎 |
Hi, @yu-fuku |
a354502
to
e807312
Compare
e807312
to
d188d52
Compare
Sorry it took so long to respond. The number of parallel executions can now be controlled using p-limt. |
No worries! Glad you took your time to update the pull request. Have you verified it works? |
Yes. I have confirmed the following operation. 1, No config.concurrency or cli arguments set → confirm that everything runs in parallel |
If you set it to 0 does it run in a sequence? |
Sorry I didn't check when I put the 0 in. p-limit did not seem to accept values less than 0 So I modified runner so that it is executed sequentially when a value less than or equal to 0 is entered. I confirmed that when I incorporate this modification and enter 0, sequential execution is being performed. |
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.
Pretty much there (thanks for updating the pull request). I have very small changes to suggest 😄
src/index.ts
Outdated
const testResults = await Promise.all(Object.entries(tests).map(([id, test]) => runTest(id, test, schemaValidator, options, workflow.config, env, credentials))) | ||
let concurrency_num = Object.keys(tests).length | ||
|
||
if(workflow.config?.concurrency || workflow.config?.concurrency == 0) { |
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.
remove the workflow.config?.concurrency == 0
condition
src/index.ts
Outdated
if(workflow.config?.concurrency || workflow.config?.concurrency == 0) { | ||
concurrency_num = workflow.config?.concurrency | ||
} | ||
if(options?.concurrency || options?.concurrency == 0){ |
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.
remove the options?.concurrency == 0
condition
src/index.ts
Outdated
concurrency_num = 1 | ||
} | ||
|
||
let limit = pLimit(concurrency_num) |
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.
let
should be const
Hello, let me know if you have any updates? |
sorry I wasn't able to respond to your comment |
No worries, merging it! |
discussion stepci/stepci#122
stepci stepci/stepci#123