Skip to content

Commit e1d6fc4

Browse files
committed
docs
1 parent ce20f37 commit e1d6fc4

File tree

9 files changed

+145
-26
lines changed

9 files changed

+145
-26
lines changed

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Unified Cassandra control interface for tests (`CassandraControl`)
12+
- CI environment detection for test skipping
13+
- Support for both Docker and Podman in all test fixtures
14+
- Consistent container naming across all test suites
15+
- Production-like Cassandra configuration with GossipingPropertyFileSnitch
16+
17+
### Changed
18+
- Updated all Cassandra container configurations to use 4GB memory and 3GB heap
19+
- Refactored integration test fixtures to use shared clusters
20+
- Updated documentation to reflect protocol v5 as highest supported version
21+
- Standardized on Cassandra 5 across all examples and tests
22+
- Fixed mock future callbacks to use `asyncio.get_running_loop().call_soon()`
23+
24+
### Fixed
25+
- Integration tests hanging due to improper async mock callbacks
26+
- "Cluster is already shut down" errors in integration tests
27+
- IPv6 connection issues by forcing IPv4 (127.0.0.1)
28+
- BDD FastAPI reconnection tests not properly isolating test data
29+
- "Cannot schedule new futures after shutdown" errors
30+
- CI test failures when trying to control Cassandra service containers
31+
32+
### Security
33+
- No security changes in this release
34+
35+
## [0.0.1] - TBD
36+
37+
Initial release - library is under active development.

DOCUMENTATION_REVIEW_SUMMARY.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Documentation Review Summary
2+
3+
## Review Completed
4+
5+
I've reviewed all documentation and made necessary updates to ensure accuracy with the current codebase.
6+
7+
## Updates Made
8+
9+
### 1. Created CHANGELOG.md
10+
- Added comprehensive changelog documenting recent changes
11+
- Follows Keep a Changelog format
12+
- Ready for v0.0.1 release
13+
14+
### 2. Updated Developer Guide
15+
- Added section on CI Environment Behavior
16+
- Documented which tests skip in CI and why
17+
- Added instructions for testing CI behavior locally
18+
19+
### 3. Verified Documentation Accuracy
20+
All documentation was reviewed and found to be accurate:
21+
22+
#### README.md ✅
23+
- Installation instructions are correct
24+
- API examples match current implementation
25+
- Badges and links are working
26+
27+
#### CONTRIBUTING.md ✅
28+
- Development setup instructions are correct
29+
- Test commands match Makefile targets
30+
- Linting commands are accurate
31+
- PR guidelines are current
32+
33+
#### developerdocs/ ✅
34+
- DEVELOPER_GUIDE.md - Now includes CI behavior section
35+
- BDD_TEST_GUIDE.md - Accurate with current test structure
36+
- VERSIONING_AND_TAGGING.md - Correct versioning approach
37+
- PYPI_SETUP.md - Accurate publishing instructions
38+
- api-monitoring.md - Correct API tracking approach
39+
40+
#### docs/ ✅
41+
All documentation files reviewed by the Task agent and updated where needed:
42+
- Protocol version references updated (v5 is max, not v6)
43+
- Container runtime examples show both Docker and Podman
44+
- Test commands corrected
45+
- Cassandra version consistently shown as 5
46+
47+
#### examples/ ✅
48+
- FastAPI example README is accurate
49+
- All code examples work with current API
50+
51+
## Documentation Status
52+
53+
**All documentation is now up to date and accurate**
54+
55+
The documentation correctly reflects:
56+
- Current API and features
57+
- Test running procedures
58+
- Build and development processes
59+
- CI/CD behavior
60+
- Example applications
61+
- Version and protocol support
62+
63+
## No Major Rewrites Needed
64+
65+
As requested, I only updated what was incorrect or outdated. The documentation was already well-written and mostly accurate, requiring only minor corrections for:
66+
- Protocol version accuracy
67+
- CI test behavior
68+
- Container runtime flexibility
69+
- Cassandra version consistency

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,11 @@ See our [comparison guide](docs/alternatives-comparison.md) for technical differ
105105

106106
```python
107107
# Recommended: Let driver negotiate to highest available
108-
cluster = AsyncCluster(['localhost']) # Negotiates to highest (v6 if available)
108+
cluster = AsyncCluster(['localhost']) # Negotiates to highest (currently v5)
109109
await cluster.connect() # Fails if negotiated < v5
110110

111111
# Explicit versions (v5+):
112112
cluster = AsyncCluster(['localhost'], protocol_version=5) # Forces v5 exactly
113-
cluster = AsyncCluster(['localhost'], protocol_version=6) # Forces v6 if available
114113

115114
# This raises ConfigurationError immediately:
116115
cluster = AsyncCluster(['localhost'], protocol_version=4) # ❌ Not supported
@@ -141,7 +140,7 @@ cluster = AsyncCluster(['localhost'], protocol_version=4) # ❌ Not supported
141140
**What This Means for You:**
142141

143142
When connecting:
144-
- **Cassandra 4.0+**: Automatically uses v5 or v6 (best available)
143+
- **Cassandra 4.0+**: Automatically uses v5 (highest currently supported)
145144
- **Cassandra 3.x or older**: Connection fails with:
146145
```
147146
ConnectionError: Connected with protocol v4 but v5+ is required.

developerdocs/DEVELOPER_GUIDE.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ make test-integration
6969
pytest tests/unit/test_session.py -v
7070

