Skip to content

Commit f7a978c

Browse files
Bill-hbrhbrquinntaylormitchellkirkrodrigues
authored
feat(integration-tests): Install CLP Python projects to enable their use in integration tests and fix new linting issues: (#1549)
* Add integration test to validate importing symbols from the projects. * Add a `py.typed` file to all uv projects so that they can be imported into projects that use `mypy`. * Install the native MariaDB Connector/C package which is now required in the `clp-lint` workflow. Co-authored-by: Quinn Taylor Mitchell <[email protected]> Co-authored-by: kirkrodrigues <[email protected]>
1 parent 0d87904 commit f7a978c

File tree

10 files changed

+2535
-101
lines changed

10 files changed

+2535
-101
lines changed

.github/workflows/clp-lint.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@ jobs:
4343
name: "Install coreutils (for md5sum)"
4444
run: "brew install coreutils"
4545

46+
# This is a necessary dependency for the Python mariadb package which is a transitive
47+
# dependency of `lint:py-check`.
48+
- name: "Install MariaDB Connector/C"
49+
shell: "bash"
50+
run: |-
51+
case "${{ matrix.os }}" in
52+
ubuntu-24.04)
53+
sudo apt-get update
54+
sudo apt-get install -y libmariadb-dev
55+
MARIADB_CONFIG_PATH="$(command -v mariadb_config)"
56+
;;
57+
macos-15)
58+
brew update
59+
brew install mariadb-connector-c
60+
PREFIX="$(brew --prefix mariadb-connector-c)"
61+
MARIADB_CONFIG_PATH="$PREFIX/bin/mariadb_config"
62+
;;
63+
*)
64+
# Control flow should not reach here
65+
exit 1
66+
;;
67+
esac
68+
echo "MARIADB_CONFIG=$MARIADB_CONFIG_PATH" >> "$GITHUB_ENV"
69+
4670
- name: "Lint .js files"
4771
shell: "bash"
4872
run: "task lint:check-js"

components/clp-mcp-server/clp_mcp_server/py.typed

Whitespace-only changes.

components/clp-package-utils/clp_package_utils/py.typed

Whitespace-only changes.

components/clp-py-utils/clp_py_utils/py.typed

Whitespace-only changes.

components/job-orchestration/job_orchestration/py.typed

Whitespace-only changes.

integration-tests/pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ requires = ["hatchling"]
1616
build-backend = "hatchling.build"
1717

1818
[dependency-groups]
19+
clp = [
20+
"clp-mcp-server",
21+
"clp-package-utils",
22+
"clp-py-utils",
23+
"job-orchestration",
24+
]
1925
dev = [
2026
"mypy>=1.16.0",
2127
"ruff>=0.11.12",
@@ -69,3 +75,12 @@ isort.order-by-type = false
6975
[tool.ruff.format]
7076
docstring-code-format = true
7177
docstring-code-line-length = 100
78+
79+
[tool.uv]
80+
default-groups = ["clp", "dev"]
81+
82+
[tool.uv.sources]
83+
clp-mcp-server = { path = "../components/clp-mcp-server" }
84+
clp-package-utils = { path = "../components/clp-package-utils" }
85+
clp-py-utils = { path = "../components/clp-py-utils" }
86+
job-orchestration = { path = "../components/job-orchestration" }

integration-tests/src/integration_tests/py.typed

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Smoke tests to validate that CLP Python projects can be imported without errors."""
2+
3+
from clp_mcp_server.constants import QueryJobType
4+
from clp_package_utils.general import JobType
5+
from clp_py_utils.clp_config import StorageEngine
6+
from job_orchestration.scheduler.constants import CompressionJobStatus
7+
8+
9+
def test_clp_native_py_project_enum_classes() -> None:
10+
"""
11+
Verifies that the following CLP Python projects can be imported successfully by testing
12+
conversions between their representative enum classes and literal values:
13+
14+
- clp-mcp-server
15+
- clp-package-utils
16+
- clp-py-utils
17+
- job-orchestration
18+
"""
19+
assert QueryJobType.SEARCH_OR_AGGREGATION == QueryJobType(0)
20+
assert JobType.COMPRESSION == JobType("compression")
21+
assert StorageEngine.CLP == StorageEngine("clp")
22+
assert CompressionJobStatus.PENDING == CompressionJobStatus(0)

integration-tests/uv.lock

Lines changed: 2469 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

taskfiles/tests/integration.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ vars:
66
tasks:
77
default:
88
deps:
9+
- task: "clp-py-project-imports"
910
- task: "core"
1011

1112
cache-clear:
@@ -24,3 +25,7 @@ tasks:
2425
CLP_CORE_BINS_DIR: "{{.G_CORE_COMPONENT_BUILD_DIR}}"
2526
CLP_PACKAGE_DIR: "{{.G_PACKAGE_BUILD_DIR}}"
2627
cmd: "uv run python -m pytest -m core"
28+
29+
clp-py-project-imports:
30+
dir: "{{.G_INTEGRATION_TESTS_DIR}}"
31+
cmd: "uv run python -m pytest tests/test_clp_native_py_project_imports.py"

0 commit comments

Comments
 (0)