FOGL-8175: Updated the system test that requires stats collection “per asset & service”#1193
FOGL-8175: Updated the system test that requires stats collection “per asset & service”#1193Mohit04tomar wants to merge 14 commits intodevelopfrom
Conversation
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
|
|
||
|
|
||
| def test_smoke(start_south_coap, fledge_url, wait_time, asset_name="smoke"): | ||
| def test_smoke(start_south_coap, update_stat_collection, fledge_url, wait_time, asset_name="smoke"): |
There was a problem hiding this comment.
For smoke tests - I suggest we should verify with default configuration setup.
tests/system/python/conftest.py
Outdated
|
|
||
| @pytest.fixture | ||
| def update_stat_collection(fledge_url, wait_time): | ||
| """Update the Stat colectioin of all south service to per asset & service""" |
There was a problem hiding this comment.
Statistics Collection
Also this fixture should provide facility for a single south service as well.
| """Update the Stat colectioin of all south service to per asset & service""" | ||
|
|
||
| # Wait for the south service to be created | ||
| time.sleep(wait_time) |
There was a problem hiding this comment.
Remove extra delay from here. This fixture should call when service is up
There was a problem hiding this comment.
We can call once added in disable mode as well; and advance category is available? So not necessarily when up.
There was a problem hiding this comment.
This sleep is used to wait for the creation of the advanced category. Since this fixture is called immediately after the South service is created, the sleep is added here to prevent failures caused by delays in the creation of the advanced category, even in disabled mode.
| "schedule_day": 0, | ||
| "schedule_time": 0, | ||
| "schedule_repeat": 0, | ||
| "schedule_repeat": 5, |
There was a problem hiding this comment.
This means that task never runs/execute before as its type is INTERVAL?
For nightly system tests, Are we running with skip_verify_north_interface?
| import time | ||
| import urllib.parse | ||
| from pathlib import Path | ||
| from urllib.parse import quote |
There was a problem hiding this comment.
We already have import in L#16
| for service in response["services"]: | ||
| put_url = "/fledge/category/{}Advanced".format(service["name"]) | ||
| payload = {"statistics": "per asset & service"} | ||
| res = utils.put_request(fledge_url, quote(put_url), payload) |
There was a problem hiding this comment.
Use with - urllib.parse.quote(put_url)
|
|
||
|
|
||
| def update_stat_collection_remote(fledge_url, wait_time): | ||
| """Update the Stat colectioin of all south service to per asset & service""" |
| """Update the Stat colectioin of all south service to per asset & service""" | ||
|
|
||
| # Wait for the south service to be created | ||
| time.sleep(wait_time) |
| class TestE2eFogPairPi: | ||
|
|
||
| def update_stat_collection_remote(fledge_url, wait_time): | ||
| """Update the Stat colectioin of all south service to per asset & service""" |
| import time | ||
| import urllib.parse | ||
| from pathlib import Path | ||
| from urllib.parse import quote |
| for service in response["services"]: | ||
| put_url = "/fledge/category/{}Advanced".format(service["name"]) | ||
| payload = {"statistics": "per asset & service"} | ||
| res = utils.put_request(fledge_url, quote(put_url), payload) |
There was a problem hiding this comment.
Use urllib.parse.quote(put_url)
|
|
||
|
|
||
| def update_stat_collection_remote(fledge_url, wait_time): | ||
| """Update the Stat colectioin of all south service to per asset & service""" |
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
|
fyi, FOGL-8190 Temporarily change the default statistics collection back to per asset |
|
@Mohit04tomar Is there anything remaining for this PR, or is it outdated and can be closed? Since we've now reverted the stats collection option, it may no longer be relevant. |
Below are the jobs that I run with the changes: