Skip to content

Commit

Permalink
Merge branches 'feature-PEP-517' and 'feature' into feature-all
Browse files Browse the repository at this point in the history
* feature-PEP-517:
  [UPDATE] Version 1.4.3-RC
  [PEP-517] move to be PEP-517 compatable and away from setup.py (- WIP #46 -)

* feature:
  [TESTS] Fix for #49 by adding new test-unit for regressions (- WIP #49 -)
  [TESTS] added regression check for issue with test-reports in some CI runs (- WIP #49 -)

Changes in file .coveragerc:
 + hardened erronious coverage

Changes in file .github/workflows/Tests.yml:
 + new job: REGRESSION

Changes in file Makefile:
 + W.I.P. to move to new build system, see #46
 + improved stability a little

Changes in file multicast/__init__.py:
 + Version 1.4.3 bump

Changes in file requirements.txt:
 + added `build>=1.2.1` as part of #46

Changes in file setup.cfg:
 + Version 1.4.3 bump

Changes in file setup.py:
 - deprecated old build system

Changes in file tests/check_codecov_regression:
 + added new check to verify test-reports from `make test-pytest`
  • Loading branch information
reactive-firewall committed Aug 23, 2024
2 parents fa8aaaf + e665b7f commit 39089dd
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sigterm = True

[report]
include = multicast*,tests*
ignore_errors = True
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
Expand Down Expand Up @@ -51,5 +52,4 @@ partial_branches =
if 'os.path' not in sys.modules:
if 'argparse' not in sys.modules:

ignore_errors = True

101 changes: 81 additions & 20 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
env:
LANG: "en_US.UTF-8"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Pre-Clean
Expand All @@ -44,7 +44,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, 3.11]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
lang-var: ["de.utf-8", "jp.utf-8"]
experimental: [true]
include:
Expand All @@ -63,16 +63,19 @@ jobs:
- python-version: 3.9
lang-var: "en_US.utf-8"
experimental: false
- python-version: "3.10"
lang-var: "en_US.utf-8"
experimental: false
- python-version: "3.11"
lang-var: "en_US.utf-8"
experimental: false
env:
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: ${{ matrix.lang-var }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup dependencies
Expand Down Expand Up @@ -128,9 +131,9 @@ jobs:
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: "en_US.utf-8"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for ${{ matrix.python-version }}
Expand Down Expand Up @@ -175,9 +178,9 @@ jobs:
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
Expand Down Expand Up @@ -219,7 +222,7 @@ jobs:
verbose: true
fail_ci_if_error: false
- name: Upload Python ${{ matrix.python-version }} Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
path: ./test-reports/
Expand Down Expand Up @@ -251,9 +254,9 @@ jobs:
LANG: "en_US.utf-8"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies for python Linters
Expand All @@ -275,10 +278,69 @@ jobs:
run: make -j1 -f Makefile clean || true ;
if: ${{ always() }}

REGRESSION:
if: ${{ success() }}
needs: [MATS, COVERAGE]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: "en_US.utf-8"
LC_CTYPE: "en_US.utf-8"
COVERAGE_RCFILE: ./.coveragerc
COV_CORE_SOURCE: ./
COV_CORE_CONFIG: ./.coveragerc
COV_CORE_DATAFILE: .coverage
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
run: |
pip install --upgrade pip setuptools wheel
pip install -r ./requirements.txt ;
pip install coverage ;
pip install pytest ;
pip install pytest-cov ;
- name: Pre-Clean
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: Pre-install for Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile user-install || true ;
if: ${{ success() }}
- name: regression check for Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
run: |
./tests/check_codecov_regression || false ;
cp -vf ./coverage.xml ./test-reports/coverage.xml || true ;
shell: bash
- name: Summerize MATs for python ${{ matrix.python-version }}
id: sumerize-r-check
run: |
echo "- Test Reports did NOT regress for python version ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
if: ${{ success() }}
shell: bash
- name: Post-z-purge
id: post-uninstall
run: make -j1 -f Makefile purge || true ;
if: ${{ always() }}
- name: Post-Clean
id: post-zz-end
run: make -j1 -f Makefile clean || true ;
if: ${{ always() }}

INTEGRATION:
if: ${{ success() }}
needs: [MATS, COVERAGE]
needs: [MATS, COVERAGE, REGRESSION]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
Expand All @@ -297,9 +359,9 @@ jobs:
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
Expand Down Expand Up @@ -346,7 +408,7 @@ jobs:
verbose: true
fail_ci_if_error: false
- name: Upload Extra Python ${{ matrix.python-version }} Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Integration-Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
path: ./test-reports/
Expand All @@ -364,10 +426,9 @@ jobs:
run: make -j1 -f Makefile clean || true ;
if: ${{ always() }}


TOX:
if: ${{ success() }}
needs: [MATS, STYLE, COVERAGE, INTEGRATION]
needs: [MATS, STYLE, COVERAGE, REGRESSION, INTEGRATION]
runs-on: ubuntu-latest
timeout-minutes: 30

Expand All @@ -376,9 +437,9 @@ jobs:
LANG: 'en_US.utf-8'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies for Tox
Expand Down
159 changes: 159 additions & 0 deletions tests/check_codecov_regression
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
#! /bin/bash
#
# reactive-firewall/multicast regression check
# ..................................
# Copyright (c) 2024, Mr. Walls
# ..................................
# Licensed under APACHE-2 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# ..........................................
# http://www.apache.org/licenses/LICENSE-2.0
# ..........................................
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Disclaimer of Warranties.
# A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY
# APPLICABLE LAW, USE OF THIS SHELL SCRIPT AND ANY SERVICES PERFORMED
# BY OR ACCESSED THROUGH THIS SHELL SCRIPT IS AT YOUR SOLE RISK AND
# THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND
# EFFORT IS WITH YOU.
#
# B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SHELL SCRIPT
# AND SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE", WITH ALL FAULTS AND
# WITHOUT WARRANTY OF ANY KIND, AND THE AUTHOR OF THIS SHELL SCRIPT'S LICENSORS
# (COLLECTIVELY REFERRED TO AS "THE AUTHOR" FOR THE PURPOSES OF THIS DISCLAIMER)
# HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH RESPECT TO THIS SHELL SCRIPT
# SOFTWARE AND SERVICES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF
# MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE,
# ACCURACY, QUIET ENJOYMENT, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS.
#
# C. THE AUTHOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
# THE AUTHOR's SOFTWARE AND SERVICES, THAT THE FUNCTIONS CONTAINED IN, OR
# SERVICES PERFORMED OR PROVIDED BY, THIS SHELL SCRIPT WILL MEET YOUR
# REQUIREMENTS, THAT THE OPERATION OF THIS SHELL SCRIPT OR SERVICES WILL
# BE UNINTERRUPTED OR ERROR-FREE, THAT ANY SERVICES WILL CONTINUE TO BE MADE
# AVAILABLE, THAT THIS SHELL SCRIPT OR SERVICES WILL BE COMPATIBLE OR
# WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES,
# OR THAT DEFECTS IN THIS SHELL SCRIPT OR SERVICES WILL BE CORRECTED.
# INSTALLATION OF THIS THE AUTHOR SOFTWARE MAY AFFECT THE USABILITY OF THIRD
# PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES.
#
# D. YOU FURTHER ACKNOWLEDGE THAT THIS SHELL SCRIPT AND SERVICES ARE NOT
# INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE
# OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN, THE CONTENT, DATA OR
# INFORMATION PROVIDED BY THIS SHELL SCRIPT OR SERVICES COULD LEAD TO
# DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE,
# INCLUDING WITHOUT LIMITATION THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
# NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR
# WEAPONS SYSTEMS.
#
# E. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY THE AUTHOR
# SHALL CREATE A WARRANTY. SHOULD THIS SHELL SCRIPT OR SERVICES PROVE DEFECTIVE,
# YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
#
# Limitation of Liability.
# F. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT SHALL THE AUTHOR
# BE LIABLE FOR PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES
# FOR LOSS OF PROFITS, CORRUPTION OR LOSS OF DATA, FAILURE TO TRANSMIT OR
# RECEIVE ANY DATA OR INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER
# COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR
# INABILITY TO USE THIS SHELL SCRIPT OR SERVICES OR ANY THIRD PARTY
# SOFTWARE OR APPLICATIONS IN CONJUNCTION WITH THIS SHELL SCRIPT OR
# SERVICES, HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT,
# TORT OR OTHERWISE) AND EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
# OR LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR
# CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
# shall THE AUTHOR's total liability to you for all damages (other than as may
# be required by applicable law in cases involving personal injury) exceed
# the amount of five dollars ($5.00). The foregoing limitations will apply
# even if the above stated remedy fails of its essential purpose.
################################################################################

ulimit -t 600
PATH="/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:${PATH}"
umask 137

LOCK_FILE="/tmp/org.pak.multicast.test-mcast-regression-49-script.lock"
test -x "$(command -v find)" || exit 126 ;
test -x "$(command -v head)" || exit 126 ;
test -x "$(command -v git)" || exit 126 ;
hash -p ./.github/tool_shlock_helper.sh shlock || exit 255 ;
test -x "$(command -v shlock)" || exit 126 ;
test -x "$(command -v xargs)" || exit 126 ;
test -x "$(command -v make)" || exit 126 ;
declare -i EXIT_CODE=1 ;

function cleanup() {
rm -f "${LOCK_FILE}" 2>/dev/null || true ; wait ;
hash -d shlock 2>/dev/null > /dev/null || true ;
}

if [[ ( $(shlock -f ${LOCK_FILE} -p $$ ) -eq 0 ) ]] ; then
EXIT_CODE=0
trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 1 ;' SIGHUP || EXIT_CODE=3
trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 1 ;' SIGTERM || EXIT_CODE=4
trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 1 ;' SIGQUIT || EXIT_CODE=5
#trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 1 ;' SIGSTOP || EXIT_CODE=7
trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 1 ;' SIGINT || EXIT_CODE=8
trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true || true ; wait ; exit 1 ;' SIGABRT || EXIT_CODE=9
trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit ${EXIT_CODE} ;' EXIT || EXIT_CODE=1
else
# shellcheck disable=SC2046
echo "Test already in progress by "$(head "${LOCK_FILE}") ;
false ;
exit 255 ;
fi

# this is how test files are found:

# THIS IS THE ACTUAL TEST
_TEST_ROOT_DIR="./" ;
if [[ -f ../Makefile ]] ; then
_TEST_ROOT_DIR="../" ;
elif [[ -f ./Makefile ]] ; then
_TEST_ROOT_DIR="./" ;
elif [[ -d ./multicast ]] ; then
_TEST_ROOT_DIR="./multicast" ;
elif [[ ( -d $(git rev-parse --show-toplevel 2>/dev/null) ) ]] ; then
_TEST_ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null)" ;
else
printf "\t%s\n" "FAIL: missing valid clone or file"
EXIT_CODE=1
fi

if [[ (${EXIT_CODE} -eq 0) ]] ; then
test -r "${_TEST_ROOT_DIR}/Makefile" 1>/dev/null 2>&1 || EXIT_CODE=2 ;
if [[ (${EXIT_CODE} -ne 0) ]] ; then
printf "\t%s\n" "SKIP: ${_TEST_ROOT_DIR}/Makefile is not a valid makefile" ;
fi
if [[ (${EXIT_CODE} -eq 0) ]] ; then
make -C "${_TEST_ROOT_DIR}" -f "${_TEST_ROOT_DIR}/Makefile" test-pytest 1>/dev/null 2>&1 || EXIT_CODE=3 ;
if [[ (${EXIT_CODE} -eq 0) ]] ; then
test -r "${_TEST_ROOT_DIR}/.coverage" 1>/dev/null 2>&1 || test -r "${_TEST_ROOT_DIR}/.coverage.*" 1>/dev/null 2>&1 || EXIT_CODE=3 ;
fi
fi
test -d "${_TEST_ROOT_DIR}/test-reports" 1>/dev/null 2>&1 || EXIT_CODE=4 ;
test -r "${_TEST_ROOT_DIR}/test-reports/junit.xml" 1>/dev/null 2>&1 || EXIT_CODE=5 ;
if [[ ( ${EXIT_CODE} -ne 0 ) ]] ; then
case "$EXIT_CODE" in
1) printf "\t%s\n" "SKIP: Unclassified issue with test" ;;
2|3) printf "\t%s\n" "FAIL: Unstable version." >&2 ;;
4|5) printf "\t%s\n" "FAIL: Version is a REGRESSION of coverage." >&2 ;;
*) printf "\t%s\n" "SKIP: Can't check coverage" ;;
esac
fi
fi
unset _TEST_ROOT_DIR 2>/dev/null || true ;

cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null >/dev/null || true ; wait ;

# goodbye
exit ${EXIT_CODE:-255} ;

0 comments on commit 39089dd

Please sign in to comment.