Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv/tests: add new 'ecosystem' integration tests #5970

Merged
merged 6 commits into from
Aug 13, 2024
Merged

Conversation

BurntSushi
Copy link
Member

At a high level, this PR adds a smattering of new tests that
effectively snapshot the output of uv lock for a selection of
"ecosystem" projects. That is, real Python projects for which we expect
uv to work well with.

The main idea with these tests is to get a better idea of how changes
in uv impact the lock files of real world projects. For example,
we're hoping that these tests will help give us data for how #5733
differs from #5887.

This has already revealed some bugs. Namely, re-running uv lock for a
second time will produce a different lock file for some projects. So to
prioritize getting the tests added, for those projects, we don't do the
deterministic checking.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea.

@zanieb
Copy link
Member

zanieb commented Aug 9, 2024

Could we note in a README or something what commits these were pulled from for each project?

@BurntSushi BurntSushi force-pushed the ag/ecosystem branch 3 times, most recently from 26f93b1 to 8f662eb Compare August 9, 2024 18:55
@BurntSushi
Copy link
Member Author

I marked the warehouse and transformers tests to run on Linux only. The former because it seems to rely on running pg_config (so I'm not sure how one would produce a universal resolution on, say, Windows) and the latter because it times out on macOS/Windows.

@konstin
Copy link
Member

konstin commented Aug 9, 2024

I love having ecosystem test for the universal resolver!

Are there options to trim them down? 30k lines is a lot.

@zanieb
Copy link
Member

zanieb commented Aug 9, 2024

Alternatively, we could have them in a separate repository and test them in a separate workflow than cargo test?

@BurntSushi
Copy link
Member Author

I love having ecosystem test for the universal resolver!

Are there options to trim them down? 30k lines is a lot.

I can't think of one. You could compress them, but then you inhibit human readability.

@zanieb I'm not a huge fan of having them in a separate repo if we can avoid it, mostly because I think it's a big pain to have tests hosted elsewhere. Then any updates need multiple PRs. And we're already doing that for packse scenarios.

@BurntSushi BurntSushi force-pushed the ag/ecosystem branch 3 times, most recently from f45f561 to e5dff68 Compare August 12, 2024 19:12
BurntSushi and others added 6 commits August 13, 2024 09:33
We're going to want to use this in other places, so move it to 'common'.
Since it isn't used in all test modules, we do need to squash unused
lint warnings unfortunately.
This adds a new top-level directory with bare-bones directories for a
sampling of ecosystem projects. The idea is for each directory to have
enough that `uv lock` can run.

The point of these tests is to 1) ensure resolution works in common
cases and 2) track changes to resolutions (and the lock file) in real
world projects.

Unfortunately, it does look like in some cases, re-running `uv lock`
results in changes to the lock file. For those cases, I've disabled the
deterministic checking in exchange for getting the lock files tracked
in tests. I haven't investigated yet whether either of #5733 or #5887
fix the deterministic problem.

There is probably a better way to go about integrating ecosystem
projects. In particular, it would be really nice if there was a good
flow for upgrading ecosystem packages to their latest version. The main
complexity is that some projects require edits to their `pyproject.toml`
(or a complete migration from non-`pyproject.toml` to `pyproject.toml`).
Although, the projects added here in this initial set were limited to
those that didn't require any changes.
There are some epic simplifications here.
It takes too long otherwise. ¯\_(ツ)_/¯
So that we're a bit more dynamic about whether we run them or not.
@BurntSushi BurntSushi added the testing Internal testing of behavior label Aug 13, 2024
@BurntSushi BurntSushi merged commit 8dbf43c into main Aug 13, 2024
57 checks passed
@BurntSushi BurntSushi deleted the ag/ecosystem branch August 13, 2024 13:48
BurntSushi added a commit that referenced this pull request Aug 13, 2024
I didn't mean to commit these in #5970.
BurntSushi added a commit that referenced this pull request Aug 13, 2024
I didn't mean to commit these in #5970.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Internal testing of behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants