Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
d2ac198
Update yscope-dev-utils
sitaowang1998 Jul 15, 2025
cc8a097
Use boost install task
sitaowang1998 Jul 15, 2025
7f68bdc
Update install task variable names
sitaowang1998 Jul 15, 2025
2394649
Set CMP0074 to NEW to find boost
sitaowang1998 Jul 15, 2025
6ff3e33
Add uv to install script
sitaowang1998 Jul 15, 2025
7ae8a78
Fix cpp-lint root paths
sitaowang1998 Jul 15, 2025
56502f9
Fix clang-tidy file pattern
sitaowang1998 Jul 15, 2025
6f6becf
Limit build parallelism
sitaowang1998 Jul 17, 2025
a74523d
Bug fix
sitaowang1998 Jul 17, 2025
2345d22
Merge branch 'dep-concurrency' into yscope-dev-utils
sitaowang1998 Jul 17, 2025
77ee494
Bug fix
sitaowang1998 Jul 17, 2025
38b86c8
Merge branch 'dep-concurrency' into yscope-dev-utils
sitaowang1998 Jul 17, 2025
3698339
Bug fix
sitaowang1998 Jul 17, 2025
369e9f1
Rename variables to mirror CLP core
sitaowang1998 Aug 4, 2025
90aa5a2
Rename variables to mirror clp core
sitaowang1998 Aug 4, 2025
1769c95
Merge branch 'dep-concurrency' of github.com:sitaowang1998/spider int…
sitaowang1998 Aug 4, 2025
edaa834
Merge branch 'dep-concurrency' into yscope-dev-utils
sitaowang1998 Aug 4, 2025
7faac8f
Revert "Merge branch 'dep-concurrency' of github.com:sitaowang1998/sp…
sitaowang1998 Aug 4, 2025
f494a90
Add comment for deps parallelism default value
sitaowang1998 Aug 4, 2025
eb01bb2
Merge branch 'dep-concurrency' into yscope-dev-utils
sitaowang1998 Aug 4, 2025
ff2fe1c
Update yscope-dev-utils
sitaowang1998 Aug 4, 2025
d476e42
Merge branch 'main' into yscope-dev-utils
sitaowang1998 Aug 4, 2025
850126d
Merge branch 'yscope-dev-utils' into python_lint
sitaowang1998 Aug 4, 2025
65841a0
Add latest python lint config files
sitaowang1998 Aug 4, 2025
8564fc2
Update ruff lint tasks
sitaowang1998 Aug 4, 2025
a6e7d29
Fix ruff lint
sitaowang1998 Aug 4, 2025
573b448
Fix ruff lint
sitaowang1998 Aug 4, 2025
6ad72c3
Bug fix
sitaowang1998 Aug 4, 2025
ba7c6e5
Fix ruff
sitaowang1998 Aug 4, 2025
209acb1
Fix ruff
sitaowang1998 Aug 4, 2025
406b514
Reformat files
sitaowang1998 Aug 4, 2025
66892f5
Remove .inc from cpp linting
sitaowang1998 Aug 4, 2025
80f0a10
Merge branch 'yscope-dev-utils' into python_lint
sitaowang1998 Aug 4, 2025
3186a42
Add mypy and merge lint and test requirements.txt
sitaowang1998 Aug 4, 2025
0925938
Fix mysql connection type
sitaowang1998 Aug 4, 2025
6936a9b
Fix socket name type
sitaowang1998 Aug 4, 2025
7407090
Fix return type from db cursor
sitaowang1998 Aug 4, 2025
6a95b24
Fix db cursor return type
sitaowang1998 Aug 4, 2025
f29dcba
Fix mypy import untyped
sitaowang1998 Aug 4, 2025
453f209
Fix mypy and Popen
sitaowang1998 Aug 5, 2025
d1011c7
Fix generator type hint
sitaowang1998 Aug 5, 2025
a7dc642
Fix mypy
sitaowang1998 Aug 5, 2025
a7d92c2
Fix ruff
sitaowang1998 Aug 5, 2025
1c6213b
Simply socket return types.
sitaowang1998 Aug 5, 2025
0f13d07
Merge branch 'main' into python_lint
sitaowang1998 Aug 5, 2025
14d6326
Merge branch 'python_lint' into mypy_lint
sitaowang1998 Aug 5, 2025
55a727a
Add tombi lint tasks
sitaowang1998 Aug 5, 2025
c98fea1
Rename cpp build tasks
sitaowang1998 Aug 5, 2025
ef64454
Merge branch 'main' into mypy_lint
sitaowang1998 Aug 5, 2025
09ba8ad
Merge branch 'main' into tombi
sitaowang1998 Aug 5, 2025
4e7237e
Add basic python structure
sitaowang1998 Aug 5, 2025
1f944d0
Fix code structure
sitaowang1998 Aug 5, 2025
68992fc
Fix ruff lint
sitaowang1998 Aug 5, 2025
1127b22
Extend lint tasks to python directory
sitaowang1998 Aug 5, 2025
4c51c91
Add python build tasks
sitaowang1998 Aug 5, 2025
56878b2
Merge branch 'main' into mypy_lint
sitaowang1998 Aug 5, 2025
bb428c9
Merge branch 'mypy_lint' into tombi
sitaowang1998 Aug 5, 2025
944bd5e
Merge branch 'tombi' into build-task
sitaowang1998 Aug 5, 2025
d75bc15
Merge branch 'build-task' into python_structure
sitaowang1998 Aug 5, 2025
4b7eca2
Merge branch 'main' into tombi
sitaowang1998 Aug 5, 2025
8ddbda7
Merge branch 'tombi' into build-task
sitaowang1998 Aug 5, 2025
0d998ec
Merge branch 'build-task' into python_structure
sitaowang1998 Aug 5, 2025
6004d64
Fix yaml lint error
sitaowang1998 Aug 5, 2025
bcab5db
Fix tombi lint
sitaowang1998 Aug 5, 2025
a50d25a
Remove wrong mypy config
sitaowang1998 Aug 5, 2025
fbebb96
Fix typo and format file
sitaowang1998 Aug 5, 2025
0322bd5
Use typed msgpack and remove mypy config for msgpack from pyproject
sitaowang1998 Aug 6, 2025
2a08155
Update uv lock
sitaowang1998 Aug 6, 2025
0b62f73
Merge branch 'main' into tombi
sitaowang1998 Aug 6, 2025
7384158
Merge branch 'main' into build-task
sitaowang1998 Aug 6, 2025
70ef90a
Merge branch 'main' into python_structure
sitaowang1998 Aug 6, 2025
b09515c
Increase min version of tombi
sitaowang1998 Aug 6, 2025
bad9675
Merge branch 'tombi' into build-task
sitaowang1998 Aug 6, 2025
e009ff4
Merge branch 'tombi' into python_structure
sitaowang1998 Aug 6, 2025
a0407a7
Merge branch 'main' into tombi
sitaowang1998 Aug 6, 2025
aa9a8de
Merge branch 'tombi' into build-task
sitaowang1998 Aug 6, 2025
3c7e794
Merge branch 'tombi' into python_structure
sitaowang1998 Aug 6, 2025
b4d6576
Add uv in README
sitaowang1998 Aug 6, 2025
23f31cd
Merge branch 'main' into build-task
sitaowang1998 Aug 6, 2025
0167ac0
Merge branch 'build-task' into python_structure
sitaowang1998 Aug 6, 2025
f447614
Fix redenduncy caused by merge
sitaowang1998 Aug 6, 2025
a84de83
Merge branch 'build-task' into python_structure
sitaowang1998 Aug 6, 2025
2d1b6fc
Merge branch 'main' into python_structure
sitaowang1998 Aug 7, 2025
061d101
Merge branch 'main' into python_structure
sitaowang1998 Aug 7, 2025
de149ee
Add integral types
sitaowang1998 Aug 7, 2025
d332dbe
Revert "Add integral types"
sitaowang1998 Aug 7, 2025
8c27b16
Restructure under src/spider
sitaowang1998 Aug 8, 2025
95b98c8
Merge branch 'main' into python_structure
sitaowang1998 Aug 8, 2025
427dd6b
Merge branch 'main' into python_structure
sitaowang1998 Aug 8, 2025
74f31e2
Add pytest and basic test structure
sitaowang1998 Aug 8, 2025
7d95706
Add python test tasks
sitaowang1998 Aug 8, 2025
96b5324
Rename some cpp tests and add python tests to GH workflow and doc
sitaowang1998 Aug 8, 2025
14ea6fb
Don't create __pycache__ when running pytest
sitaowang1998 Aug 8, 2025
854cd11
Fix missing link
sitaowang1998 Aug 8, 2025
5565c9e
Merge branch 'python_structure' of github.com:sitaowang1998/spider in…
sitaowang1998 Aug 8, 2025
2504429
Merge branch 'python_structure' into python_test_setup
sitaowang1998 Aug 8, 2025
7ea4928
Use task env
sitaowang1998 Aug 8, 2025
01dd0c6
Fix task executor path
sitaowang1998 Aug 8, 2025
4cec09b
Merge branch 'python_structure' into python_test_setup
sitaowang1998 Aug 8, 2025
e022404
Merge branch 'main' into python_structure
sitaowang1998 Aug 8, 2025
8894b90
Merge branch 'main' into python_test_setup
sitaowang1998 Aug 8, 2025
7753153
Merge branch 'main' into python_structure
sitaowang1998 Aug 9, 2025
dd59915
Merge branch 'main' into python_test_setup
sitaowang1998 Aug 9, 2025
438f6e7
Remove unnecessary __init__.py files
sitaowang1998 Aug 9, 2025
2caad5d
Merge branch 'python_structure' into python_test_setup
sitaowang1998 Aug 9, 2025
50b2b25
Bug fix
sitaowang1998 Aug 9, 2025
a8c8641
Fix pytest
sitaowang1998 Aug 9, 2025
9f98695
Add spider-py directory
sitaowang1998 Aug 15, 2025
1cb5d36
Merge branch 'main' into python_test_setup
sitaowang1998 Aug 15, 2025
d88b530
Remove unused files and fix imports in tests
sitaowang1998 Aug 15, 2025
7c49001
Merge branch 'main' into python_test_setup
LinZhihao-723 Aug 19, 2025
ae1527d
Remove unnecessary spider-py check inside py task
sitaowang1998 Aug 19, 2025
2379489
Rename cpp unit test tasks
sitaowang1998 Aug 19, 2025
f83d347
Rename spider-py test task
sitaowang1998 Aug 19, 2025
e0b9a6a
Merge branch 'python_test_setup' of github.com:sitaowang1998/spider i…
sitaowang1998 Aug 19, 2025
25c2c19
Improve comment in task
sitaowang1998 Aug 19, 2025
2d43959
Merge branch 'python_test_setup' of github.com:sitaowang1998/spider i…
sitaowang1998 Aug 19, 2025
4ce3424
Update readme.
LinZhihao-723 Aug 19, 2025
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 .github/workflows/code-linting-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
python --version
tar --version
task --version
uv --version

