Skip to content

Commit

Permalink
[qa/ci/misc] Maintenance
Browse files Browse the repository at this point in the history
- Reformatted code & docs
- Updated CI settings
- Updated setup.py
  • Loading branch information
nemesifier committed Aug 1, 2024
1 parent debb576 commit dde3385
Show file tree
Hide file tree
Showing 72 changed files with 2,023 additions and 1,791 deletions.
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install system libraries
run: |
sudo apt update
sudo apt-get -qq -y install xmlsec1 gettext
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -44,6 +39,8 @@ jobs:
- name: Install Dependencies
id: deps
run: |
sudo apt update -qq
sudo apt-get -qq -y install xmlsec1 gettext
pip install -U pip wheel setuptools
pip install -U -r requirements-test.txt
pip install -e .[saml,openvpn_status]
Expand All @@ -57,9 +54,10 @@ jobs:
- name: Tests
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
coverage run --source=openwisp_radius runtests.py
coverage run runtests.py --parallel
# SAMPLE tests do not influence coverage, so we can speed up tests with --parallel
SAMPLE_APP=1 ./runtests.py --parallel --keepdb > /dev/null 2>&1 || SAMPLE_APP=1 ./runtests.py --keepdb
SAMPLE_APP=1 coverage run ./runtests.py --parallel > /dev/null 2>&1 || SAMPLE_APP=1 ./runtests.py
coverage combine
coverage xml
- name: Upload Coverage
Expand Down
205 changes: 107 additions & 98 deletions CHANGES.rst

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Please refer to the `OpenWISP Contribution Guidelines <http://openwisp.io/docs/developer/contributing.html>`_.
Please refer to the `OpenWISP Contribution Guidelines
<http://openwisp.io/docs/developer/contributing.html>`_.
22 changes: 11 additions & 11 deletions docs/source/developer/captive_portal_mock.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
=========================
Captive portal mock views
=========================

The development environment of openwisp-radius provides two URLs that mock
the behavior of a captive portal, these URLs can be used when testing
frontend applications like
`openwisp-wifi-login-pages <https://github.com/openwisp/openwisp-wifi-login-pages>`_
during development.
frontend applications like `openwisp-wifi-login-pages
<https://github.com/openwisp/openwisp-wifi-login-pages>`_ during
development.

.. note::
These views are meant to be used just for development and testing.

These views are meant to be used just for development and testing.

Captive Portal Login Mock View
------------------------------

- **URL**: ``http://localhost:8000/captive-portal-mock/login/``.
- **POST fields**: ``auth_pass`` or ``password``.

This view looks for ``auth_pass`` or ``password`` in the POST request data,
and if it finds anything will try to look for any ``RadiusToken`` instance
having its key equal to this value, and if it does find one, it makes a
``POST`` request to accouting view to create the radius session related to
the user to which the radius token belongs, provided there's no other open
session for the same user.
This view looks for ``auth_pass`` or ``password`` in the POST request
data, and if it finds anything will try to look for any ``RadiusToken``
instance having its key equal to this value, and if it does find one, it
makes a ``POST`` request to accouting view to create the radius session
related to the user to which the radius token belongs, provided there's no
other open session for the same user.

Captive Portal Logout Mock View
-------------------------------
Expand Down
31 changes: 18 additions & 13 deletions docs/source/developer/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
============
Contributing
============

Thank you for taking the time to contribute to openwisp-radius, please read the
`guide for contributing to openwisp repositories <http://openwisp.io/docs/developer/contributing.html>`_.
Thank you for taking the time to contribute to openwisp-radius, please
read the `guide for contributing to openwisp repositories
<http://openwisp.io/docs/developer/contributing.html>`_.

Follow these guidelines to speed up the process.

.. contents:: **Table of Contents**:
:backlinks: none
:depth: 3
:backlinks: none
:depth: 3

.. note::
**In order to have your contribution accepted faster**, please read the
`OpenWISP contributing guidelines <http://openwisp.io/docs/developer/contributing.html>`_ and make sure to follow its guidelines.

**In order to have your contribution accepted faster**, please read
the `OpenWISP contributing guidelines
<http://openwisp.io/docs/developer/contributing.html>`_ and make sure
to follow its guidelines.

Setup
-----

Once you have chosen an issue to work on, :ref:`setup your machine for development <installing_for_development>`.
Once you have chosen an issue to work on, :ref:`setup your machine for
development <installing_for_development>`.

Ensure test coverage does not decrease
--------------------------------------
Expand Down Expand Up @@ -47,8 +51,9 @@ First of all, install the test requirements:
pip install --no-cache-dir -U -r requirements-test.txt
npm install -g jslint
Before committing your work check that your changes are not breaking
our `coding style conventions <https://openwisp.io/docs/developer/contributing.html#coding-style-conventions>`_:
Before committing your work check that your changes are not breaking our
`coding style conventions
<https://openwisp.io/docs/developer/contributing.html#coding-style-conventions>`_:

.. code-block:: shell
Expand All @@ -59,16 +64,16 @@ our `coding style conventions <https://openwisp.io/docs/developer/contributing.h
For more information, please see:

- `OpenWISP Coding Style Conventions <https://openwisp.io/docs/developer/contributing.html#coding-style-conventions>`_
- `OpenWISP Coding Style Conventions
<https://openwisp.io/docs/developer/contributing.html#coding-style-conventions>`_

Update the documentation
------------------------

If you introduce new features or change existing documented behavior,
please remember to update the documentation!

The documentation is located in the ``/docs`` directory
of the repository.
The documentation is located in the ``/docs`` directory of the repository.

To do work on the docs, proceed with the following steps:

Expand Down
Loading

0 comments on commit dde3385

Please sign in to comment.