-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage for the oldest supported Ruff version (#270)
Adds test coverage for the oldest supported Ruff version by adding the Ruff version to the CI test matrix. The Ruff versions in the matrix are generated by parsing the lower pin from our `pyproject.toml` and the latest release from GitHub. I opted for this approach because it's nice to see the version being tested in the CI job names and it does not require manual updates. The `just check` job was split out from tests because it requires `ruff format` which is not available in old releases. The tests did not pass on the old release of Ruff due missing `format` support and the new documentation domain. I've added toggles in the test to address those cases based on the Ruff version being tested. Motivated by a desire for test coverage in #266
- Loading branch information
Showing
5 changed files
with
129 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
from packaging.version import Version | ||
|
||
from ruff_lsp.server import _find_ruff_binary, _get_global_defaults, uris | ||
from ruff_lsp.settings import WorkspaceSettings | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def ruff_version() -> Version: | ||
# Use the ruff-lsp directory as the workspace | ||
workspace_path = str(Path(__file__).parent.parent) | ||
|
||
settings = WorkspaceSettings( | ||
**_get_global_defaults(), # type: ignore[misc] | ||
cwd=None, | ||
workspacePath=workspace_path, | ||
workspace=uris.from_fs_path(workspace_path), | ||
) | ||
|
||
return _find_ruff_binary(settings, version_requirement=None).version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters