Skip to content

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Oct 17, 2023

Adds tests against ruff@main, installed from source.

The test matrix is kind of big here, we could drop Python versions or operating systems (for a subset of the matrix) but I'm not sure what subset is best. Since this repository is relatively calm, it might not hurt to just have a bunch of checks.

Since this depends on us opening a pull request here to notice breakage with ruff, I'm also adding astral-sh/ruff#8016 which runs tests on each change to ruff.

@zanieb zanieb marked this pull request as ready for review October 17, 2023 15:41
@konstin
Copy link
Member

konstin commented Oct 17, 2023

imho we should split the test matrix into running the test across all platforms and python versions and testing special cases which only run on select targets, such as min python and latest python on ubuntu-latest.

@zanieb
Copy link
Member Author

zanieb commented Oct 17, 2023

@konstin I'm happy to make that change. Should we test latest or main across all targets?

@konstin
Copy link
Member

konstin commented Oct 17, 2023

I'd say latest, i'd special case main, though it's not a strong preference. If we make main first then we should run CI on every commit of astra-sh/ruff first, though my main reason for latest over main is practicality, pip install ruff is much faster than a whole release build of ruff.

@zanieb
Copy link
Member Author

zanieb commented Oct 18, 2023

Great I agree!

@zanieb
Copy link
Member Author

zanieb commented Oct 20, 2023

I've made the requested changes to the matrix — interestingly ruff version is not working in the pip install...

@zanieb
Copy link
Member Author

zanieb commented Oct 20, 2023

but it works locally... bigger hmm

@zanieb
Copy link
Member Author

zanieb commented Oct 20, 2023

Forcing reinstall was the key — presumably because we don't do fancy versioning for development commits

@zanieb zanieb requested a review from konstin October 20, 2023 20:06
zanieb added a commit that referenced this pull request Oct 23, 2023
Uses the long ruff version if supported by the binary.

Useful for testing e.g. #286
and astral-sh/ruff#8016

```
❯ pytest
======================================================================================================================================================= test session starts ========================================================================================================================================================
platform darwin -- Python 3.7.17, pytest-7.4.2, pluggy-1.2.0
ruff-version: 0.1.1+15 (860ffb954 2023-10-20)
rootdir: /Users/mz/eng/src/astral-sh/ruff-lsp
configfile: pyproject.toml
plugins: typeguard-3.0.2, asyncio-0.21.1, anyio-3.7.1
asyncio: mode=strict
collected 3 items                                                                                                                                                                                                                                                                                                                  

tests/test_format.py .                                                                                                                                                                                                                                                                                                       [ 33%]
tests/test_server.py ..                                                                                                                                                                                                                                                                                                      [100%]

======================================================================================================================================================== 3 passed in 0.68s =========================================================================================================================================================
```
@zanieb zanieb merged commit b2c8574 into main Oct 23, 2023
@zanieb zanieb deleted the zanie/test-main branch October 23, 2023 14:30
zanieb added a commit to astral-sh/ruff that referenced this pull request Oct 23, 2023
Adds a CI job which runs `ruff-lsp` tests against the current Ruff
build.

Avoids rebuilding Ruff at the cost of running _after_ the cargo tests
have finished. Might be worth the rebuild to get earlier feedback but I
don't expect it to fail often?

xref astral-sh/ruff-lsp#286

## Test plan

Verified use of the development version by inspecting version output in
CI; supported by astral-sh/ruff-lsp#289 and
#8034
azurelotus06 added a commit to azurelotus06/ruff-lsp that referenced this pull request Jun 27, 2024
Uses the long ruff version if supported by the binary.

Useful for testing e.g. astral-sh/ruff-lsp#286
and astral-sh/ruff#8016

```
❯ pytest
======================================================================================================================================================= test session starts ========================================================================================================================================================
platform darwin -- Python 3.7.17, pytest-7.4.2, pluggy-1.2.0
ruff-version: 0.1.1+15 (860ffb954 2023-10-20)
rootdir: /Users/mz/eng/src/astral-sh/ruff-lsp
configfile: pyproject.toml
plugins: typeguard-3.0.2, asyncio-0.21.1, anyio-3.7.1
asyncio: mode=strict
collected 3 items                                                                                                                                                                                                                                                                                                                  

tests/test_format.py .                                                                                                                                                                                                                                                                                                       [ 33%]
tests/test_server.py ..                                                                                                                                                                                                                                                                                                      [100%]

======================================================================================================================================================== 3 passed in 0.68s =========================================================================================================================================================
```
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.

3 participants