Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions libs/aitools/agents/hint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,3 +601,40 @@ func TestMaybeHint_InstalledLogsNothing(t *testing.T) {
MaybeHint(ctx, regularCmd(), noPluginRecorded)
assert.Empty(t, telemetry.BufferedEvents(ctx))
}

// writeProjectSkill creates a project-scoped Claude skill symlink.
func writeProjectSkill(t *testing.T, project, name string) {
canonical := filepath.Join(project, ".databricks", "aitools", "skills", name)
require.NoError(t, os.MkdirAll(canonical, 0o755))
link := filepath.Join(project, ".claude", "skills", name)
require.NoError(t, os.MkdirAll(filepath.Dir(link), 0o755))
rel, err := filepath.Rel(filepath.Dir(link), canonical)
require.NoError(t, err)
require.NoError(t, os.Symlink(rel, link))
}

func TestMaybeHint_ProjectSkillsInstalledSilent(t *testing.T) {
Comment thread
lennartkats-db marked this conversation as resolved.
Resolved
for _, tc := range []struct {
name string
// subdir is where the command runs, relative to the project root.
subdir string
}{
{name: "project root"},
{name: "repo subdirectory", subdir: "train"},
} {
t.Run(tc.name, func(t *testing.T) {
setClaudeAgent(t)
home := t.TempDir()
ctx, stderr := claudeCtx(t, home)
project := t.TempDir()
require.NoError(t, os.Mkdir(filepath.Join(project, ".git"), 0o755))
writeProjectSkill(t, project, "databricks-ai-runtime")
cwd := filepath.Join(project, tc.subdir)
require.NoError(t, os.MkdirAll(cwd, 0o755))
t.Chdir(cwd)

MaybeHint(ctx, regularCmd(), noPluginRecorded)
assert.Empty(t, stderr.String())
})
}
}
Loading