-
Notifications
You must be signed in to change notification settings - Fork 50
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
FOGL-8175: Updated the system test that requires stats collection “per asset & service” #1193
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
@@ -72,7 +72,7 @@ def start_south_coap(reset_and_start_fledge, add_south, remove_data_file, remove | |||
remove_directories("/tmp/fledge-south-{}".format(south_plugin)) | |||
|
|||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra delay from here. This fixture should call when service is up
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -83,7 +83,7 @@ def _configure_and_start_north_kafka(self, north_branch, fledge_url, host, port, | |||
"schedule_type": 3, | |||
"schedule_day": 0, | |||
"schedule_time": 0, | |||
"schedule_repeat": 0, | |||
"schedule_repeat": 5, |
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.
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?
@@ -15,6 +15,7 @@ | |||
import time | |||
import urllib.parse | |||
from pathlib import Path | |||
from urllib.parse import quote |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use with - urllib.parse.quote(put_url)
@@ -44,6 +45,22 @@ | |||
AF_HIERARCHY_LEVEL = "Cservicepair/Cservicepairlvl1/Cservicepairlvl2" | |||
|
|||
|
|||
def update_stat_collection_remote(fledge_url, wait_time): | |||
"""Update the Stat colectioin of all south service to per asset & service""" |
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.
Statistics Collection
"""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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@@ -36,6 +36,22 @@ | |||
|
|||
class TestE2eFogPairPi: | |||
|
|||
def update_stat_collection_remote(fledge_url, wait_time): | |||
"""Update the Stat colectioin of all south service to per asset & service""" |
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.
Statistics Collection
@@ -15,6 +15,7 @@ | |||
import time | |||
import urllib.parse | |||
from pathlib import Path | |||
from urllib.parse import quote |
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.
Remove it
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use urllib.parse.quote(put_url)
@@ -44,6 +45,22 @@ | |||
AF_HIERARCHY_LEVEL = "pythonnorthservicepair/pythonnorthservicepairlvl2/pythonnorthservicepairlvl3" | |||
|
|||
|
|||
def update_stat_collection_remote(fledge_url, wait_time): | |||
"""Update the Stat colectioin of all south service to per asset & service""" |
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.
Statistics Collection
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
Signed-off-by: Mohit Singh Tomar <[email protected]>
fyi, FOGL-8190 Temporarily change the default statistics collection back to per asset |
Below are the jobs that I run with the changes: