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

Having the option to run scenarios in sequential order rather than parallel #494

Open
Knanoco opened this issue Oct 21, 2022 · 9 comments
Open

Comments

@Knanoco
Copy link

Knanoco commented Oct 21, 2022

Currently, NBomber only allows for scenarios to be run in parallel order.

However there are some case scenarios where it'd be preferable to run sequentially such as in instances where we have scenarios with mostly the same code sans some database changes.

E.g.
Both scenarios are testing the same concept, except require different database sets.
Scenario A: Seed 1,000 rows in the DB
Scenario B: Seed 5,000 rows in the DB
Each scenario must exist in a clean database with no pre-existing data.

@AntyaDev
Copy link
Contributor

Hi @Knanoco

Are you going to run them on CI/CD pipeline?

@Knanoco
Copy link
Author

Knanoco commented Nov 1, 2022

Hi @AntyaDev,

Yes we're planning to run them in the pipeline. For our case specifically, we want to run multiple scenarios in sequence and then have the results output into the same report.

Currently we have multiple tests for each scenario but that produces a lot of reports each time the pipeline is run due to the amount of tests.

@jarlef
Copy link

jarlef commented Sep 6, 2023

This would be a nice feature to have. If you want to load test different endpoints to see the max throughput without being affected by the amount of parallell scenarios running (stress testing)
https://www.geeksforgeeks.org/difference-between-load-testing-and-stress-testing/

The only way around this is to run the scenarios in different sessions, but this will result in multiple reports

@AntyaDev
Copy link
Contributor

AntyaDev commented Sep 6, 2023

Hi @jarlef ,

It looks to me that the main difference here is that you can't get an HTML report that contains all scenarios in one report with the ability to compare them in one place. Is'n it?

@AntyaDev AntyaDev added the vNext label Sep 6, 2023
@jarlef
Copy link

jarlef commented Sep 6, 2023

@AntyaDev This could also solve the issue. The main thought is to run load test in the CI each weekend to verify the throughput on each endpoint in the api and compare them over time. When scenarios are run in parallell it will affect the overall load (stress testing).

Having a tool / api to combine the run sessions into one report would be useful. Then we can e.g run the tests using xunit with [assembly: CollectionBehavior(DisableTestParallelization = true)]. And afterward publish the report as a single artifact on the build

@AntyaDev
Copy link
Contributor

AntyaDev commented Sep 6, 2023

Regarding your request, why not just use JSON Configuration or simply pass TargetScenarios? With this option, you can specify what scenarios with what settings should be executed.

I mean this API: NBomberRunner.WithTargetScenarios("scenario1")

or just use JSON Config: https://nbomber.com/docs/nbomber/json-config#json-config

@jarlef
Copy link

jarlef commented Sep 6, 2023

Wont this generate multiple reports?

NBomberRunner.RegisterScenarios(scenarios).WithTargetScenarios("scenario1").Run()
NBomberRunner.RegisterScenarios(scenarios).WithTargetScenarios("scenario2").Run()

@AntyaDev
Copy link
Contributor

AntyaDev commented Sep 6, 2023

Yes, it will generate a report per each run.
But it's a different problem. Because to make running your scenarios sequentially will not solve the UX problems of HTML reports. Some code should be written to display it correctly, for example, comparing several scenarios.

@AntyaDev
Copy link
Contributor

AntyaDev commented Sep 6, 2023

If you use NBomber in the organization I think this task can be prioritized.

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

No branches or pull requests

3 participants