Skip to content
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

Run tests with specific combination of required packages #2444

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 6 additions & 13 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ jobs:
python setup.py build_locales -i
pip install pytest pytest-randomly pytest-cov
pytest --verbose --cov=picard --cov-report xml:coverage.xml test
- name: Test python-libdiscid (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libdiscid-dev
python -c "from picard.disc import discid_version; print(discid_version)"
pytest --verbose test/test_disc.py
pip install python-libdiscid
python -c "from picard.disc import discid_version; print(discid_version)"
pytest --verbose test/test_disc.py
- name: Submit code coverage to Codacy
if: env.CODACY_PROJECT_TOKEN
run: |
Expand All @@ -78,7 +68,11 @@ jobs:
os: [ubuntu-latest]
python-version: ['3.9']
dependencies: [
"PyQt6==6.2.3 mutagen==1.37",
"PyQt6==6.5.3 PyQt6-Qt6==6.5.3 mutagen==1.37 python-dateutil==2.7 PyYAML==5.1", # minimal versions, minimum dependencies
"PyQt6>=6.5.3 mutagen~=1.37 python-dateutil~=2.7 PyYAML~=6.0 discid==1.0",
"PyQt6>=6.5.3 mutagen~=1.37 python-dateutil~=2.7 PyYAML~=6.0 python-libdiscid",
"PyQt6>=6.5.3 mutagen~=1.37 python-dateutil~=2.7 PyYAML~=6.0 charset-normalizer==2.0.6",
"PyQt6>=6.5.3 mutagen~=1.37 python-dateutil~=2.7 PyYAML~=6.0 chardet==3.0.4",
]

steps:
Expand All @@ -91,12 +85,11 @@ jobs:
if: runner.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install libegl1
sudo apt-get install libdiscid-dev libegl1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install $DEPENDENCIES
pip install -r requirements.txt
env:
DEPENDENCIES: ${{ matrix.dependencies }}
- name: Test with pytest
Expand Down
5 changes: 4 additions & 1 deletion test/test_disc_eaclog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2022 Laurent Monin
# Copyright (C) 2022 Philipp Wolfer
# Copyright (C) 2022, 2024 Philipp Wolfer
# Copyright (C) 2022 Jeffrey Bosboom
#
# This program is free software; you can redistribute it and/or
Expand All @@ -22,6 +22,7 @@


from typing import Iterator
import unittest

from test.picardtestcase import (
PicardTestCase,
Expand All @@ -36,6 +37,7 @@
NotSupportedTOCError,
TocEntry,
)
from picard.util import detect as charset_detect


test_log = (
Expand Down Expand Up @@ -72,6 +74,7 @@ def _test_toc_from_file(self, logfile):
toc = toc_from_file(test_log)
self.assertEqual((1, 8, 149323, 150, 25064, 43611, 60890, 83090, 100000, 115057, 135558), toc)

@unittest.skipUnless(charset_detect, "test requires charset_normalizer or chardet package")
def test_toc_from_file_eac_windows1251(self):
self._test_toc_from_file('eac-windows1251.log')

Expand Down
Loading