Repository navigation
Conversation
## Changes `task test-exp-aitools` now also runs the tests that depend on aitools but live outside the aitools directories: - Unit tests: adds the `cmd`, `cmd/apps`, `cmd/experimental`, `cmd/root` and `cmd/version` packages and the root package (`.`) to the `gotestsum` package list. - Acceptance tests: extends the `-run` pattern with `TestAccept/help$`, `TestAccept/cmd/version`, `TestAccept/quickstart`, `TestAccept/air/help`, `TestAccept/air/config-help` and `TestAccept/air/image-push`. The task's `sources:` stay the same. Comments in `Taskfile.yml` explain why each addition is there. ## Why CI uses the `sources:` of `test-exp-aitools` to decide which job to run. A change that touches only aitools code runs `test-exp-aitools` and skips the general `test` job. Some code outside the aitools directories still depends on aitools: - `cmd/root` runs aitools hooks on every command. - `cmd`, `cmd/apps` and `cmd/version` print aitools text, and the root package imports aitools. - The goldens for `help`, `cmd/version`, `quickstart` and `air` help contain aitools text. - `air/image-push` starts a child process with the aitools self-exec environment. So an aitools-only change could break these tests and still pass CI. Running them inside `test-exp-aitools` catches that on the PR. `cmd/air` unit tests are left out on purpose. The only aitools call there is already covered by the `air/image-push` golden, and its unit tests take over a minute without touching aitools. ## Tests - Ran `./task test-exp-aitools` locally with no `DATABRICKS_*` variables set. Both the unit and acceptance steps pass, and the new packages and goldens run. - Checked that every added `-run` prefix matches an existing directory under `acceptance/`. Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
Automated review at 71d96e4. Each finding was verified against the code.
No blocking issues found. 2 non-blocking comment(s) below.
This PR extends the test-exp-aitools task to run unit tests and acceptance goldens for packages outside the aitools directories that still depend on aitools at compile or output time. The change is well-motivated and the list of additions is reasonable. Two minor comment/consistency issues survive verification.
| - acceptance/experimental/aitools/** | ||
| - "{{.EMBED_SOURCES}}" | ||
| cmds: | ||
| # cmd/root runs aitools hooks on every command, cmd, cmd/apps and |
There was a problem hiding this comment.
[nit] The comment lists every added package and explicitly justifies excluding cmd/air, but ./cmd/experimental (line 721) is silently included. It belongs here because cmd/experimental/experimental.go imports experimental/aitools/cmd—worth a short clause so a future reader doesn't wonder why it's there or remove it.
| --no-summary=skipped \ | ||
| --packages ./acceptance/... \ | ||
| -- -timeout=${LOCAL_TIMEOUT:-60m} -run "TestAccept/apps|TestAccept/cmd/aitools|TestAccept/experimental/aitools" | ||
| -- -timeout=${LOCAL_TIMEOUT:-60m} -run "TestAccept/apps|TestAccept/cmd/aitools|TestAccept/experimental/aitools|TestAccept/help$|TestAccept/cmd/version|TestAccept/quickstart|TestAccept/air/help|TestAccept/air/config-help|TestAccept/air/image-push" |
There was a problem hiding this comment.
[nit] TestAccept/help$ is correctly anchored with $, but the other new patterns (TestAccept/air/help, TestAccept/cmd/version, TestAccept/quickstart, etc.) are not. Go's -run is an unanchored regex, so TestAccept/air/help would also select a future TestAccept/air/help-debug. Either anchor all the new patterns with $ or drop the anchor on help so the style is consistent.
✅ Integration test reportCommit: 71d96e4
Top 4 slowest tests (at least 2 minutes):
|
Changes
task test-exp-aitoolsnow also runs the tests that depend on aitools but live outside the aitools directories:cmd,cmd/apps,cmd/experimental,cmd/rootandcmd/versionpackages and the root package (.) to thegotestsumpackage list.-runpattern withTestAccept/help$,TestAccept/cmd/version,TestAccept/quickstart,TestAccept/air/help,TestAccept/air/config-helpandTestAccept/air/image-push.The task's
sources:stay the same. Comments inTaskfile.ymlexplain why each addition is there.Why
CI uses the
sources:oftest-exp-aitoolsto decide which job to run. A change that touches only aitools code runstest-exp-aitoolsand skips the generaltestjob. Some code outside the aitools directories still depends on aitools:cmd/rootruns aitools hooks on every command.cmd,cmd/appsandcmd/versionprint aitools text, and the root package imports aitools.help,cmd/version,quickstartandairhelp contain aitools text.air/image-pushstarts a child process with the aitools self-exec environment.So an aitools-only change could break these tests and still pass CI. Running them inside
test-exp-aitoolscatches that on the PR.cmd/airunit tests are left out on purpose. The only aitools call there is already covered by theair/image-pushgolden, and its unit tests take over a minute without touching aitools.Tests
./task test-exp-aitoolslocally with noDATABRICKS_*variables set. Both the unit and acceptance steps pass, and the new packages and goldens run.-runprefix matches an existing directory underacceptance/.