You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ad73342
Browse filesBrowse the repository at this point in the historyBrowse files
This directory contains the comprehensive test suite for the Rhiza project.
3
+
This directory is **synced from [jebel-quant/rhiza](https://github.com/jebel-quant/rhiza)**
4
+
and runs in your project with `make rhiza-test`. Its job is to validate the parts of *your*
5
+
repository that Rhiza cares about — the metadata, release config, docs and docstrings that
6
+
vary per project — using the shared fixtures below.
4
7
5
-
## Test Organization
8
+
> Tests that only exercise Rhiza's *own* template files (Makefile targets, workflow stubs,
9
+
> the project skeleton) live in Rhiza's mother-repo `tests/` suite and are **not** synced
10
+
> here — they would be identical in every consumer and can't be changed downstream. Put
11
+
> your project's own tests under your `tests/` directory, not here.
6
12
7
-
Tests are organized into purpose-driven subdirectories:
13
+
## Layout
8
14
9
-
### `structure/`
10
-
Static assertions about file and directory presence. These tests verify that the repository contains the expected files, directories, and configuration structure without executing any subprocesses.
15
+
The suite is flat — one file per concern — but **which files you get depends on the
16
+
bundles you sync**. Each is owned by whichever bundle the assertion belongs to, so a Rust
17
+
project gets the Rust manifest checks and none of the Python ones:
11
18
12
-
-`test_project_layout.py` — Validates root-level files and directories
### Skipping README code blocks with `+RHIZA_SKIP`
21
34
22
-
### `integration/`
23
-
Tests requiring sandboxed git repositories or subprocess execution. These tests verify end-to-end workflows.
24
-
25
-
-`test_release.py` — Release script functionality
26
-
-`test_book_targets.py` — Documentation book build targets
27
-
28
-
### `sync/`
29
-
Template sync, workflows, versioning, and content validation tests. These tests ensure that template synchronization and content validation work correctly.
30
-
31
-
-`test_rhiza_version.py` — Version reading and workflow validation
32
-
-`test_readme_validation.py` — README code block execution and validation
33
-
-`test_docstrings.py` — Doctest validation across source modules
34
-
35
-
#### Skipping README code blocks with `+RHIZA_SKIP`
36
-
37
-
By default, every `python` and `bash` code block in `README.md` is executed or
38
-
syntax-checked by `test_readme_validation.py`. To mark a block as intentionally
39
-
non-runnable (e.g. illustrative snippets or environment-specific commands), add
40
-
`+RHIZA_SKIP` to the opening fence line:
35
+
By default, every `bash` fence in `README.md` is syntax-checked (`test_readme.py`, any
36
+
language) and every `python` fence is executed (`test_readme_validation.py`, Python
37
+
projects). To mark a block as intentionally non-runnable — an illustrative snippet, an
38
+
environment-specific command — add `+RHIZA_SKIP` to the opening fence line:
41
39
42
40
~~~markdown
43
41
```python +RHIZA_SKIP
@@ -56,114 +54,28 @@ Markdown renderers (including GitHub) ignore everything after the first word on
56
54
a fence line, so the block still renders as a normal highlighted code block.
57
55
Blocks without `+RHIZA_SKIP` continue to be validated as before.
58
56
59
-
### `utils/`
60
-
Tests for utility code and test infrastructure. These tests validate the testing framework itself and utility scripts.
61
-
62
-
-`test_git_repo_fixture.py` — Validates the `git_repo` fixture
63
-
64
-
### `deps/`
65
-
Dependency validation tests. These tests ensure that project dependencies are correctly specified and healthy.
66
-
67
-
-`test_dependency_health.py` — Validates pyproject.toml and requirements files
68
-
69
-
### `stress/`
70
-
Stress tests that verify Rhiza's stability under heavy load. These tests execute Rhiza-specific operations under concurrent load and repeated execution to detect race conditions, resource leaks, and performance degradation.
71
-
72
-
-`test_makefile_stress.py` — Makefile operations under concurrent/repeated load
73
-
-`test_git_stress.py` — Git operations under concurrent load
74
-
75
-
See [stress/README.md](stress/README.md) for detailed documentation.
76
-
77
57
## Running Tests
78
58
79
-
### Run all tests
80
-
```bash
81
-
uv run pytest .rhiza/tests/
82
-
# or
83
-
make test
84
-
```
85
-
86
-
### Run tests from a specific category
87
-
```bash
88
-
uv run pytest .rhiza/tests/structure/
89
-
uv run pytest .rhiza/tests/api/
90
-
uv run pytest .rhiza/tests/integration/
91
-
uv run pytest .rhiza/tests/sync/
92
-
uv run pytest .rhiza/tests/utils/
93
-
uv run pytest .rhiza/tests/deps/
94
-
uv run pytest .rhiza/tests/stress/
95
-
```
96
-
97
-
### Run stress tests with custom parameters
98
-
```bash
99
-
# Run all stress tests (default: 100 iterations, 10 workers)
100
-
uv run pytest .rhiza/tests/stress/ -v
101
-
102
-
# Run with fewer iterations (faster)
103
-
uv run pytest .rhiza/tests/stress/ -v --iterations=10
104
-
105
-
# Skip stress tests when running full test suite
106
-
uv run pytest .rhiza/tests/ -v -m "not stress"
107
-
```
108
-
109
-
### Run a specific test file
110
-
```bash
111
-
uv run pytest .rhiza/tests/structure/test_project_layout.py
112
-
```
113
-
114
-
### Run with verbose output
115
-
```bash
116
-
uv run pytest .rhiza/tests/ -v
117
-
```
118
-
119
-
### Run with coverage
120
59
```bash
121
-
uv run pytest .rhiza/tests/ --cov
60
+
make rhiza-test # run this suite (the usual entry point)
61
+
uv run pytest .rhiza/tests/ # equivalent, direct invocation
62
+
uv run pytest .rhiza/tests/test_pyproject.py # a single file
0 commit comments