- name: "Install project dependencies "
timeout-minutes: 10
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ jobs:
python --version
tar --version
task --version
uv --version
Comment thread
sitaowang1998 marked this conversation as resolved.

- name: "Install project dependencies "
timeout-minutes: 10
env:
SPIDER_DEPS_MAX_PARALLELISM_PER_TASK: "1"
run: "task deps:lib_install"

- run: "task test:non-storage-unit-tests"
- run: "task test:cpp-non-storage-unit-tests"

- run: "task test:spider-py-unit-tests"
17 changes: 9 additions & 8 deletions docs/src/dev-docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ require this storage backend.

You can use the following tasks to run the set of unit tests that's appropriate.

| Task | Description |
|-------------------------------|-------------------------------------------------------------------|
| `test:all` | Runs all unit tests. |
| `test:non-storage-unit-tests` | Runs all unit tests which don't require a storage backend to run. |
| `test:storage-unit-tests` | Runs all unit tests which require a storage backend to run. |
| Task | Description |
|-----------------------------------|-----------------------------------------------------------------------|
| `test:cpp-unit-tests` | Runs all C++ unit tests. |
| `test:cpp-non-storage-unit-tests` | Runs all C++ unit tests which don't require a storage backend to run. |
| `test:cpp-storage-unit-tests` | Runs all C++ unit tests which require a storage backend to run. |
| `test:spider-py-unit-tests` | Runs all spider-py unit tests. |

