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
If you need to run against a specific server version, you can specify
47
-
the URL of that server:
76
+
#### Data API Tests
77
+
78
+
The SDK supports testing via SingleStore's **Data API** (port 9000) instead of the MySQL protocol (port 3306). This mode uses a **dual-URL system**:
79
+
80
+
-`SINGLESTOREDB_URL`: Set to HTTP Data API endpoint (port 9000) for test operations
81
+
-`SINGLESTOREDB_INIT_DB_URL`: Automatically set to MySQL endpoint (port 3306) for setup operations
82
+
83
+
**Why dual URLs?** Some setup operations like `SET GLOBAL` and `USE database` commands don't work over the HTTP Data API, so they're routed through the MySQL protocol automatically.
84
+
85
+
Enable HTTP Data API testing:
86
+
```bash
87
+
# Run tests via HTTP Data API
88
+
USE_DATA_API=1 pytest -v singlestoredb/tests
89
+
```
90
+
91
+
**Known Limitations in HTTP Data API Mode:**
92
+
-`USE database` command is not supported (some tests will be skipped)
93
+
- Setup operations requiring `SET GLOBAL` are automatically routed to MySQL protocol
94
+
95
+
#### Testing Against an Existing Server
96
+
97
+
If you have a running SingleStore instance, you can test against it by setting `SINGLESTOREDB_URL`. The Docker container will not be started.
-**`SINGLESTOREDB_INIT_DB_URL`**: MySQL connection URL for setup operations (auto-set in HTTP Data API mode). Used for operations that require MySQL protocol even when testing via HTTP.
134
+
135
+
-**`SINGLESTORE_LICENSE`**: Optional license key for Docker container. If not provided, container runs without a license.
136
+
137
+
-**`SINGLESTOREDB_PURE_PYTHON`**: Set to `1` to disable C acceleration and test in pure Python mode.
138
+
139
+
-**`SINGLESTOREDB_MANAGEMENT_TOKEN`**: Management API token for testing management features (mark tests with `@pytest.mark.management`).
140
+
141
+
### Testing Best Practices
142
+
143
+
1.**Test both protocols**: Always run tests with both MySQL protocol and HTTP Data API before submitting:
144
+
```bash
145
+
pytest -v singlestoredb/tests
146
+
USE_DATA_API=1 pytest -v singlestoredb/tests
147
+
```
148
+
149
+
2.**Pure Python testing**: Test without C acceleration to ensure compatibility:
0 commit comments