Skip to content
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

[New Feature] List runtime variables / delete all runtime variables #3229

Open
1 task done
tho-gru-38 opened this issue Sep 30, 2024 · 1 comment
Open
1 task done
Labels
enhancement New feature or request

Comments

@tho-gru-38
Copy link

tho-gru-38 commented Sep 30, 2024

I have checked the following:

  • I've searched existing issues and found nothing related to my issue.

Describe the feature you want to add

I have a quite large collection which use the runtime variables a lot.

For the sake of run reproducible result I want to delete all runtime variables (set by bru.setVar function). I know that there is a bru.deletVar function which need the name of the variable to delete as parameter. I did not find a way to list all names of current runtime variables.

The ability of deleting all runtime variables will help in two situations:

  1. When running folder or collection multiple time, the variables can be delete by a script.
  2. If a collection consists of multiply folder, each top level folder can wipe all runtime variables. In this case the developer can be sure, that the result of a top level folder is not influenced by any preceding top level folder.

I also found the a function bru.hasVar() already exists. Unfortunately no documentation is available.

Mockups or Images of the feature

I want to have one of the following:

  1. bru.deleteAllVars() - simply delete all runtime variables
  2. bru.listVars() - return an array containing all names of runtime variables

The second solution enable the developer to achieve the first by building a loop over all variable names returned by bru.listVars() and delete each individually.

@tho-gru-38 tho-gru-38 added the enhancement New feature or request label Sep 30, 2024
@helloanoop
Copy link
Contributor

Hey @tho-gru-38 !

Thanks for describing your requirement in detail.
Yes, I think the bru.deleteAllVars() function makes sense.

@lohxt1 Can you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants