Skip to content

[TESTING] Improved test coverage slightly (- WIP #53 -) #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b16bad3
[TESTING] Improved test coverage slightly (- WIP #53 -)
reactive-firewall Oct 30, 2024
601fc77
[TESTING] Implemented tests/test_exceptions.py (- WIP #53 -)
reactive-firewall Oct 30, 2024
82f91d4
[TESTING] Implemented tests/test_hear_keyboard_interrupt.py (- WIP #5…
reactive-firewall Oct 30, 2024
05635b2
[TESTING] Fix for regression.
reactive-firewall Oct 30, 2024
6364fc2
[TESTING] Possible fix for regression Part 2.
reactive-firewall Oct 30, 2024
7e4a68d
[TESTING] Possible fix for regression Part 3.
reactive-firewall Oct 30, 2024
9994fac
[TESTING] Possible fix for regression Part 5.
reactive-firewall Oct 31, 2024
39381d7
[TESTING] Possible fix for regression Part 5.
reactive-firewall Oct 31, 2024
67215fe
[CONFIG] Fix braindead windows python pip issue (- WIP PR #175 -)
reactive-firewall Oct 31, 2024
d6fa180
[TESTING] Posible fix for linux ctlC tests (- WIP #53 -)
reactive-firewall Oct 31, 2024
f7f7777
[CI] Apply suggestions from code review (- WIP #176 -)
reactive-firewall Nov 1, 2024
830114d
[TESTING] Implemented CEP-8 exit-code refactoring and updated test co…
reactive-firewall Nov 4, 2024
7d4e617
[PATCH] Applied changes as discussed in review (- WIP #175 -)
reactive-firewall Nov 5, 2024
389c93e
[TESTING] Implemented new test HearHandleNoneDataTestSuite (- WIP #53 -)
reactive-firewall Nov 5, 2024
011d674
[TESTING] Fixup Part 1 (- WIP PR #175 -)
reactive-firewall Nov 5, 2024
1570947
[TESTING] Imporved test coverage slightly (- WIP #53 -)
reactive-firewall Nov 5, 2024
840832f
[PATCH] Minor Covrage tweak.
reactive-firewall Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ reviews:
# Code Review Instructions

- Ensure the code follows best practices and coding standards.
- Check for security vulnerabilities and potential issues.
- Ensure the code follows the **DRY, AHA, and SOLID** principles.
- Our "Code Review Checklist Guide" is documented in
[CEP-4](https://gist.github.com/reactive-firewall/cc041f10aad1d43a5ef15f50a6bbd5a5)
- For **Python** code, follow
[PEP 20](https://www.python.org/dev/peps/pep-0020/) and
[PEP 20](https://www.python.org/dev/peps/pep-0020/),
[PEP 483](https://peps.python.org/pep-0483/),
[PEP 729](https://peps.python.org/pep-0729/), and
[CEP-8](https://gist.github.com/reactive-firewall/b7ee98df9e636a51806e62ef9c4ab161)
standards.
- For **BASH** and **Shellscript** code, follow
Expand All @@ -19,25 +25,29 @@ reviews:
standards.
- Check all **BASH** files start with an
[extensive disclaimer](https://gist.github.com/reactive-firewall/866b42d175ae3ebefcb2a5878b30ea17).
- Check for security vulnerabilities and potential issues.
- Ensure the code follows the **DRY, AHA, and SOLID** principles.

# Documentation Review Instructions
- Verify that documentation and comments are clear and comprehensive.
- Verify that documentation and comments are free of spelling mistakes.
- Verify that technical documentation includes a "References" section at
the end of documentation, using the same format as actual RFCs, with
both "Normative References" and "Informative References".
- Ensure that that documentation and comments follow
[CEP-7](https://gist.github.com/reactive-firewall/123b8a45f1bdeb064079e0524a29ec20)

# Test Code Review Instructions
- Ensure that test code is automated, comprehensive, and follows testing best practices.
- Verify that all critical functionality is covered by tests.
- Ensure that test code follow
[CEP-8](https://gist.github.com/reactive-firewall/d840ee9990e65f302ce2a8d78ebe73f6)
- Ensure that the test coverage meets or exceeds the project's required threshold
(e.g., aiming for 100% coverage as per Issue #53).
- For **test** code, *also* follow
[CEP-9](https://gist.github.com/reactive-firewall/d840ee9990e65f302ce2a8d78ebe73f6)

# Misc.
- Confirm that the code meets the project's requirements and objectives.
- Confirm that copyright years are up-to date whenever a file is changed.
- For **Python** code, consider [PEP 290](https://peps.python.org/pep-0290/) whenever a python
(e.g. has the extension '.py') file is changed.
request_changes_workflow: true
high_level_summary: true
high_level_summary_placeholder: '@coderabbitai summary'
Expand Down Expand Up @@ -81,7 +91,7 @@ reviews:
3. You may assume the file 'README.md' will contain GitHub flavor Markdown.
- path: '**/*.py'
instructions: >-
When reviewing Python code for this project:
When reviewing **Python** code for this project:

1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.

Expand All @@ -96,7 +106,7 @@ reviews:
6. Verify Flake8's configuration file is located at ".flake8.ini"
- path: tests/*
instructions: >-
When reviewing test code:
When reviewing **test** code:

1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.

Expand Down Expand Up @@ -167,6 +177,7 @@ reviews:
- 'CEP-8'
- 'CEP-7'
- 'CEP-5'
- 'CEP-4'
- 'Shellscript'
- 'bash'
disabled_rules:
Expand Down
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exclude_lines =
pragma: no cover
from . import
pass
except ImportError
except Exception
except BaseException
# Don't complain if tests don't hit defensive assertion code:
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ updates:
dependency-type: "development"
exclude-patterns:
- "setuptools*"
allow:
allow:
- dependency-name: "setuptools"
dependency-type: "production"
- dependency-name: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Pull Request Labeler"
on:
pull_request_target:
types: [opened, reopened]
branches: [ master, stable ]
branches: ["master", "stable"]

# Declare default permissions as none.
permissions: {}
Expand Down
95 changes: 86 additions & 9 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CI
on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- stable
- HOTFIX-*
tags:
- v*
pull_request:
Expand All @@ -14,11 +15,18 @@
- synchronize
- ready_for_review

# Declare default permissions as read only.
permissions: read-all
# Declare default permissions as none.
permissions: {}

jobs:
BUILD:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: github.repository == 'reactive-firewall/multicast'
runs-on: ubuntu-latest
defaults:
Expand All @@ -43,6 +51,13 @@


BOOTSTRAP:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ !cancelled() }}
needs: BUILD
runs-on: ubuntu-latest
Expand Down Expand Up @@ -124,6 +139,13 @@


MATS:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ !cancelled() }}
needs: BUILD
runs-on: ubuntu-latest
Expand Down Expand Up @@ -167,14 +189,21 @@


COVERAGE:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ success() }}
needs: [BUILD, MATS]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
Expand All @@ -192,6 +221,9 @@
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Fix braindead windows ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Windows' }}
run: python -m pip install --upgrade pip
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
run: |
pip install --upgrade "pip>=22.0" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1";
Expand Down Expand Up @@ -248,6 +280,13 @@


STYLE:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ success() }}
needs: [BUILD, MATS]
runs-on: ubuntu-latest
Expand All @@ -257,15 +296,15 @@
timeout-minutes: 10

env:
PYTHON_VERSION: '3.12'
PYTHON_VERSION: '3.13'
LANG: "en_US.utf-8"

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies for python Linters
run: |
pip install --upgrade "pip>=22.0" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.2";
Expand All @@ -286,14 +325,21 @@


INTEGRATION:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ success() }}
needs: [MATS, COVERAGE]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down Expand Up @@ -395,6 +441,13 @@


EXTRAS-FOR-SETUP:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ success() }}
needs: [BOOTSTRAP, MATS]
runs-on: ${{ matrix.os }}
Expand All @@ -405,7 +458,7 @@
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down Expand Up @@ -468,6 +521,13 @@


EXTRAS-FOR-PIP:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ !cancelled() }}
needs: [BOOTSTRAP, MATS]
runs-on: ubuntu-latest
Expand All @@ -478,7 +538,7 @@
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: 'ubuntu-latest'
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down Expand Up @@ -516,6 +576,13 @@


DOCS:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ !cancelled() }}
needs: [MATS, COVERAGE, EXTRAS-FOR-SETUP, EXTRAS-FOR-PIP]
runs-on: ${{ matrix.os }}
Expand All @@ -539,6 +606,9 @@
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Fix braindead windows ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Windows' }}
run: python -m pip install --upgrade pip
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
run: |
pip install --upgrade "pip>=22.0" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1";
Expand All @@ -548,10 +618,10 @@
id: clean-prep
run: make -j1 -f Makefile clean ;
- name: Pre-build for Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile build ;
if: ${{ success() }}
- name: Generate documentation with py${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile build-docs 2>&1 >> $GITHUB_STEP_SUMMARY ;

Check warning on line 624 in .github/workflows/Tests.yml

View workflow job for this annotation

GitHub Actions / TOX

SKIPPED

SKIP Enhanced TOX Tests.

Check warning on line 624 in .github/workflows/Tests.yml

View workflow job for this annotation

GitHub Actions / TOX

SKIPPED

SKIP Enhanced TOX Tests.

Check warning on line 624 in .github/workflows/Tests.yml

View workflow job for this annotation

GitHub Actions / TOX

SKIPPED

SKIP Enhanced TOX Tests.
if: ${{ !cancelled() }}
- name: Lint documentation
run: |
Expand All @@ -575,6 +645,13 @@


TOX:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ success() }}
needs: [MATS, STYLE, COVERAGE, INTEGRATION, DOCS]
runs-on: ubuntu-latest
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA

name: Bandit
on:
on: # yamllint disable-line rule:truthy
push:
branches: [ "master", "stable", feature-*, HOTFIX-* ]
branches: ["main", "master", "stable"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "stable" ]
branches: ["main", "master", "stable", feature-*, patch-*, HOTFIX-*]

permissions: {}

Expand Down Expand Up @@ -48,4 +48,3 @@ jobs:
# skips: # optional, default is DEFAULT
# path to a .bandit file that supplies command line arguments
# ini_path: # optional, default is DEFAULT

8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ master, stable ]
branches: ["master", "stable"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ stable ]
branches: ["master", "stable"]
schedule:
- cron: '17 5 * * 1'

Expand All @@ -32,8 +32,8 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
language: ['python', 'javascript']
# CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby']
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/makefile-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
name: Makefile Lint
on: # yamllint disable-line rule:truthy
push:
branches: ["main", "master", "stable", feature*]
pull_request:
branches: ["main", "master", "stable"]
pull_request:
branches: ["main", "master", "stable", feature-*, patch-*, HOTFIX-*]

permissions: {} # Setting default permissions to none for enhanced security

Expand Down
Loading
Loading