If any tests show error messages for the connection function below, revisit the
[setup section](#set-up-mysql-as-storage-backend) and verify that `cStorageUrl` was set correctly.
Expand All @@ -52,9 +53,9 @@ pull requests, and daily. Currently, it only runs unit tests that don't require

You can use the following tasks to run integration tests.

| Task | Description |
|-------------------------------|-------------------------------------------------------------------|
| `test:integration` | Runs all integration tests. |
| Task | Description |
|------------------------|---------------------------------|
| `test:cpp-integration` | Runs all C++ integration tests. |


[gh-workflow-unit-tests]: https://github.com/y-scope/spider/blob/main/.github/workflows/unit-tests.yaml
8 changes: 8 additions & 0 deletions python/spider-py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ task build:spider-py
The command above will generate both a `.tar.gz` and a `.whl` package in the `build/spider-py`
directory at the Spider project root.

## Testing

To run all unit tests:

```shell
task test:spider-py-unit-tests
```

## Linting

To run all linting checks:
Expand Down
12 changes: 12 additions & 0 deletions python/spider-py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spider_task_executor = "spider_py.task_executor.task_executor:main"
[dependency-groups]
dev = [
"mypy>=1.12.0",
"pytest>=8.4.1",
"ruff>=0.4.4",
]

Expand All @@ -33,6 +34,9 @@ pretty = true
show_error_code_links = true
show_error_context = true

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.ruff]
line-length = 100

