Code Monkey home page Code Monkey logo

Comments (8)

AntyaDev avatar AntyaDev commented on June 2, 2024

Hi @OlehBabkov ,
Do you have any example of how you would pass such settings via Console arguments?

from nbomber.

OlehBabkov avatar OlehBabkov commented on June 2, 2024

Hi @AntyaDev!
yes, for example with a help of docker run

dotnet mytests --scenarioName ScenarioName --loadSimulationSettings keepConstant --copies 4 --during 00:00:07 --endpointUri http://someendpoint.com/

just an example, where I can take these args from a console and replace the default values in a config.json file.

While I was investigating this approach I found out that with a help of IOptions pattern I can easily handle GlobalCustomSettings and replace values there, but with a structure of LoadSimulationsSettings it is not working (maybe because of a structure of { "KeepConstant": [ 4, "00:00:07" ] } (for example)

or maybe I'm doing something wrong and there can be a solution how to change exactly LoadSimulationsSettings out of the box, but I didn't found it in a documentation for NBomber.

Ask for your help

from nbomber.

AntyaDev avatar AntyaDev commented on June 2, 2024

@OlehBabkov
The thing is that LoadSimulation is an array, and it can contain several LoadSimulations:
[ "KeepConstant": 4, "00:00:07",
"KeepConstant": 10, "00:00:10" ]

I don't know how we can set it via Console arguments (CLI args).

maybe
--loadSimulationSettings ["KeepConstant": 4, "00:00:07"; "KeepConstant": 10, "00:00:10"]

Also, what if the user wants to run several scenarios? The thing is that NBomber supports many configurations, and we should think how to expose it via CLI args :)

from nbomber.

AntyaDev avatar AntyaDev commented on June 2, 2024

Hi @OlehBabkov can you tell please what are the limitations for you to pass different json files?

dotnet MyLoadTests.dll --config=config-1.json
dotnet MyLoadTests.dll --config=config-2.json

from nbomber.

OlehBabkov avatar OlehBabkov commented on June 2, 2024

Hi @AntyaDev ! Actually, no limitations. I just thought that it would be nice to run each docker container with it's own configurations from cli based on each test (we have different test scenarios) and what we need to change (except of GlobalCustomSettings part) is only duration of a test and LoadSimulationSettings

from nbomber.

AntyaDev avatar AntyaDev commented on June 2, 2024

@OlehBabkov If you have a few predefined variations for LoadSimulations, you could use a different JSON config per variation.
But if your test run very different between each run (I mean dynamic variations) then probably we should think of something different.

I got your point, and I like the proposed options via CLI args. The only thing that is not clear for now is how to expose this functionality via CLI to cover NBomber functionality: multiple scenarios, LoadSimulations array, etc.

from nbomber.

botondberes avatar botondberes commented on June 2, 2024

We actually have something similar. Instead of passing everything using the command line, we define multiple JSON config files and then use the command line argument to specify which JSON to use.

from nbomber.

AntyaDev avatar AntyaDev commented on June 2, 2024

Hi @OlehBabkov ,
It seems we are a bit stuck on this proposition. I like the idea, but I don't know how to express it using CLI arguments.
We need to think maybe we can accept just JSON strings as arguments.

from nbomber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.