-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathtesting.mdc
More file actions
58 lines (44 loc) · 1.43 KB
/
testing.mdc
File metadata and controls
58 lines (44 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
description: Validation and testing - VCR cassettes for HTTP snapshots
alwaysApply: false
---
# Validation & Testing
## Validation Flow
**If gdc-ruler MCP server is available**:
```
validate_python(path=".") # Full validation
validate_python(path=".", steps=["format", "lint"]) # Quick check
```
**Manual commands** (from workspace root):
```bash
make format-fix # ruff format + fix
make mypy # Type check (aliased as `make types`)
make test # pytest via tox (all Python versions)
```
**Scoped**:
```bash
TEST_ENVS=py312,py313 make test # Specific Python versions
ADD_ARGS="-k test_catalog" make test # Filter tests
RECREATE_ENVS=1 make test # Force tox rebuild
```
**CI-like**: `make test-ci` (Docker-based)
## VCR Cassettes (HTTP Snapshots)
**Purpose**: Record GoodData Cloud HTTP calls for reproducible tests.
**Update workflow** (when API changes):
```bash
docker-compose up # Start local GoodData Cloud
make remove-cassettes # Delete old fixtures
make test # Generates new cassettes
git add tests/**/fixtures/*.yaml
```
**Location**: `tests/**/fixtures/*.yaml`
## Test Pattern
```python
@vcr.use_cassette("tests/catalog/fixtures/test_workspace.yaml")
def test_get_workspace(sdk):
workspace = sdk.catalog_workspace.get_workspace("demo")
assert workspace.id == "demo"
```
## Dependencies
Required: technologies/python
Related: general/general