Expand Down Expand Up @@ -63,3 +67,11 @@ ignore = [
"UP015", # Explicit open modes are helpful
]
isort.order-by-type = false

[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"INP001", # Allow implicit namespace package for tests
"S101", # Allow use of `assert` (security warning)
"S603", # Allow use of `subprocess.Popen` (security warning)
"T201", # Allow use of `print` (testing)
]
9 changes: 9 additions & 0 deletions python/spider-py/tests/core/test_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Test core task."""

from spider_py.core import Task


def test_task() -> None:
"""Tests task created is not None."""
task = Task()
assert task is not None
111 changes: 90 additions & 21 deletions python/spider-py/uv.lock

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions test-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ vars:
G_TEST_VENV_CHECKSUM_FILE: "{{.G_BUILD_DIR}}/test#venv.md5"

tasks:
non-storage-unit-tests:
cpp-non-storage-unit-tests:
deps:
- "build-unit-test"
cmds:
- "{{.G_UNIT_TEST_BINARY}} \"~[storage]\""

storage-unit-tests:
cpp-storage-unit-tests:
deps:
- "build-unit-test"
cmds:
- "{{.G_UNIT_TEST_BINARY}} \"[storage]\""

all:
cpp-unit-tests:
deps:
- "build-unit-test"
cmds:
Expand All @@ -31,7 +31,7 @@ tasks:
vars:
TARGETS: ["spider_task_executor", "unitTest", "worker_test"]

integration:
cpp-integration:
dir: "{{.G_BUILD_SPIDER_DIR}}"
deps:
- "venv"
Expand Down Expand Up @@ -76,3 +76,11 @@ tasks:
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]

spider-py-unit-tests:
dir: "{{.G_SRC_PYTHON_DIR}}"
env:
# Don't create __pycache__ directories in the source tree.
PYTHONDONTWRITEBYTECODE: "1"
cmds:
- "uv run pytest"
Comment on lines +80 to +86

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Python unit tests task: add pytest flags for signal/noise; verify uv availability in CI and docs

  • Optional: add -q -ra to make CI output concise yet informative.
  • Ensure uv is reliably installed in CI and documented for local use (docs mention the task but not the prerequisite).

Apply (optional) flags:

-      - "uv run pytest"
+      - "uv run pytest -q -ra"

Verification script to confirm uv installation steps exist and that G_SRC_PYTHON_DIR is defined:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Confirm tasks/workflows invoke uv and pytest"
rg -n -C2 -P '\buv\s+run\b|\buv\s+--version\b|\bpytest\b' . -g '!**/node_modules/**'

echo
echo "2) Search for uv installation steps in workflows"
rg -n -C2 -P '(astral-sh/setup-uv|pip\s+install\s+uv\b|curl\s+.*astral\.sh/uv/install)' .github/workflows -g '!**/node_modules/**' || {
  echo "WARN: No explicit uv installation step found in workflows."
}

echo
echo "3) Check that G_SRC_PYTHON_DIR is defined somewhere (Taskfiles, env, or includes)"
rg -n -C2 -P '\bG_SRC_PYTHON_DIR\b' . -g '!**/node_modules/**' || {
  echo "WARN: G_SRC_PYTHON_DIR not found—ensure it is defined in a parent Taskfile/vars."
}

Length of output: 10151


Add pytest flags; install uv CLI in CI and document prerequisite

  • test-tasks.yaml (around lines 84–86): add -q -ra to the pytest invocation
    -      - "uv run pytest"
    +      - "uv run pytest -q -ra"
  • .github/workflows/*: insert an Install uv CLI step before running tests, for example:
    - name: Install uv CLI
      run: pip install uv
  • README.md (or other setup docs): explicitly list uv CLI as a prerequisite for local development.

G_SRC_PYTHON_DIR is already defined in taskfile.yaml—no changes required there.

🤖 Prompt for AI Agents
In test-tasks.yaml around lines 80 to 86, the pytest invocation should include
the recommended flags and CI must ensure the uv CLI is available: change the
pytest command to include "-q -ra" (i.e., "uv run pytest -q -ra"); update your
GitHub workflow files to add a step before running tests that installs the uv
CLI (e.g., run "pip install uv"); and add a short note to README.md (or
development setup docs) listing "uv CLI" as a prerequisite for local development
and CI to ensure contributors know to install it.