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

Amend <loop-sentinel/> in the <instance-settling> to support variables/parameters as parameter value #556

Open
fefeslon opened this issue Nov 8, 2019 · 4 comments

Comments

@fefeslon
Copy link

fefeslon commented Nov 8, 2019

Hi All,

Is there a possibility to use the variable or parameter as a value inside the <loop-sentinel/>?

If not could it be added as a feature?

Something like this:

<loop-sentinel seed="$start$" terminal="$end$" step="$stepsize$">
<loop-sentinel seed="@start" terminal="@end" step="@stepsize">

Motivation:
In my tests I use exclusively the external settings file to define the variables and parameters so the whole test-suite uses the same global settings (and these can be changed/checked quite easily in one place).

<instance-settling> is a super feature for me, but it has to be maintained "manually" in the test template (for example if I am using it for the date ranges which I usually set in the external settings).

To maintain it manually means:

  1. Search all the templates using the <instance-settling>
  2. Amend the seed, terminal and step
  3. Generate the tests file using the Genbil.

Instead of just changing few global variables/parameters.

Cheers,

M.

@Seddryck
Copy link
Owner

Seddryck commented Nov 8, 2019

I'm a bit surprised by your feedback, IMO what you're requesting is already supported and is mostly the use-cases that we've in our head when designing the <instance-settling> feature.

Just use ...

<loop-sentinel seed="@start" terminal="@end" step="@stepsize">

Values @start, @end and @stepsize must be defined as variables at the top of the test-suite and overriden by the settings file as explained here.

My team is usually not overriding the variables in the external settings file but calculating with C-Sharp or SQL the values of @start and other variables to avoid to have to edit the settings file. An example is available at https://github.com/Seddryck/NBi/blob/develop/NBi.Testing/Acceptance/Resources/Positive/MultipleInstance.nbits (the test with uid="0004") about how to use one variable in a loop-sentinel. Check also the next test to see how you can slightly adapt the value with native transformations (and avoid to have too many variables defined at the top).

But perhaps, I've not understood your request. Could you show me an example of what is not supported?

@fefeslon
Copy link
Author

fefeslon commented Nov 11, 2019

Hi,

Thanks for the detailed explanation!

I've read the NBi/Genbil documentation once more and now I probably get it.

Let me explain it once more with some additional details.

When I have written about variables/parameters in the previous post I meant query’s parameters and query’s template-variables.

These are the only ones I use in my tests and they can be set in external settings files together with references (connection strings).

Most of the tests I need to execute are various "query to query" comparisons with both various parameters and various servers.

That means I change the settings file quite often depending on the requirements (connections, databases, query parameters/variables).

What I would like to have as a feature is to be able to:
EITHER - be able to define global variables directly in the external settings file
OR - be able to pass the values of the defined query’s parameters and query’s template-variables into the local variables (I know that I am mixing two concepts here, maybe.) like it is currently possible in the connection-string (using reference):

    <system-under-test>
      <result-set>
        <query connection-string="@test_con" timeout-milliSeconds="10000">

Having this option, I could have all the settings/variables in one place instead of managing both external settings and global variables file.

Am I missing something and is this currently possible somehow?

In case it is not possible right now, does it make any sense for you to be implemented in the future or is it just "out of the concept" of how the variables in NBi should be used/handled?

Sorry for the essay, I just wanted to explain it clearly.

Cheers.

@Seddryck
Copy link
Owner

Now, I understand your use-case. I'll try to setup something and will come back to you when the design is ready.

@fefeslon
Copy link
Author

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants