You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to changes in the values and removing the HDD in stats view.
the selenium test for test_statistics_details should be fixed.
_______________________________________________________________________________ test_statistics_details ________________________________________________________________________________
browser = <selenium.webdriver.chrome.webdriver.WebDriver (session="debe5fa7de4dc7b86f9cb0e5677247cc")>
def test_statistics_details(browser):
"""
TC1503 - Verify Statistics
Steps:
- Navigate to the dashboard.
- Click on TFGrid from side menu.
- Click on Stats.
Result: Assert that the displayed values should match the data from the grid proxy.
"""
statistics_page = before_test_setup(browser)
grid_proxy = GridProxy(browser)
statistics_details = statistics_page.statistics_detials()
grid_statistics_details = grid_proxy.get_stats()
# Convert necessary values from string to integer for comparison, but keeping the dictionary structure
statistics_details_converted = {
key: int(value.replace(',', '')) if value is not None and value.replace(',', '').isdigit() else value
for key, value in statistics_details.items()
}
# Full set of assertions, comparing UI stats with proxy stats
assert grid_statistics_details['nodes'] == statistics_details_converted['nodes']
assert grid_statistics_details['dedicatedNodes'] == statistics_details_converted['dedicatedNodes']
assert grid_statistics_details['farms'] == statistics_details_converted['farms']
assert grid_statistics_details['countries'] == statistics_details_converted['countries']
assert grid_statistics_details['totalCru'] == statistics_details_converted['totalCru']
> assert math.isclose(convert_to_scaled_float(grid_statistics_details['totalSru']), convert_to_scaled_float(byte_converter(statistics_details_converted['totalSru'])), abs_tol=0.002)
tests/TFGrid/test_statistics.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = '26,040 GB'
def byte_converter(value):
# Define the unit and the numeric value before checking conditions
unit = value[-2].upper() # Last character represents the unit (P, T, G)
number_str = value[:-3].strip() # Everything except the last two characters is the number
if value != '0':
# Convert based on the unit
if unit == 'P': # Petabytes
return float(number_str) * (1024 ** 5)
elif unit == 'T': # Terabytes
return float(number_str) * (1024 ** 4)
elif unit == 'G': # Gigabytes
> return float(number_str) * (1024 ** 3)
E ValueError: could not convert string to float: '26,040'
utils/utils.py:203: ValueError
------------------------------ Generated html report: file:///home/ramez/ramez/work/tfgrid-sdk-ts/packages/playground/tests/frontend_selenium/report.html ------------------------------
=============================================================================== short test summary info ================================================================================
FAILED tests/TFGrid/test_statistics.py::test_statistics_details - ValueError: could not convert string to float: '26,040'
Is there an existing issue for this?
which package/s did you face the problem with?
Dashboard
What happened?
failing tests:
Due to changes in the values and removing the HDD in stats view.
the selenium test for test_statistics_details should be fixed.
Steps To Reproduce
No response
which network/s did you face the problem on?
Dev
version
2.6.3
Twin ID/s
No response
Node ID/s
No response
Farm ID/s
No response
Contract ID/s
No response
Relevant screenshots/screen records
Relevant log output
https://github.com/threefoldtech/tfgrid-sdk-ts/actions/runs/12336547750/job/34429194672
The text was updated successfully, but these errors were encountered: