Skip to content

[BUG]: Windows CI Tests False-Positive of Passing #604

Closed
@adam-grant-hendry

Description

@adam-grant-hendry

Description

After reviewing your Actions, it is clear tests are not running on Windows machines. On Windows, the linter and test script does not output any results and takes 0 or 1s to complete, whereas on Linux/MacOS they take >1 minute and output pytest results.

Your .github/workflows/pythonpackage.yml worflow does not specify a shell to use in the Run tests and linters step. Hence, on Windows, it defaults to using Powershell. Thus, what is run (which you can see in this example workflow) is simply:

pwsh -Command ./scripts/test

This does nothing more than ask Windows to attempt to open a file it does not know how to handle, which is easily repeated locally:

Commitizen_Testing_Error.mp4

Cloning the repo, changing the shebang to a portable variant, and running pytest, it is clear many tests are failing on Windows. This was first noticed in #602

https://github.com/commitizen-tools/commitizen/files/9790428/pytest_report.zip

Steps to reproduce

  1. Follow the Contributing steps to:
    (a) Fork the repo, install dependencies through poetry, and setup the pre-commit hooks
  2. Run pre-commit run --all

Current behavior

Tests are failing silently on GitHub Actions (i.e. CI), yielding false positives on prior commits. Tests fail explicitly when the repo is cloned and tested on Windows, which also prevents developers using Windows to contribute (pre-commit tests fail, preventing pushing to PRs).

Desired behavior

  1. Windows tests run on GitHub Actions
  2. Windows users can contribute to your repo

If you continue to package for Windows, you need to confirm that your tests are actually running and passing. Your tests are failing at this point.

Screenshots

Please see the Description.

Environment

Commitizen Version: 2.35.0
Python Version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Operating System: Windows

Local pytest Report

Adding the pytest run on Windows, first referenced in #602 . This report was generated using the pytest-html plugin.

pytest_report.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions