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

FOGL-8175: Updated the system test that requires stats collection “per asset & service” #1193

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

Mohit04tomar
Copy link
Contributor

@Mohit04tomar Mohit04tomar commented Oct 11, 2023

Below are the jobs that I run with the changes:

  1. fledge_packages_pair_system_test_c_north_service_ub1804/515/
  2. fledge_packages_pair_system_test_python_north_service_ub1804/539/
  3. fledge_packages_pair_system_test_python_north_service_ub20x86_ub18aarch64/598/
  4. fledge_packages_pi_web_api/611/
  5. fledge_packages_pi_web_api_2021sp2/220/
  6. fledge_packages_system_test_north_service_ub1804/452/
  7. fledge_packages_system_test_north_service_ub1804_piwebapi2021sp2/217/
  8. fledge_packages_system_test_OMF_naming_scheme_ub2004/430/
  9. fledge_packages_system_test_pi_web_api_2021sp3_linked_data_type/143/
  10. fledge_nightly_build_ub1804/1732/
  11. fledge_nightly_build_ub2004/1047/
  12. fledge_nightly_build_ubuntu18_aarch64/158/
  13. fledge_packages_system_test_stats_history_notification_rule/82/
  14. fledge_packages_system_test_eds/568/

@Mohit04tomar Mohit04tomar marked this pull request as ready for review October 12, 2023 06:52
@Mohit04tomar Mohit04tomar changed the title FOGL-8175 FOGL-8175: Updated the system test that requires stats collection “per asset & service” Oct 12, 2023
@@ -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"):
Copy link
Member

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.


@pytest.fixture
def update_stat_collection(fledge_url, wait_time):
"""Update the Stat colectioin of all south service to per asset & service"""
Copy link
Member

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)
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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,
Copy link
Member

@ashish-jabble ashish-jabble Oct 12, 2023

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
Copy link
Member

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)
Copy link
Member

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"""
Copy link
Member

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)
Copy link
Member

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"""
Copy link
Member

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
Copy link
Member

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)
Copy link
Member

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"""
Copy link
Member

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]>
@ashish-jabble
Copy link
Member

fyi, FOGL-8190 Temporarily change the default statistics collection back to per asset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold on hold
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants