Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b587109
Replace MCP tools with CLI commands in agent-bricks, dashboards, and …
Apr 13, 2026
6906cbc
Replace MCP tools with CLI commands in databricks-genie skill
Apr 13, 2026
f2eed1b
Replace MCP tools with CLI commands in Lakebase skills
Apr 13, 2026
cf5fcc0
Replace MCP tools with CLI commands in model-serving, unity-catalog, …
Apr 13, 2026
d35ae41
refactor(vector-search): replace MCP tools with CLI commands
Apr 13, 2026
29c85ac
refactor(spark-declarative-pipelines): replace MCP tools with CLI com…
Apr 13, 2026
b3aec73
refactor(skills): replace MCP tools with CLI/SQL across remaining skills
Apr 13, 2026
c77283a
refactor(model-serving): replace MCP tools with CLI commands
Apr 13, 2026
e568f0e
Replace MCP tool references with CLI/SDK across remaining skills
Apr 13, 2026
5eb654b
test(skills): add integration test infrastructure for databricks-skills
Apr 13, 2026
e261a4a
refactor(agent-bricks): rename manager.py to mas_manager.py and add e…
Apr 13, 2026
5444dfa
Add installation instructions to PDF generation skill
Apr 13, 2026
e043537
Make skills self-contained without core dependencies
Apr 13, 2026
7b3a1cd
Remove MCP server and tools-core, simplify to skills-only approach
Apr 13, 2026
0600cd1
Move skill Python scripts to scripts/ subfolders
Apr 13, 2026
4252440
Add CLI syntax patterns to prevent common errors
Apr 13, 2026
c95184c
Fix CLI syntax: use --json for UC object creation
Apr 13, 2026
25b1c88
Remove DatabricksEnv references - use standard DatabricksSession
Apr 13, 2026
a9b3081
Update synthetic data skill to use CLI SQL for validation
Apr 13, 2026
e6eb1c4
Fix pdf_generator import path to use scripts/ folder
Apr 13, 2026
5160079
Simplify PDF skill to use CLI pattern
Apr 13, 2026
d9ea637
Document Genie serialized_space format requirements
Apr 14, 2026
cbedde2
Consolidate Genie skill: merge spaces.md into SKILL.md
Apr 14, 2026
41b3784
Add standalone compute.py script and consolidate Genie skill
Apr 14, 2026
4cab420
Improve AI/BI dashboard skill with CLI-based workflow
Apr 14, 2026
03fafcd
Streamline AI/BI dashboard skill based on real usage testing
Apr 14, 2026
5aaf71c
Add testing section to skills README
Apr 14, 2026
13146da
Fix Knowledge Assistant skill CLI examples and add Quick Reference
Apr 14, 2026
42bdcf6
Improve Supervisor Agent skill documentation
Apr 14, 2026
7073d7a
Restructure Agent Bricks skill - remove redundancy
Apr 14, 2026
e3eaa61
Fix SDP skill: CLI syntax and library type issues
Apr 14, 2026
39c8dfa
Refactor PDF generator and fix CLI commands across skills
Apr 14, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ claude_agent_settings.json
.coverage
htmlcov/
.pytest_cache/
.test-results/

# Skill test run results (detailed per-task logs with full responses)
.test/skills/*/runs/
Expand Down
245 changes: 245 additions & 0 deletions .test/tests/integration/test_compute.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
"""Integration tests for compute.py CLI script.

Tests actual subprocess execution of the compute CLI script.
"""
import json
import subprocess
import sys
from pathlib import Path

import pytest

# Get repo root for running scripts
_repo_root = Path(__file__).resolve().parents[3]
_compute_script = _repo_root / "databricks-skills" / "databricks-execution-compute" / "scripts" / "compute.py"


class TestComputeScriptHelp:
"""Test compute.py help and basic CLI structure."""

def test_script_shows_help(self):
"""Verify script has help output."""
result = subprocess.run(
[sys.executable, str(_compute_script), "--help"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=10
)

assert result.returncode == 0
assert "execute-code" in result.stdout
assert "list-compute" in result.stdout
assert "manage-cluster" in result.stdout

def test_execute_code_help(self):
"""Verify execute-code subcommand help."""
result = subprocess.run(
[sys.executable, str(_compute_script), "execute-code", "--help"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=10
)

assert result.returncode == 0
assert "--code" in result.stdout
assert "--compute-type" in result.stdout

def test_list_compute_help(self):
"""Verify list-compute subcommand help."""
result = subprocess.run(
[sys.executable, str(_compute_script), "list-compute", "--help"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=10
)

assert result.returncode == 0
assert "--resource" in result.stdout

def test_manage_cluster_help(self):
"""Verify manage-cluster subcommand help."""
result = subprocess.run(
[sys.executable, str(_compute_script), "manage-cluster", "--help"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=10
)

assert result.returncode == 0
assert "--action" in result.stdout


@pytest.mark.integration
class TestListCompute:
"""Tests for list-compute command."""

def test_list_clusters(self):
"""Should list all clusters."""
result = subprocess.run(
[sys.executable, str(_compute_script), "list-compute", "--resource", "clusters"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=60
)

try:
output = json.loads(result.stdout)
assert "clusters" in output
assert isinstance(output["clusters"], list)
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")

def test_list_node_types(self):
"""Should list available node types."""
result = subprocess.run(
[sys.executable, str(_compute_script), "list-compute", "--resource", "node_types"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=60
)

try:
output = json.loads(result.stdout)
assert "node_types" in output
assert isinstance(output["node_types"], list)
assert len(output["node_types"]) > 0
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")

def test_list_spark_versions(self):
"""Should list available Spark versions."""
result = subprocess.run(
[sys.executable, str(_compute_script), "list-compute", "--resource", "spark_versions"],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=60
)

try:
output = json.loads(result.stdout)
assert "spark_versions" in output
assert isinstance(output["spark_versions"], list)
assert len(output["spark_versions"]) > 0
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")


@pytest.mark.integration
class TestExecuteCode:
"""Tests for execute-code command."""

def test_execute_serverless_simple(self):
"""Test simple Python execution on serverless."""
code = 'print("Hello from compute test"); dbutils.notebook.exit("success")'

result = subprocess.run(
[
sys.executable, str(_compute_script),
"execute-code",
"--code", code,
"--compute-type", "serverless",
"--timeout", "180"
],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=300 # 5 min for cold start
)

try:
output = json.loads(result.stdout)
assert output.get("success", False), f"Execution failed: {output}"
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")

def test_execute_requires_code_or_file(self):
"""Should return error when neither code nor file provided."""
result = subprocess.run(
[
sys.executable, str(_compute_script),
"execute-code",
"--compute-type", "serverless"
],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=30
)

try:
output = json.loads(result.stdout)
assert output.get("success") is False
assert "error" in output
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")


@pytest.mark.integration
class TestManageCluster:
"""Tests for manage-cluster command (read-only operations)."""

def test_invalid_action(self):
"""Should return error for invalid action."""
result = subprocess.run(
[
sys.executable, str(_compute_script),
"manage-cluster",
"--action", "invalid_action"
],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=30
)

# argparse will fail with invalid choice
assert result.returncode != 0 or "error" in result.stdout.lower()

def test_get_requires_cluster_id(self):
"""Should return error when cluster_id not provided for get."""
result = subprocess.run(
[
sys.executable, str(_compute_script),
"manage-cluster",
"--action", "get"
],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=30
)

try:
output = json.loads(result.stdout)
assert output.get("success") is False
assert "error" in output
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")

def test_create_requires_name(self):
"""Should return error when name not provided for create."""
result = subprocess.run(
[
sys.executable, str(_compute_script),
"manage-cluster",
"--action", "create"
],
capture_output=True,
text=True,
cwd=str(_repo_root),
timeout=30
)

try:
output = json.loads(result.stdout)
assert output.get("success") is False
assert "error" in output
except json.JSONDecodeError:
pytest.fail(f"Invalid JSON: {result.stdout}\nStderr: {result.stderr}")
Loading