Skip to content

Add acceptance tests for aitools list - #7161

Merged
rugpanov merged 5 commits into
mainfrom
aitools-list-acceptance
Oct 22, 2026
Merged

rugpanov merged 5 commits into
mainfrom
aitools-list-acceptance

Conversation

@rugpanov

@rugpanov rugpanov commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Add acceptance tests for databricks aitools list in acceptance/cmd/aitools/list/:
    • explicit-ref: DATABRICKS_SKILLS_REF is set. The CLI fetches only the skills manifest.
    • pinned: the compat entry pins 0.2.32. The CLI does not call the latest-release API.
    • latest: the compat entry is latest, and the API returns v0.2.33. The CLI lists the skills from that release.
    • latest-lookup-fails: the compat entry is latest, and the API returns 403. The command fails with resolve latest skills release: HTTP 403 fetching latest skills release.
  • The skills latest-release lookup now reads DATABRICKS_CLI_GITHUB_API_URL, the existing override from libs/versioncheck. versioncheck.GitHubAPIURL is now exported, and both lookups use it. versioncheck already owns this variable, so the helper stays there. The helper now also removes a trailing /.
  • The -run pattern of test-exp-aitools now uses top-level alternation and includes cmd/aitools. TestAccept/(apps|experimental/aitools) selected only apps, because go test does not split on a / inside parentheses. So a change in libs/aitools now runs the new tests, and the 10 experimental/aitools acceptance tests also run in this target now. The sources do not change: a change in acceptance/cmd/aitools still runs task test, which includes Windows.

Why

No acceptance test ran aitools list. The aitools acceptance tests set DATABRICKS_SKILLS_REF, so they never used the compat manifest or the latest-release lookup. Because of this, the CLI tests did not find the 1.22.0 regression from #7069. The VS Code unit tests found it in databricks/databricks-vscode#2269, and #7159 mitigates it.

The latest-lookup-fails output records the current behavior. When aitools list gets an embedded fallback, the test must change, and the diff shows the new behavior.

Each test copies a committed compat-manifest.json into DATABRICKS_CACHE_DIR. So the result does not depend on the embedded or the remote compat manifest. test.toml also sets DATABRICKS_SKILLS_REF, DATABRICKS_FORCE_EMBEDDED_COMPAT, and DATABRICKS_CACHE_ENABLED, so values from the shell do not change the result.

Tests

  • go test ./acceptance -run 'TestAccept/apps|TestAccept/cmd/aitools|TestAccept/experimental/aitools': all pass, also with DATABRICKS_SKILLS_REF=main and CLAUDE_CONFIG_DIR set in the shell.
  • go test ./libs/versioncheck/... ./libs/aitools/... ./cmd/aitools/... ./cmd/version/... ./libs/clicompat/..., with the new TestGitHubAPIURL (default, override, and trailing /).
  • golangci-lint on the changed packages: 0 issues.

Known limitations

  • The tests cover only aitools list. Plugin installs use the same lookup and have no acceptance test.
  • The JSON output keeps only release, skills, and summary, because agent detection depends on the binaries on PATH.
  • test-exp-aitools has no Windows runner. So a PR that changes only libs/aitools or cmd/aitools runs the new tests on Linux and macOS only.
  • DATABRICKS_CLI_GITHUB_API_URL now also redirects the skills lookup. A mirror that has only databricks/cli releases makes aitools list fail.

This pull request and its description were written by Isaac.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Commit: a5040503f | Workflow run

Regression test report

Selected 4 changed tests (limit=20, 0 not selected)

4 tests: regression=2 unreleased=0 coverage=2 failing=0

test branch main (66fce77) latest (v1.22.0)
TestAccept/cmd/aitools/list/explicit-ref ✅ ✅ ✅
TestAccept/cmd/aitools/list/latest ✅ ❌ ❌
TestAccept/cmd/aitools/list/latest-lookup-fails ✅ ❌ ❌
TestAccept/cmd/aitools/list/pinned ✅ ✅ ✅
TestAccept/cmd/aitools/list/latest: branch ✅ | main (66fce77) ❌ | latest (v1.22.0) ❌

main (66fce77):