7171
# Run with coverage
72-
make test-coverage
72+
pytest tests/unit/ -v --cov=async_cassandra --cov-report=html
7373
```
7474

7575
### FastAPI Example Tests
@@ -80,10 +80,10 @@ The FastAPI example app serves as our primary integration test for real-world us
8080
cd examples/fastapi_app
8181

8282
# Start Cassandra (if not running)
83-
docker-compose up -d cassandra
83+
docker-compose up -d cassandra # Uses Cassandra 5.0
8484

8585
# Run FastAPI tests
86-
pytest test_fastapi_app.py -v
86+
pytest tests/test_fastapi_app.py -v
8787
```
8888

8989
## Code Quality
@@ -138,6 +138,24 @@ pre-commit install
138138
- Builds packages
139139
- Publishes to PyPI
140140

141+
### CI Environment Behavior
142+
143+
Some integration tests require controlling Cassandra (disabling/enabling binary protocol for reconnection tests). These tests automatically skip in CI environments where Cassandra runs as a service that cannot be controlled.
144+
145+
To test CI behavior locally:
146+
```bash
147+
# Run tests in CI mode (tests that need container control will skip)
148+
CI=true pytest tests/integration/test_reconnection_behavior.py -v
149+
150+
# Run tests normally (all tests execute)
151+
pytest tests/integration/test_reconnection_behavior.py -v
152+
```
153+
154+
Tests that skip in CI:
155+
- Reconnection behavior tests
156+
- FastAPI reconnection BDD tests
157+
- Tests that require disabling/enabling Cassandra
158+
141159
### PR Requirements
142160

143161
Before merging, all PRs must:

docs/api.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Connect to the cluster and create a session.
9090
**Example:**
9191
```python
9292
# Recommended: Let driver negotiate to highest available
93-
cluster = AsyncCluster(['localhost']) # Negotiates to v6 if available
93+
cluster = AsyncCluster(['localhost']) # Negotiates to v5 (highest currently supported)
9494
session = await cluster.connect('my_keyspace') # Fails if < v5
9595

9696
# Explicit protocol version (must be 5+)
@@ -525,17 +525,9 @@ except QueryError as e:
525525
print(f"Caused by: {e.cause}")
526526
```
527527

528-
### TimeoutError
528+
### Other Exceptions
529529

530-
Raised when an operation times out.
531-
532-
### AuthenticationError
533-
534-
Raised when authentication fails.
535-
536-
### ConfigurationError
537-
538-
Raised when configuration is invalid.
530+
The library also defines TimeoutError, AuthenticationError, and ConfigurationError internally, but these are typically wrapped in the main exception types above. You should generally catch ConnectionError and QueryError in your code.
539531

540532
## Complete Example
541533

docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ CQL (Cassandra Query Language) protocol versions define how clients communicate
457457
```python
458458
# Option 1: Automatic negotiation (RECOMMENDED)
459459
# Driver negotiates to highest available version
460-
cluster = AsyncCluster(['localhost']) # Gets v5 (highest currently available)
460+
cluster = AsyncCluster(['localhost']) # Gets v5 (highest currently supported)
461461

462462
# Option 2: Explicitly specify v5
463463
cluster = AsyncCluster(['localhost'], protocol_version=5) # Forces v5 exactly
@@ -472,7 +472,7 @@ cluster = AsyncCluster(['localhost'], protocol_version=4)
472472
- Fails with clear error if server only supports v4 or lower
473473
- Ensures compatibility with modern Cassandra features
474474

475-
> **Note**: As of January 2025, Cassandra supports protocol versions up to v5. Protocol v5 is considered stable and is the recommended version for production use.
475+
> **Note**: As of Cassandra 5.0, the maximum supported protocol version is v5. Protocol v5 is considered stable and is the recommended version for production use.
476476
477477
### Upgrading from Older Cassandra
478478

docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ await session.set_keyspace('my_keyspace')
172172
batch = BatchStatement()
173173
for item in items:
174174
batch.add(insert_stmt, [item.id, item.data])
175-
await session.execute(batch) # Note: execute, not execute_batch
175+
await session.execute(batch) # Note: use execute(), not execute_batch()
176176
```
177177

178178
3. **Use connection warmup:**

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ All examples require:
105105
- For FastAPI example: Use the included docker-compose.yml
106106
- For others: Install and run Cassandra locally or use Docker:
107107
```bash
108-
docker run -d -p 9042:9042 cassandra:latest
108+
docker run -d -p 9042:9042 cassandra:5
109109
```
110110
3. **Install async-cassandra**:
111111
```bash

examples/fastapi_app/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ These endpoints validate critical safety properties of context managers:
146146

147147
### Prerequisites
148148

149-
1. **Cassandra** running on localhost:9042 (or use Docker):
149+
1. **Cassandra** running on localhost:9042 (or use Docker/Podman):
150150
```bash
151-
docker run -d --name cassandra-test -p 9042:9042 cassandra:4.1
151+
# Using Docker
152+
docker run -d --name cassandra-test -p 9042:9042 cassandra:5
153+
154+
# OR using Podman
155+
podman run -d --name cassandra-test -p 9042:9042 cassandra:5
152156
```
153157

154158
2. **Python 3.12+** with dependencies:
@@ -190,10 +194,10 @@ The test suite validates all functionality and serves as integration tests in CI
190194

191195
```bash
192196
# Run all tests
193-
python test_fastapi_app.py
197+
pytest tests/test_fastapi_app.py -v
194198

195-
# Or with pytest
196-
pytest test_fastapi_app.py -v
199+
# Or run all tests in the tests directory
200+
pytest tests/ -v
197201
```
198202

199203
Tests cover:

0 commit comments

Comments
 (0)