Skip to content

Commit 04d92d0

Browse files
authored
[tests] Updated selenium tests, CI, prettier, etc
* [tests] Updated selenium tests * [qa] Reformatted JS/CSS with prettier * [ci] APT cache, disable man autoupdate, headless mode, show gecko log * [ci] Exclude selenium from repeated test runs * [tests] Updated test mesh data (uppercase macaddr) OpenWISP-Controller now enforces uppercase mac addresses
1 parent 7d1c8dd commit 04d92d0

File tree

10 files changed

+504
-519
lines changed

10 files changed

+504
-519
lines changed

.github/workflows/ci.yml

+25-4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ jobs:
4545
cache-dependency-path: |
4646
**/requirements*.txt
4747
48+
- name: Cache APT packages
49+
uses: actions/cache@v4
50+
with:
51+
path: /var/cache/apt/archives
52+
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
53+
restore-keys: |
54+
apt-${{ runner.os }}-
55+
56+
- name: Disable man page auto-update
57+
run: |
58+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
59+
sudo dpkg-reconfigure man-db
60+
4861
- name: Install Dependencies
4962
id: deps
5063
run: |
@@ -62,8 +75,9 @@ jobs:
6275
pip install -U -r requirements-test.txt
6376
pip install ${{ matrix.django-version }}
6477
65-
# start influxdb
66-
docker compose up -d influxdb
78+
- name: Start InfluxDB
79+
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
80+
run: docker compose up -d influxdb
6781

6882
- name: QA checks
6983
run: ./run-qa-checks
@@ -72,10 +86,17 @@ jobs:
7286
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
7387
run: |
7488
coverage run runtests.py --parallel
75-
WIFI_MESH=1 coverage run runtests.py --parallel
76-
SAMPLE_APP=1 coverage run ./runtests.py --parallel
89+
WIFI_MESH=1 coverage run runtests.py --parallel --exclude-tag=selenium_tests
90+
SAMPLE_APP=1 coverage run ./runtests.py --parallel --exclude-tag=selenium_tests
7791
coverage combine
7892
coverage xml
93+
env:
94+
SELENIUM_HEADLESS: 1
95+
GECKO_LOG: 1
96+
97+
- name: Show gecko web driver log on failures
98+
if: ${{ failure() }}
99+
run: cat geckodriver.log
79100

80101
- name: Upload Coverage
81102
if: ${{ success() }}

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
openwisp_network_topology/static/netjsongraph/css/lib/jquery-ui.min.css
2+
openwisp_network_topology/static/netjsongraph/js/src/netjsongraph.min.js
3+
openwisp_network_topology/static/netjsongraph/js/lib/jquery-ui.min.js

openwisp_network_topology/integrations/device/tests/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SIMPLE_MESH_DATA = {
2-
'64:70:02:c3:03:b2': [
2+
'64:70:02:C3:03:B2': [
33
{
44
'mac': '64:70:02:c3:03:b3',
55
'mtu': 1500,
@@ -52,7 +52,7 @@
5252
},
5353
}
5454
],
55-
'a4:bc:3f:ae:c7:0b': [
55+
'A4:BC:3F:AE:C7:0B': [
5656
{
5757
'mac': 'a4:bc:3f:ae:c7:0c',
5858
'mtu': 1500,
@@ -106,7 +106,7 @@
106106
},
107107
}
108108
],
109-
'2a:9a:fb:12:11:76': [
109+
'2A:9A:FB:12:11:76': [
110110
{
111111
'mac': '2a:9a:fb:12:11:77',
112112
'mtu': 1500,
@@ -223,7 +223,7 @@
223223
}
224224

225225
SINGLE_NODE_MESH_DATA = {
226-
'64:70:02:c3:03:b2': [
226+
'64:70:02:C3:03:B2': [
227227
{
228228
'mac': '64:70:02:c3:03:b3',
229229
'mtu': 1500,
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
input[type='text'].readonly {
2-
border: 1px solid rgba(0, 0, 0, 0.05) !important;
3-
background-color: rgba(0, 0, 0, 0.07);
1+
input[type="text"].readonly {
2+
border: 1px solid rgba(0, 0, 0, 0.05) !important;
3+
background-color: rgba(0, 0, 0, 0.07);
44
}
55

66
#id_receive_url {
7-
width: 435px;
7+
width: 435px;
88
}
99

1010
.djnjg-overlay {
11-
display: none;
11+
display: none;
1212
}
1313

1414
.djnjg-overlay .inner {
15-
width: 100%;
16-
height: 100%;
17-
overflow: hidden;
15+
width: 100%;
16+
height: 100%;
17+
overflow: hidden;
1818
}
1919

2020
.submit-row .visualizelink {
21-
background: #778898;
21+
background: #778898;
2222
}
2323
.submit-row .visualizelink:hover,
2424
.submit-row .visualizelink:focus {
25-
background: #576a7c;
25+
background: #576a7c;
2626
}
2727

2828
/*
@@ -32,5 +32,5 @@ The CSS for "hidden" class in Django >= 4.1 sets
3232
property below.
3333
*/
3434
.njg-sideBar.hidden {
35-
display: unset !important;
35+
display: unset !important;
3636
}

0 commit comments

Comments
 (0)