-
Notifications
You must be signed in to change notification settings - Fork 12
feat(test): Add pytest and unit test structure for spider-py; Rename existing C++ test tasks. #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d2ac198
cc8a097
7f68bdc
2394649
6ff3e33
7ae8a78
56502f9
6f6becf
a74523d
2345d22
77ee494
38b86c8
3698339
369e9f1
90aa5a2
1769c95
edaa834
7faac8f
f494a90
eb01bb2
ff2fe1c
d476e42
850126d
65841a0
8564fc2
a6e7d29
573b448
6ad72c3
ba7c6e5
209acb1
406b514
66892f5
80f0a10
3186a42
0925938
6936a9b
7407090
6a95b24
f29dcba
453f209
d1011c7
a7dc642
a7d92c2
1c6213b
0f13d07
14d6326
55a727a
c98fea1
ef64454
09ba8ad
4e7237e
1f944d0
68992fc
1127b22
4c51c91
56878b2
bb428c9
944bd5e
d75bc15
4b7eca2
8ddbda7
0d998ec
6004d64
bcab5db
a50d25a
fbebb96
0322bd5
2a08155
0b62f73
7384158
70ef90a
b09515c
bad9675
e009ff4
a0407a7
aa9a8de
3c7e794
b4d6576
23f31cd
0167ac0
f447614
a84de83
2d1b6fc
061d101
de149ee
d332dbe
8c27b16
95b98c8
427dd6b
74f31e2
7d95706
96b5324
14ea6fb
854cd11
5565c9e
2504429
7ea4928
01dd0c6
4cec09b
e022404
8894b90
7753153
dd59915
438f6e7
2caad5d
50b2b25
a8c8641
9f98695
1cb5d36
d88b530
7c49001
ae1527d
2379489
f83d347
e0b9a6a
25c2c19
2d43959
4ce3424
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
|
@@ -31,7 +31,7 @@ tasks: | |
| vars: | ||
| TARGETS: ["spider_task_executor", "unitTest", "worker_test"] | ||
|
|
||
| integration: | ||
| cpp-integration: | ||
| dir: "{{.G_BUILD_SPIDER_DIR}}" | ||
| deps: | ||
| - "venv" | ||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainPython unit tests task: add pytest flags for signal/noise; verify uv availability in CI and docs
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
G_SRC_PYTHON_DIR is already defined in 🤖 Prompt for AI Agents |
||
Uh oh!
There was an error while loading. Please reload this page.