acceptance_test.go:1204: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:37193" ("[DATABRICKS_HOST]")
    acceptance_test.go:1204: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:37193" ("[DATABRICKS_HOST]")
    acceptance_test.go:1307: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1307
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1077
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:637
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] aitools list --output json\n{\n  \"release\": \"0.2.33\",\n  \"skills\": [\n    {\n      \"name\": \"test-skill\",\n      \"latest_version\": \"1.0.0\",\n      \"experimental\": false,\n      \"installed\": {}\n    }\n  ],\n  \"summary\": {\n    \"global\": {\n      \"installed\": 0,\n      \"total\": 1\n    },\n    \"project\": {\n      \"installed\": 0,\n      \"total\": 1\n    }\n  }\n}\n\n=== The latest-release lookup picks the manifest version\n\n>>> print_requests.py --get\n{\n  \"method\": \"GET\",\n  \"path\": \"/repos/databricks/databricks-agent-skills/releases/latest\"\n}\n{\n  \"method\": \"GET\",\n  \"path\": \"/v0.2.33/manifest.json\"\n}\n"
        	            	actual  : "\n>>> [CLI] aitools list --output json\nError: resolve latest skills release: Get \"https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest\": Bad Request\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,35 +2,5 @@
        	            	 >>> [CLI] aitools list --output json
        	            	-{
        	            	-  "release": "0.2.33",
        	            	-  "skills": [
        	            	-    {
        	            	-      "name": "test-skill",
        	            	-      "latest_version": "1.0.0",
        	            	-      "experimental": false,
        	            	-      "installed": {}
        	            	-    }
        	            	-  ],
        	            	-  "summary": {
        	            	-    "global": {
        	            	-      "installed": 0,
        	            	-      "total": 1
        	            	-    },
        	            	-    "project": {
        	            	-      "installed": 0,
        	            	-      "total": 1
        	            	-    }
        	            	-  }
        	            	-}
        	            	+Error: resolve latest skills release: Get "https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest": Bad Request
        	            	 
        	            	-=== The latest-release lookup picks the manifest version
        	            	+Exit code: 1
        	            	 
        	            	->>> print_requests.py --get
        	            	-{
        	            	-  "method": "GET",
        	            	-  "path": "/repos/databricks/databricks-agent-skills/releases/latest"
        	            	-}
        	            	-{
        	            	-  "method": "GET",
        	            	-  "path": "/v0.2.33/manifest.json"
        	            	-}
        	            	-
        	Test:       	TestAccept/cmd/aitools/list/latest
        	Messages:   	cmd/aitools/list/latest/output.txt vs /tmp/TestAcceptcmdaitoolslistlatest3594878385/002/output.txt
FAIL

latest (v1.22.0):

acceptance_test.go:1204: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:36253" ("[DATABRICKS_HOST]")
    acceptance_test.go:1204: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:36253" ("[DATABRICKS_HOST]")
    acceptance_test.go:1307: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1307
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1077
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:637
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] aitools list --output json\n{\n  \"release\": \"0.2.33\",\n  \"skills\": [\n    {\n      \"name\": \"test-skill\",\n      \"latest_version\": \"1.0.0\",\n      \"experimental\": false,\n      \"installed\": {}\n    }\n  ],\n  \"summary\": {\n    \"global\": {\n      \"installed\": 0,\n      \"total\": 1\n    },\n    \"project\": {\n      \"installed\": 0,\n      \"total\": 1\n    }\n  }\n}\n\n=== The latest-release lookup picks the manifest version\n\n>>> print_requests.py --get\n{\n  \"method\": \"GET\",\n  \"path\": \"/repos/databricks/databricks-agent-skills/releases/latest\"\n}\n{\n  \"method\": \"GET\",\n  \"path\": \"/v0.2.33/manifest.json\"\n}\n"
        	            	actual  : "\n>>> [CLI] aitools list --output json\nError: resolve latest skills release: Get \"https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest\": Bad Request\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,35 +2,5 @@
        	            	 >>> [CLI] aitools list --output json
        	            	-{
        	            	-  "release": "0.2.33",
        	            	-  "skills": [
        	            	-    {
        	            	-      "name": "test-skill",
        	            	-      "latest_version": "1.0.0",
        	            	-      "experimental": false,
        	            	-      "installed": {}
        	            	-    }
        	            	-  ],
        	            	-  "summary": {
        	            	-    "global": {
        	            	-      "installed": 0,
        	            	-      "total": 1
        	            	-    },
        	            	-    "project": {
        	            	-      "installed": 0,
        	            	-      "total": 1
        	            	-    }
        	            	-  }
        	            	-}
        	            	+Error: resolve latest skills release: Get "https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest": Bad Request
        	            	 
        	            	-=== The latest-release lookup picks the manifest version
        	            	+Exit code: 1
        	            	 
        	            	->>> print_requests.py --get
        	            	-{
        	            	-  "method": "GET",
        	            	-  "path": "/repos/databricks/databricks-agent-skills/releases/latest"
        	            	-}
        	            	-{
        	            	-  "method": "GET",
        	            	-  "path": "/v0.2.33/manifest.json"
        	            	-}
        	            	-
        	Test:       	TestAccept/cmd/aitools/list/latest
        	Messages:   	cmd/aitools/list/latest/output.txt vs /tmp/TestAcceptcmdaitoolslistlatest3607439583/002/output.txt
FAIL
TestAccept/cmd/aitools/list/latest-lookup-fails: branch ✅ | main (66fce77) ❌ | latest (v1.22.0) ❌

main (66fce77):

acceptance_test.go:1204: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:40621" ("[DATABRICKS_HOST]")
    acceptance_test.go:1204: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:40621" ("[DATABRICKS_HOST]")
    acceptance_test.go:1307: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1307
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1077
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:637
        	Error:      	Not equal: 
        	            	expected: "\n>>> musterr [CLI] aitools list --output json\nError: resolve latest skills release: HTTP 403 fetching latest skills release\n\n=== The lookup fails, so the manifest is never fetched\n\n>>> print_requests.py --get\n{\n  \"method\": \"GET\",\n  \"path\": \"/repos/databricks/databricks-agent-skills/releases/latest\"\n}\n"
        	            	actual  : "\n>>> musterr [CLI] aitools list --output json\nError: resolve latest skills release: Get \"https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest\": Bad Request\n\n=== The lookup fails, so the manifest is never fetched\n\n>>> print_requests.py --get\nFile [OUTPUT_DIR]/out.requests.txt not found\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,3 @@
        	            	 >>> musterr [CLI] aitools list --output json
        	            	-Error: resolve latest skills release: HTTP 403 fetching latest skills release
        	            	+Error: resolve latest skills release: Get "https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest": Bad Request
        	            	 
        	            	@@ -7,6 +7,5 @@
        	            	 >>> print_requests.py --get
        	            	-{
        	            	-  "method": "GET",
        	            	-  "path": "/repos/databricks/databricks-agent-skills/releases/latest"
        	            	-}
        	            	+File [OUTPUT_DIR]/out.requests.txt not found
        	            	 
        	            	+Exit code: 1
        	            	+
        	Test:       	TestAccept/cmd/aitools/list/latest-lookup-fails
        	Messages:   	cmd/aitools/list/latest-lookup-fails/output.txt vs /tmp/TestAcceptcmdaitoolslistlatest-lookup-fails913620206/002/output.txt

latest (v1.22.0):

acceptance_test.go:1204: Substituted DATABRICKS_CLI_GITHUB_API_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:42445" ("[DATABRICKS_HOST]")
    acceptance_test.go:1204: Substituted DATABRICKS_SKILLS_BASE_URL "$DATABRICKS_HOST" -> "http://127.0.0.1:42445" ("[DATABRICKS_HOST]")
    acceptance_test.go:1307: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1307
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1077
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:637
        	Error:      	Not equal: 
        	            	expected: "\n>>> musterr [CLI] aitools list --output json\nError: resolve latest skills release: HTTP 403 fetching latest skills release\n\n=== The lookup fails, so the manifest is never fetched\n\n>>> print_requests.py --get\n{\n  \"method\": \"GET\",\n  \"path\": \"/repos/databricks/databricks-agent-skills/releases/latest\"\n}\n"
        	            	actual  : "\n>>> musterr [CLI] aitools list --output json\nError: resolve latest skills release: Get \"https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest\": Bad Request\n\n=== The lookup fails, so the manifest is never fetched\n\n>>> print_requests.py --get\nFile [OUTPUT_DIR]/out.requests.txt not found\n\nExit code: 1\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,3 @@
        	            	 >>> musterr [CLI] aitools list --output json
        	            	-Error: resolve latest skills release: HTTP 403 fetching latest skills release
        	            	+Error: resolve latest skills release: Get "https://api.github.com/repos/databricks/databricks-agent-skills/releases/latest": Bad Request
        	            	 
        	            	@@ -7,6 +7,5 @@
        	            	 >>> print_requests.py --get
        	            	-{
        	            	-  "method": "GET",
        	            	-  "path": "/repos/databricks/databricks-agent-skills/releases/latest"
        	            	-}
        	            	+File [OUTPUT_DIR]/out.requests.txt not found
        	            	 
        	            	+Exit code: 1
        	            	+
        	Test:       	TestAccept/cmd/aitools/list/latest-lookup-fails
        	Messages:   	cmd/aitools/list/latest-lookup-fails/output.txt vs /tmp/TestAcceptcmdaitoolslistlatest-lookup-fails3473655546/002/output.txt

rugpanov and others added 5 commits October 22, 2026 14:07
No acceptance test ran `aitools list`, and the aitools tests set
DATABRICKS_SKILLS_REF, so the compat manifest and the latest skills
release lookup were never covered. Add DATABRICKS_SKILLS_API_URL so the
test server can replace api.github.com, and cover an explicit ref, a
pinned compat entry, latest with a successful lookup, and latest with a
403 from the lookup.

Co-authored-by: Isaac <no-reply@databricks.com>
- Reuse DATABRICKS_CLI_GITHUB_API_URL (from libs/versioncheck) for the
  latest skills release lookup instead of a new env var, and drop the
  unit test that only covered the new var.
- Run acceptance/cmd/aitools in the test-exp-aitools CI target.
- Commit the compat manifests, move shared setup and the jq allow-list
  (now with summary) to script.prepare, and serve the skills manifest
  from one {ref} stub.
- Assert the lookup failure with musterr, and pin the compat cache
  settings so the shell environment does not change the result.

Co-authored-by: Isaac <no-reply@databricks.com>
- Export versioncheck.GitHubAPIURL and use it for the skills release
  lookup, so DATABRICKS_CLI_GITHUB_API_URL behaves the same for both.
- Use top-level alternation in the test-exp-aitools pattern; the
  parenthesized form selected only TestAccept/apps.
- Clear DATABRICKS_SKILLS_REF in the list tests, drop the unused
  ~/.claude setup, and explain why the lookup failure is expected.

Co-authored-by: Isaac <no-reply@databricks.com>
- GitHubAPIURL removes a trailing slash, and its doc comment names the
  env var; keep the original gitHubAPIURLEnv comment.
- Keep acceptance/cmd/aitools out of test-exp-aitools sources, so a
  change there still runs task test on Windows.
- Drop the text-output step in explicit-ref (agent config env vars can
  change it) and the setup_list_test wrapper, and fix comments.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov force-pushed the aitools-list-acceptance branch from 4aebbe8 to a504050 Compare October 22, 2026 12:08
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: a504050

Run: 39776018870

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 281 19 5:45
✅​ aws-windows-latest-4core-16gb 283 17 3:24
✅​ azure linux-2core-8gb 280 19 4:00
✅​ azure-windows-latest-4core-16gb 282 17 3:31
✅​ gcp linux-2core-8gb 281 19 3:59
✅​ gcp-windows-latest-4core-16gb 283 17 3:09
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:03 gcp-windows-latest-4core-16gb TestAccept
3:03 aws-windows-latest-4core-16gb TestAccept
2:58 azure-windows-latest-4core-16gb TestAccept

@rugpanov
rugpanov marked this pull request as ready for review October 22, 2026 12:54
@rugpanov
rugpanov requested review from a team and lennartkats-db as code owners October 22, 2026 12:54
@rugpanov
rugpanov added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 109f434 Oct 22, 2026
59 of 61 checks passed
@rugpanov
rugpanov deleted the aitools-list-acceptance branch October 22, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants