Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AntyaDev committed Mar 1, 2022
1 parent 9d38eed commit 2d1c025
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/NBomber/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ open System.Runtime.CompilerServices

[<assembly: InternalsVisibleTo("NBomber.IntegrationTests")>]
[<assembly: InternalsVisibleTo("NBomber.Cluster")>]
[<assembly: InternalsVisibleTo("NBomber.Cluster.IntegrationTests")>]
do()
48 changes: 23 additions & 25 deletions src/NBomber/Domain/Scenario.fs
Original file line number Diff line number Diff line change
Expand Up @@ -203,34 +203,32 @@ let getStepOrder (scenario: Scenario) =

| None -> scenario.DefaultStepOrder

let createScenarios (scenarios: Contracts.Scenario list) = result {

let create (scn: Contracts.Scenario) = result {
let! timeline = scn.LoadSimulations |> LoadTimeLine.createWithDuration
let! scenario = Validation.validate scn
let stepOrderIndex = createStepOrderIndex scenario
let defaultStepOrder = scenario |> createDefaultStepOrder stepOrderIndex

return { ScenarioName = scenario.ScenarioName
Init = scenario.Init
Clean = scenario.Clean
Steps = scenario.Steps |> ClientFactory.updateName scenario.ScenarioName
LoadTimeLine = timeline.LoadTimeLine
WarmUpDuration = scenario.WarmUpDuration
PlanedDuration = timeline.ScenarioDuration
ExecutedDuration = None
CustomSettings = String.Empty
DefaultStepOrder = defaultStepOrder
StepOrderIndex = stepOrderIndex
CustomStepOrder = scenario.CustomStepOrder
CustomStepExecControl = scenario.CustomStepExecControl
IsEnabled = true }
}
let createScenario (scn: Contracts.Scenario) = result {
let! timeline = scn.LoadSimulations |> LoadTimeLine.createWithDuration
let! scenario = Validation.validate scn
let stepOrderIndex = createStepOrderIndex scenario
let defaultStepOrder = scenario |> createDefaultStepOrder stepOrderIndex

return { ScenarioName = scenario.ScenarioName
Init = scenario.Init
Clean = scenario.Clean
Steps = scenario.Steps |> ClientFactory.updateName scenario.ScenarioName
LoadTimeLine = timeline.LoadTimeLine
WarmUpDuration = scenario.WarmUpDuration
PlanedDuration = timeline.ScenarioDuration
ExecutedDuration = None
CustomSettings = String.Empty
DefaultStepOrder = defaultStepOrder
StepOrderIndex = stepOrderIndex
CustomStepOrder = scenario.CustomStepOrder
CustomStepExecControl = scenario.CustomStepExecControl
IsEnabled = true }
}

let createScenarios (scenarios: Contracts.Scenario list) = result {
let! vScns = scenarios |> Validation.checkDuplicateScenarioName

return! vScns
|> List.map create
|> List.map createScenario
|> Result.sequence
|> Result.mapError List.head
}
Expand Down
2 changes: 1 addition & 1 deletion src/NBomber/DomainServices/TestHost/TestHost.fs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ type internal TestHost(dep: IGlobalDependency, registeredScenarios: Scenario lis
do! startBombing(schedulers, flushStatsTimer, reportingTimer, currentOperationTimer)

if cleanUp.IsSome then
_logger.Information "NBomber is executing internal cleanup..."
_logger.Debug "NBomber is executing internal cleanup..."
do! cleanUp.Value()

do! this.StopScenarios()
Expand Down

0 comments on commit 2d1c025

Please sign in to comment.