Skip to content

Commit

Permalink
Add marker for CPU usage notification test
Browse files Browse the repository at this point in the history
We have multiple targets where this will not work due to a) lack of the resource
or information and b) the resource value is not getting updated regularly
(if there is no resource value update -> there cannot be a notification, either).
  • Loading branch information
JanneKiiskila committed May 22, 2023
1 parent 79a4112 commit 96c7cb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Izuma E2E Edge Python Test Suite Change log

## 1.2.1
- Add marker `cpu_notif_test` to CPU resource notification test. This allows you to skip that test with `pytest -m "not reboot_test"`. You can skip that and reboot test with `-m 'not (reboot_test or cpu_notif_test)'`.
- Add marker `reboot_test` to LwM2M test that resets device. This allows you to skip that test with `pytest -m "not reboot_test"`.
- Move `pytest.ini` from `tests`-folder to root, this way to the custom marker gets taken into account.
- Upgrade pytest to 7.3.1 and pytest-html 3.2.0 to resolve Python 3.10 compatiblity issue.
- Upgrade `pytest` to 7.3.1 and `pytest-html` 3.2.0 to resolve Python 3.10 compatiblity issue.
- Add *.xml files to `.gitignore`.

## 1.2.0
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ junit_family = xunit1
junit_logging = all
markers =
reboot_test: this test will reboot device (deselect with '-m "not reboot_test"')
cpu_notif_test: CPU temperature notification test (deselect with '-m "not cpu_notif_test"')
6 changes: 5 additions & 1 deletion tests/test_websocket_notifications.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2022, Izuma Networks
# Copyright (c) 2020-2021, Pelion and affiliates.
# Copyright (c) 2022-2023, Izuma Networks
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -82,6 +82,10 @@ def test_registration_notification(edge, cloud_api, websocket):
assert data, 'Registration not received from websocket notification channel'


# Add marker - this CPU usage notificiation test will not work on many devices,
# as they might not have the resource (or the resource value does not get updated regularly)
# Allows you to skip it with pytest -m "not cpu_notif_test"
@pytest.mark.cpu_notif_test
def test_notification_device_cpu_usage(edge, cloud_api, websocket, subscribe_to_resource):
cpu_usage = '/3/0/3320'
payload = {'method': 'GET', 'uri': cpu_usage}
Expand Down

0 comments on commit 96c7cb6

Please sign in to comment.