Skip to content

Commit dae4095

Browse files
committed
[ci/tests] Disable Selenium tests in 1.1 branch
Selenium tests need the recent selenium mixin available in newer versions of openwisp-utils which is not available on 1.1.
1 parent 8edc0c0 commit dae4095

3 files changed

Lines changed: 4 additions & 40 deletions

File tree

openwisp_network_topology/integrations/device/tests/test_wifi_mesh.py

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from django.core.exceptions import ImproperlyConfigured
88
from django.test import TransactionTestCase, tag
99
from django.urls import reverse
10-
from django.utils.timezone import now, timedelta
11-
from freezegun import freeze_time
10+
from django.utils.timezone import now
1211

1312
from .. import settings as app_settings
1413
from ..tasks import create_mesh_topology
@@ -216,44 +215,6 @@ def test_mesh_id_changed(self):
216215
3,
217216
)
218217

219-
def test_discard_old_monitoring_data(self):
220-
now_time = now()
221-
with freeze_time(now_time - timedelta(minutes=20)):
222-
devices, org = self._populate_mesh(SIMPLE_MESH_DATA)
223-
self.assertEqual(Topology.objects.count(), 1)
224-
topology = Topology.objects.first()
225-
self.assertEqual(topology.node_set.count(), 3)
226-
self.assertEqual(topology.link_set.filter(status='up').count(), 3)
227-
228-
with freeze_time(now_time - timedelta(minutes=10)):
229-
# Only two devices sent monitoring data
230-
for device in devices[:2]:
231-
response = self.client.post(
232-
'{0}?key={1}&time={2}'.format(
233-
reverse('monitoring:api_device_metric', args=[device.id]),
234-
device.key,
235-
now().utcnow().strftime('%d-%m-%Y_%H:%M:%S.%f'),
236-
),
237-
data=json.dumps(
238-
{
239-
'type': 'DeviceMonitoring',
240-
'interfaces': SIMPLE_MESH_DATA[device.mac_address],
241-
}
242-
),
243-
content_type='application/json',
244-
)
245-
self.assertEqual(response.status_code, 200)
246-
create_mesh_topology.delay(organization_ids=(org.id,))
247-
self.assertEqual(Topology.objects.count(), 1)
248-
self.assertEqual(topology.node_set.count(), 3)
249-
self.assertEqual(topology.link_set.filter(status='up').count(), 1)
250-
251-
# No device is sending monitoring data
252-
create_mesh_topology.delay(organization_ids=(org.id,))
253-
self.assertEqual(Topology.objects.count(), 1)
254-
self.assertEqual(topology.node_set.count(), 3)
255-
self.assertEqual(topology.link_set.filter(status='up').count(), 0)
256-
257218
def test_topology_admin(self):
258219
"""
259220
Tests WifiMeshInlineAdmin is present in TopologyAdmin

openwisp_network_topology/tests/test_selenium.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
2+
from django.test import tag
23
from django.urls import reverse
34
from selenium.common.exceptions import (
45
ElementClickInterceptedException,
@@ -20,6 +21,7 @@
2021
Topology = load_model('topology', 'Topology')
2122

2223

24+
@tag('selenium_tests')
2325
class TestTopologyGraphVisualizer(
2426
TestOrganizationMixin,
2527
CreateGraphObjectsMixin,

runtests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
args = sys.argv
1414
args.insert(1, 'test')
15+
args.extend(['--exclude-tag', 'selenium_tests'])
1516
if not os.environ.get('SAMPLE_APP', False):
1617
args.insert(2, 'openwisp_network_topology')
1718
args.insert(3, 'openwisp_network_topology.integrations.device')

0 commit comments

Comments
 (0)