-
Notifications
You must be signed in to change notification settings - Fork 23
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
Controller/tests #170
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
test/controller_SUITE.erl
Outdated
do_start_scenario(testing_scenario, regular_vars()), | ||
amoc_controller:add_users(1, 10), | ||
Status = amoc_controller:get_status(), | ||
?assertMatch({running, testing_scenario, _, 10}, Status). |
There was a problem hiding this comment.
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).
test/controller_SUITE.erl
Outdated
|
||
wait_until_scenario_has_users(Scenario, Current, Total) -> | ||
WaitUntilFun = fun amoc_controller:get_status/0, | ||
WaitUntilValue = {running, Scenario, Current, Total}, |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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.
No description provided.