Commit Graph

5 Commits

Author SHA1 Message Date
dc3c735655 test: 100% coverage on core modules with headless CI support
Some checks failed
SonarQube Code Quality Scan / SonarQube Scan (push) Failing after 1m20s
- Fix dead exception handler in discord_rpc.py (unreachable DiscordNotFound)
- Replace QMediaPlayer=None stub with proper _StubQMediaPlayer in player.py
- Make AudioVisualizer color stops Qt-free (raw tuples instead of QColor)
- Add conftest QApplication creation check for headless CI detection
- Add test_gui_widgets.py _qt_available() guard for headless environments
- Add test_main.py (30 tests) for main.py entry point and env vars
- Add test_import_fallbacks.py (14 tests) for Qt import fallback paths
- Extend test_gui_helpers.py with _css, _get_thumbnail_nam, _cached_thumb_path tests
- Extend test_discord_rpc.py with direct _connect() test for DiscordNotFound
- Extend test_player_helpers.py with SearchWorker test-mode tests
- Ensure import fallback tests clean up sys.modules to avoid cross-test pollution

100% coverage achieved on: config.py, discord_rpc.py, main.py, music_db.py
2026-06-04 20:53:00 +03:00
fb478d6612 🐛 | Fix SonarQube violations - use items() and remove assert True
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 1m42s
2026-06-04 19:00:38 +03:00
d8ebd6186c 🐛 | Improve test coverage for SonarQube quality gate
Some checks failed
SonarQube Code Quality Scan / SonarQube Scan (push) Failing after 1m20s
- Restructure conftest to try real Qt first, fall back to stubs
  only if that fails — ensures try/except guards in player.py and
  gui.py are exercised in CI, improving new_coverage
- Add tests for _migrate_legacy error paths (JSONDecodeError,
  OSError, db migration) — config.py now 100% covered
- Add tests for _disconnect, _send_presence exception handlers —
  discord_rpc.py now 97% covered
- Add tests for _cleanup_path and _tmp_dir helpers — player.py
  coverage bumped to 33%
2026-06-03 19:35:20 +03:00
8597d03a1e 🐛 | Fix SonarQube issues
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 1m42s
- Extract duplicated string literals into constants (S1192)
- Replace dict() with {} literal (S7498)
- Remove duplicate test_zero_ms (S4144)
- Remove/rename unused variables (S1481)
- Replace constant assert True with comment (S5914)
- Mark stub empty methods as intentional (S1186)
- Review 2 security hotspots as safe (S5443)
2026-06-03 19:14:22 +03:00
2870f790bd 🐛 | Fix tests
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 1m44s
2026-06-03 19:05:17 +03:00