Repository navigation
Run ruff via uv tool run in acceptance tests and install Pythons in bump-sdk-post - #7389
Open
janniklasrose wants to merge 2 commits into
Open
janniklasrose wants to merge 2 commits into
janniklasrose wants to merge 2 commits into
Conversation
…ump-sdk-post The acceptance harness required a `ruff` binary on PATH for every run, although only the pydabs check-formatting test uses it. The SDK bumper's image has uv but no ruff, so `test-update` there stopped at TestAccept/prerequisites and bumper PRs never refreshed goldens such as acceptance/help/output.txt (#7277). Run ruff through `uv tool run ruff@0.9.1` instead: the harness fetches that release into the uv cache before it turns on UV_OFFLINE, and the test script runs the same command offline from the cache. The prefetch lives in testAccept rather than the prerequisites subtest, which a -run filter for a test directory skips. Once the ruff check no longer stops it, test-update in the bumper hits the next gap: its image has only Python 3.12, while bundle tests pin 3.10 and one template matrix needs 3.9-3.13, and uv is offline during tests. Run install-pythons at the start of bump-sdk-post, as CI does in setup-build-environment, so a missing interpreter is not baked into the goldens as a uv error. Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 16 tests: regression=0 unreleased=0 coverage=16 failing=0
|
CI's setup-uv exports UV_CACHE_DIR, so the ruff prefetch filled that cache while the harness pinned test scripts to the HOME-derived default: every check-formatting variant failed with "ruff was not found in the cache". Ask uv for its cache directory (as getUVPythonInstallDir already does for the Python install dir) instead of deriving the default from HOME. Pass -q to uv in the check-formatting script: the first variant to build the tool environment for the test interpreter otherwise prints "Installed 1 package" to stderr, which the other variants do not. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: bc633bd
|
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
ruffbinary on PATH.RequireRuffbecomesPrefetchRuff, which runsuv tool run ruff@0.9.1 --versionso that release lands in the uv cache before the harness setsUV_OFFLINE. It runs in the test body rather than theprerequisitessubtest, because a-run TestAccept/<dir>filter skips that subtest.acceptance/bundle/templates/pydabs/check-formatting/script, the only test that uses ruff, runsuv tool run ruff@0.9.1 format ...offline from that cache. Its golden changes only in the two traced command lines.bump-sdk-postrunsinstall-pythonsbeforegenerate-checkandtest-update, the same way the cloud tasks (integration,cloud-select, ...) already depend on it.Why
The SDK bumper's image has uv and Python 3.12 but no ruff. The global ruff prerequisite made
test-updatestop atTestAccept/prerequisitesthere, before touching a single golden, andgenerate-clijson-postignores that error by design. That is why bumper PRs such as #7277 never refreshedacceptance/help/output.txtand a human had to add it by hand. Only one test directory (16 variants) ever ran ruff, and it does not run on DBR, so the suite-wide requirement was protecting one test at the cost of blocking the rest.Once ruff no longer stops it,
test-updatein the bumper hits the next gap: the acceptance tests run uv offline, bundle tests pinUV_PYTHON=3.10, andintegration_classicmatrixes 3.9 through 3.13. With only Python 3.12 present,uv venvfails with "No interpreter found for Python 3.10 ... uv is set to offline mode", and-updatewould bake that into dozens of goldens. CI avoids this by runninginstall-pythonsinsetup-build-environment;bump-sdk-postnow does the same.Whether the bumper pod can download the managed Pythons is not verified here. It reaches GitHub for cloning, which is where uv fetches them from; the next bumper PR will show it.
Follow-up: drop
RuffDownloaderfrominternal/testarchiveand theruff-actionstep fromsetup-build-environment. Both only existed to satisfy the global check.Tests
go test ./acceptance -run TestAccept/bundle/templates/pydabs/check-formattingpasses with a PATH that has uv but no ruff, mirroring the bumper image.go test ./acceptance -run '^TestAccept$/prerequisites'passes without ruff on PATH.uv tool run ruff@0.9.1hits the cache under the tests'UV_PYTHON=3.10pin after a prefetch done with a different interpreter.UV_OFFLINE=true,uv venvwithUV_PYTHON=3.10fails as quoted above../task lint-q,./task ws,go vet ./acceptance/...are clean.This pull request and its description were written by Isaac.