Skip to content

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

Open
Mohit04tomar wants to merge 14 commits intodevelopfrom
FOGL-8175
Open

FOGL-8175: Updated the system test that requires stats collection “per asset & service”#1193
Mohit04tomar wants to merge 14 commits intodevelopfrom
FOGL-8175

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 and others added 8 commits October 10, 2023 17:22
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>
@Mohit04tomar Mohit04tomar marked this pull request as ready for review October 12, 2023 06:52
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
@Mohit04tomar Mohit04tomar changed the title FOGL-8175 FOGL-8175: Updated the system test that requires stats collection “per asset & service” Oct 12, 2023


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.

"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?

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)



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.

?

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

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)



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 <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
Signed-off-by: Mohit Singh Tomar <M.singh19994@gmail.com>
@ashish-jabble
Copy link
Member

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

@ashish-jabble
Copy link
Member

@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.

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