-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement detection for runner #3105
Conversation
In fact, there are three execution modes: single, runner and also CLI, some time ago I created this PR #1875 |
This is indeed a very valid point. I am happy to modify my implementation or you are also welcome to modify yours. I don't think saving the execution mode to a normal variable is a preferred way as this might conflict with other user defined variables and also is mixing context. So I would recommend something like this:
with return single, runner or cli. What do you think @tlaloc911 @JorgeTrovisco |
This approach require to have some documentation attached (explaining what would be the expected output) Does Bruno already have global constants? Would be a great approach to have something like (bru.getExecutionMode() == ExecutionMode.Single) |
@nikischin , I agree, using variables is not a clean solution. I did that for an immediate need on that time. Your solution is better and I hope it gets merged |
I implemented the new variant with the help of your PR #1875 @tlaloc911 Could you please test it for me, especially carefully test the cli variant, as I am usually not using cli. |
sure!, thanks |
Hi @nikischin, works great in developer mode In Safe mode is throwing a error only for the runner In the single request is working fine Seems related to the error i was facing with the skipRequest, can you reproduce this behavior? |
In safe mode the code is executed in a secure sandbox, because of that we need to declare all the functions in the shims file Be sure to shutdown the current instance and run the commands
and then run again |
Ah great, thank you so much, I just found this out myself before reading your comment.
This part, I don't understand. What do I need it for? |
To rebuild all the packages. Mine didn't work until I've done that |
Hey @nikischin I feel we should not use |
Great, thanks @helloanoop @lohxt1! Closing this ticket in favor of #3200 |
sorry for the very late response, cli worked as expected, thanks!! |
Description
Implement a new function
bru.getExecutionMode()
to use inside scripting. Returns single, runner or cli.Fixes #3104
Related to #2397
Includes changed from #1875 partially
Thank you @JorgeTrovisco this is a modified implementation of your PR. Thank you also @tlaloc911 as this also includes your changes.
The real benefit of this PR will be implemented with the merging of #2397, as this functionality has been extracted from this PR in order to keep it focussed on one feature. With both this and #2397 merged, you could do something like this in order to skip requests on runner runs but still have them for single tests.
Or you could even do something like this
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.