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
* Remove redundancy and differences between README and Development Guide
- Removed information from README that repeated or conflicted with the Development Guide (docs/development.md).
- Moved development guidance that was only in the README into the Development Guide
- Added a note to clarify context needed for running integration tests.
* Add information to integration test instructions for creating the necessary test data
* Fix guidance to remove explicit venv creation and use poetry properly throughout
---------
Co-authored-by: Luke Hinds <luke@stacklok.com>
Copy file name to clipboardExpand all lines: docs/development.md
+74-1
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,8 @@ The project uses several tools to maintain code quality:
147
147
148
148
### 3. Testing
149
149
150
-
Run the test suite with coverage:
150
+
#### Unit Tests
151
+
To run the unit test suite with coverage:
151
152
152
153
```bash
153
154
poetry run pytest
@@ -156,6 +157,35 @@ poetry run pytest
156
157
Tests are located in the `tests/` directory and follow the same structure as the
157
158
source code.
158
159
160
+
#### Integration Tests
161
+
To run the integration tests, create a `.env` file in the repo root directory and add the
162
+
following properties to it:
163
+
```
164
+
ENV_OPENAI_KEY=<YOUR_KEY>
165
+
ENV_VLLM_KEY=<YOUR_KEY>
166
+
ENV_ANTHROPIC_KEY=<YOUR_KEY>
167
+
```
168
+
169
+
Next, run import_packages to ensure integration test data is created:
170
+
```bash
171
+
poetry run python scripts/import_packages.py
172
+
```
173
+
174
+
Next, start the CodeGate server:
175
+
```bash
176
+
poetry run codegate serve --log-level DEBUG --log-format TEXT
177
+
```
178
+
179
+
Then the integration tests can be executed by running:
180
+
```bash
181
+
poetry run python tests/integration/integration_tests.py
182
+
```
183
+
184
+
You can include additional properties to specify test scope and other information. For instance, to execute the tests for Copilot providers, for instance, run:
185
+
```bash
186
+
CODEGATE_PROVIDERS=copilot CA_CERT_FILE=./codegate_volume/certs/ca.crt poetry run python tests/integration/integration_tests.py
187
+
```
188
+
159
189
### 4. Make commands
160
190
161
191
The project includes a Makefile for common development tasks:
@@ -168,6 +198,49 @@ The project includes a Makefile for common development tasks:
168
198
-`make build`: build distribution packages
169
199
-`make all`: run all checks and build (recommended before committing)
170
200
201
+
## 🐳 Docker deployment
202
+
203
+
### Build the image
204
+
205
+
```bash
206
+
make image-build
207
+
```
208
+
209
+
### Run the container
210
+
211
+
```bash
212
+
# Basic usage with local image
213
+
docker run -p 8989:8989 -p 9090:9090 codegate:latest
214
+
215
+
# With pre-built pulled image
216
+
docker pull ghcr.io/stacklok/codegate:latest
217
+
docker run --name codegate -d -p 8989:8989 -p 9090:9090 ghcr.io/stacklok/codegate:latest
218
+
219
+
# It will mount a volume to /app/codegate_volume
220
+
# The directory supports storing Llama CPP models under subdirectory /models
221
+
# A sqlite DB with the messages and alerts is stored under the subdirectory /db
0 commit comments