acc: replace DATABRICKS_TEST_SKIPLOCAL with DATABRICKS_TEST_SELECT_CHANGED=N - #6248
Merged
Conversation
Collaborator
Integration test reportCommit: 2fbf8e5
Top 6 slowest tests (at least 2 minutes):
|
andrewnester
approved these changes
Aug 13, 2026
denik
force-pushed
the
denik/skiplocal-withchanged
branch
from
August 24, 2026 09:12
0ef3939 to
c1e9691
Compare
denik
force-pushed
the
denik/skiplocal-withchanged
branch
from
September 1, 2026 15:26
3aa136a to
5af4fbf
Compare
denik
enabled auto-merge
September 4, 2026 09:20
…ANGED=N N is the number of changed tests to select, previously hardcoded at 50. Moved tests are now selected after added and modified ones, and the selection is logged at startup.
Keep the old name as an alias: it is what the eng-dev-ecosystem CI job dispatches.
local-select runs the same selection of changed tests locally against the testserver. TestInprocessMode is skipped under test selection: it asserts that two specific selftests ran, which does not hold when the selection excludes them.
A skip per test dir buried the run in ~1100 SKIP lines and hid the selection summary. local-select now runs plain `go test -v`, which shows the summary and the tests that ran.
A regenerated golden usually comes from a change elsewhere and lands on hundreds of dirs at once, which fills the quota and crowds out the tests the branch actually edits. Order is now added, changed fixture, changed output, moved.
Same rule the harness uses to split inputs from outputs, so a nested fixture such as subdir/outer.py is no longer mistaken for generated output.
Replace the four parallel maps with one map of a documented changedDir struct, pull the invariant-config and generated-file rules into named helpers, and rank by sorting once instead of concatenating four slices.
Scores instead of ranks, and the selection is now a real package rather
than test-only code, with a command to inspect what a change selects:
go run ./acceptance/internal/selection/cmd
go run ./acceptance/internal/selection/cmd acceptance/bundle/invariant/configs/job.yml.tmpl
A path given without a status prefix now takes the status git reports for it: added when git does not track it, modified otherwise. Each selected test is printed with the score it was picked by.
A dir that changed in several ways now outranks one that changed in a single way: new dir 5, changed fixtures 5, changed goldens 1, move 1. New and moved stay exclusive, and a move does not also count the renames of the files it brings along.
An added config adds a variant of every invariant dir, so it now scores 10 where changing an existing config scores 5. The companion setup scripts of a config only change how an existing variant runs, so they stay at 5.
Three fixes, all in the selection package: - Two changed invariant configs produced two INPUT_CONFIG filters for the same dir. The harness requires every filter to match, so every variant skipped and those dirs ran nothing while still filling the quota. Such a dir now runs all of its variants. This one predates the branch. - A dir that was both new and moved scored 6; new and moved are meant to be exclusive, and it now scores as new. - The command resolved a bare path with a path-scoped git diff, which cannot pair a rename and reports the destination as added, so a moved test ranked as new. It now reads one whole diff, which also drops two git processes per argument, and rejects a non-positive limit instead of panicking on a negative slice bound.
…test Two changed invariant configs produced two INPUT_CONFIG filters for the same dir, and the harness required every filter to match, so every variant skipped and those dirs ran nothing. The environment has one value per key, so filters sharing a key now mean any of them: two changed configs run the variants of both. This also makes ENVFILTER=INPUT_CONFIG=a,INPUT_CONFIG=b run both variants rather than none, and lets checkEnvFilters reuse one matcher. acceptance/selftest/selection prints what the selection command reports for a changed test, a new test, a regenerated golden, a moved test, a touched invariant config, and a new config alongside two touched ones.
A dir restricted to some of its variants printed them merged into one line, which read like a syntax of its own. Each variant is now its own line, named bundle/invariant/no_drift/INPUT_CONFIG=job.yml.tmpl.
Adding one invariant config marked the whole dir as new, so the variants of the configs that were merely changed scored as new too. A variant is now the unit of selection: it carries its own score, and only the new config's variant counts as new. The command prints each selected test as a name go test accepts, expanded from the variant matrix in the test's materialized config, so a line can be run as printed. It is built by the harness like the CLI is, because tests run with a sandboxed HOME that has no module cache.
The test built a tree of its own because a committed directory holding a file named "script" would be picked up as a test case. Pointing -root at the real tree instead drops that setup, exercises the real variant matrices, and prints names that name existing tests. The golden now moves when an invariant test dir or its matrix changes.
go build read the -buildvcs=false that Windows needs as a second package path, because it was appended after the one being built, and every Windows job failed on "malformed import path".
The command inferred the status of a bare path by running git itself. Now a bare path counts as modified, so the only thing that talks to git is the package, through the same call the test runner makes when the command is given no arguments at all.
go test reads a test name as a prefix, so the variants below the one the selection names do not need spelling out: a dir whose every variant runs is named by the dir alone, and an invariant test by its config. One line per selected test now, rather than one per variant of it.
DATABRICKS_TEST_SKIPLOCAL no longer exists.
To be reverted.
They were added to confirm that an added and a changed test are picked up by the local subset cells and by the cloud PR run, which they were.
Co-authored-by: Isaac
no_drift runs DMS both ways, so naming that one selected test now takes two names. Co-authored-by: Isaac
- The invariant dirs test.toml is hand-written, so changing it selects the dir. Only out.test.toml beside it is generated and still ignored. - A changed config no longer selects invariant dirs that do not run it: continue_293 runs 44 of the 58 configs, so it was selected with every variant skipped, spending the limit on a test that runs nothing. A deleted config is gone from every matrix, so this drops it too. - A rename now also selects the dir the file left, which lost an input. - Printed names are go test patterns, so every element is escaped and anchored: unanchored, no_drift also matched no_drift_extra, and DMS= also matched the DMS=true variant. - Only an identical rename is a pure move; a rename that rewrote the script, or a move that came with another change, is scored for the change as well. - Tests that score the same are ordered by name, so the limit cuts the same set whatever order the diff lists the changed files in. Co-authored-by: Isaac
variantIndex existed to read each test dir materialized config at most once. Only the five invariant dirs are ever probed, and the file is 2 KB, so the cache saved nothing measurable: with twelve changed configs it turns 60 read-and-parse operations into 5, and both forms run in 0.29s. The walk over 1197 test dirs in FindTestDirs dominates either way. Replacing the type and its method with a plain function also makes the call site say what it checks.
invariantConfigName cut the name at its first hyphen whenever it ended in .sh, to map a config setup or teardown script back to the config it belongs to. That is only correct while no config name contains a hyphen: for my-config.yml.tmpl the companion script cut down to "my", which does not end in .yml.tmpl, so the config was dropped and its tests were not selected. Trim the two suffixes that actually exist instead. The added test fails on the old logic, which selects nothing at all for such a config.
denik
force-pushed
the
denik/skiplocal-withchanged
branch
from
September 4, 2026 09:25
b57e09f to
2fbf8e5
Compare
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
DATABRICKS_TEST_SKIPLOCAL=withchangedbecomesDATABRICKS_TEST_SELECT_CHANGED=N, where N is the number of changed tests to select (was hardcoded at 50).acceptance/internal/selection, with a command to inspect what a change would run:go run ./acceptance/internal/selection/cmd [path...].acceptance/selftest/selectionrecords its output for the typical kinds of change.out*file 1, move 1. A regenerated golden lands on hundreds of dirs at once, so it must not crowd out the tests the branch actually edits.integration-short-skiplocalis renamed tocloud-selectand kept as an alias, since that is the name the eng-dev-ecosystem CI job dispatches../task local-selectruns the same selection locally against the testserver.Why
"skiplocal" stopped meaning anything after #6196 dropped the
Localknob — every acceptance test runs locally now, so the variable only selects the tests a branch touches.