Sonar qube 3 (#166)

* add unittests for mqtt.py

* add mock

* move test requirements into a file

* fix unit tests

* fix formating

* initial version

* fix SonarQube warning
This commit is contained in:
Stefan Allius
2024-08-23 00:26:01 +02:00
committed by GitHub
parent 54de2aecfe
commit 27045cac6e
10 changed files with 451 additions and 160 deletions

View File

@@ -36,6 +36,15 @@ jobs:
timezoneLinux: "Europe/Berlin"
timezoneMacos: "Europe/Berlin"
timezoneWindows: "Europe/Berlin"
# - name: Start Mosquitto
# uses: namoshek/mosquitto-github-action@v1
# with:
# version: '1.6'
# ports: '1883:1883 8883:8883'
# certificates: ${{ github.workspace }}/.ci/tls-certificates
# config: ${{ github.workspace }}/.ci/mosquitto.conf
# password-file: ${{ github.workspace}}/.ci/mosquitto.passwd
# container-name: 'mqtt'
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
@@ -46,7 +55,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-asyncio pytest-cov coverage
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |