Skip to content

Skip Qt workflow tests when PySide6 is not installed in core CI - #14

Merged
geohang merged 2 commits into
mainfrom
copilot/fix-test-failing-job
Aug 3, 2026
Merged

Skip Qt workflow tests when PySide6 is not installed in core CI#14
geohang merged 2 commits into
mainfrom
copilot/fix-test-failing-job

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The test (ubuntu, py3.11) workflow was failing during pytest collection because tests/test_workflow_process.py imported PySide6 unconditionally, while the core test job does not install the desktop Qt dependency. This change scopes the Qt dependency to the tests that actually need it so the rest of the workflow-process coverage still runs in headless CI.

  • Root cause

    • tests/test_workflow_process.py imported QProcess and ProcessWorkflowWorker at module load time.
    • In the core Ubuntu test job, PySide6 is absent by design, so collection aborted before any tests in the module could run.
  • Change

    • Replace the module-level Qt imports with a small helper that resolves Qt-only dependencies lazily.
    • Use pytest.importorskip("PySide6") inside that helper so GUI-specific tests skip cleanly when the desktop extra is not installed.
  • Effect

    • Non-GUI workflow tests in test_workflow_process.py continue to execute in the core CI environment.
    • Only the ProcessWorkflowWorker tests become conditional on PySide6, matching the package's optional dependency model.
def _process_worker_dependencies():
    pytest.importorskip("PySide6")

    from PySide6.QtCore import QProcess
    from PyHydroGeophysX.qt_apps.workers import ProcessWorkflowWorker

    return ProcessWorkflowWorker, QProcess

Copilot AI changed the title [WIP] Fix failing GitHub Actions job test (ubuntu, py3.11) Skip Qt workflow tests when PySide6 is not installed in core CI Aug 3, 2026
Copilot AI requested a review from geohang August 3, 2026 16:39
@geohang
geohang marked this pull request as ready for review August 3, 2026 16:44
@geohang
geohang merged commit 2bbdfa6 into main Aug 3, 2026
3 checks passed
@geohang
geohang deleted the copilot/fix-test-failing-job branch August 5, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants