-
Notifications
You must be signed in to change notification settings - Fork 4.1k
lint: apply tests only to the changed packages #42642
Copy link
Copy link
Open
Labels
A-build-systemA-lintersA-testingTesting tools and infrastructureTesting tools and infrastructureC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)S-3-productivitySevere issues that impede the productivity of CockroachDB developers.Severe issues that impede the productivity of CockroachDB developers.T-dev-infX-nostaleMarks an issue/pr that should be ignored by the stale botMarks an issue/pr that should be ignored by the stale bot
Metadata
Metadata
Assignees
Labels
A-build-systemA-lintersA-testingTesting tools and infrastructureTesting tools and infrastructureC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)S-3-productivitySevere issues that impede the productivity of CockroachDB developers.Severe issues that impede the productivity of CockroachDB developers.T-dev-infX-nostaleMarks an issue/pr that should be ignored by the stale botMarks an issue/pr that should be ignored by the stale bot
We have a bunch of lint tests that operate on the entire repo on every CI run, although they do not need whole-program analysis. They could be specialized to run only on those Go packages that were modified in the current PR, like we already do for the
testraceCI target (see the code inbuild/teamcity-testrace.sh).For example the following can be specialized:
greptests (TestSyncutil, etc)fmttests (TestGofmt,TestCrlfmt)TestVet/shadowroachlintmoduleshash,timerThen there are checks about how functions are used in other contexts, for these we need to check the callers even if only the function itself was modified. However, the checks do not need to cascade: we only need to check the packages that have a modified package as direct import:
TestReturnCheckTestErrCheckTestVetchecksroachlintmodulesunconvert,descriptormarshalFinally there are some tests that do most of their "useful" work on a whole program analysis, but that can still benefit from a partial analysis on just a sub-module. For example
staticcheckfalls in this category. For this category, we could have two different CI targets, one that runs nightly on the entire repo and one in CI for just the changed packages.Given that the bulk of the execution time of
make lintis (currently) in the first two categories above, major run time improvements can be reached by working on this issue.Epic CRDB-10439
Jira issue: CRDB-5338