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

Controller/tests #170

Merged
merged 3 commits into from
Dec 17, 2023
Merged

Controller/tests #170

merged 3 commits into from
Dec 17, 2023

Conversation

NelsonVides
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3a2ab1c) 33.23% compared to head (07a87f0) 47.60%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #170       +/-   ##
===========================================
+ Coverage   33.23%   47.60%   +14.37%     
===========================================
  Files          23       23               
  Lines         981      981               
===========================================
+ Hits          326      467      +141     
+ Misses        655      514      -141     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NelsonVides NelsonVides marked this pull request as ready for review December 16, 2023 11:30
do_start_scenario(testing_scenario, regular_vars()),
amoc_controller:add_users(1, 10),
Status = amoc_controller:get_status(),
?assertMatch({running, testing_scenario, _, 10}, Status).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should check the number of users as well:

?assertEqual({running, testing_scenario, 10, 10}, Status)

and it's better to use range starting from some other value than 1:

   amoc_controller:add_users(6, 10),
   Status = amoc_controller:get_status(),
   timer:sleep(50*6), % enough time to start 6 users with 50ms interarrival
   ?assertEqual({running, testing_scenario, 5, 10}, Status).


wait_until_scenario_has_users(Scenario, Current, Total) ->
WaitUntilFun = fun amoc_controller:get_status/0,
WaitUntilValue = {running, Scenario, Current, Total},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not total, but the highest user ID used by the controller

?assertMatch({running, testing_scenario, _, 10}, Status).
StartId = 6,
EndId = 10,
amoc_controller:add_users(6, 10),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not amoc_controller:add_users(StartId, EndId),
anyway, that's not blocking.

@DenysGonchar DenysGonchar merged commit 8a80e95 into master Dec 17, 2023
6 checks passed
@DenysGonchar DenysGonchar deleted the controller/tests branch December 17, 2023 14:59
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

Successfully merging this pull request may close these issues.

None yet

3 participants