Skip to content

Commit

Permalink
[ci] Updated system dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Aug 31, 2023
1 parent c895432 commit 0794151
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ jobs:
- name: Install system libraries
run: |
sudo apt update
sudo apt-get -qq -y install xmlsec1 gettext
sudo apt-get -qq -y install xmlsec1 gettext \
sqlite3 \
fping \
gdal-bin \
libproj-dev \
libgeos-dev \
libspatialite-dev \
spatialite-bin \
libsqlite3-mod-spatialite
- name: Start InfluxDB and Redis container
run: docker-compose up -d influxdb redis

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3"

services:
influxdb:
image: influxdb:1.8-alpine
volumes:
- influxdb-data:/var/lib/influxdb
ports:
- "8086:8086"
environment:
INFLUXDB_DB: openwisp2
INFLUXDB_USER: openwisp
INFLUXDB_USER_PASSWORD: openwisp

redis:
image: redis:alpine
ports:
- "6379:6379"
entrypoint: redis-server --appendonly yes

volumes:
influxdb-data: {}
8 changes: 3 additions & 5 deletions openwisp_radius/integrations/monitoring/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_post_save_registered_user_edge_cases(
@patch('logging.Logger.warning')
def test_post_save_organization_user(self, *args):
user = self._create_user()
self._create_registered_user(user=user)
self._create_registered_user(user=user, method='')
self._create_org_user(user=user)
self.assertEqual(
self.metric_model.objects.filter(
Expand Down Expand Up @@ -185,9 +185,7 @@ def post_save_radiusaccounting_edge_cases(
options['called_station_id'] = '00:00:00:00:00:00'
options['unique_id'] = '117'
with self.subTest('Test session is not closed'):
with patch.object(
f'{TASK_PATH}.post_save_registereduser.delay'
) as mocked_task:
with patch(f'{TASK_PATH}.post_save_registereduser.delay') as mocked_task:
rad_acc = self._create_radius_accounting(**options)
self.assertEqual(rad_acc.stop_time, None)
mocked_task.assert_not_called()
Expand All @@ -206,7 +204,7 @@ def post_save_radiusaccounting_edge_cases(
' Skipping radius_acc metric writing!'
)

self._create_registered_user(user=user, method='')
self._create_registered_user(user=user)
options['unique_id'] = '119'
mocked_logger.reset_mock()

Expand Down
3 changes: 2 additions & 1 deletion tests/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
'OPTIONS': {
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'openwisp_utils.loaders.DependencyLoader',
'django.template.loaders.app_directories.Loader',
],
'context_processors': [
'django.template.context_processors.debug',
Expand Down Expand Up @@ -370,6 +370,7 @@
},
}
}
DATABASES['default']['ENGINE'] = 'openwisp_utils.db.backends.spatialite'

if os.environ.get('SAMPLE_APP', False):
INSTALLED_APPS.remove('openwisp_radius')
Expand Down

0 comments on commit 0794151

Please sign in to comment.