Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,16 @@ jobs:
echo "Current directory: $(pwd)"
echo "Directory contents:"
ls -la
echo "Test directory content:"
if [ -d "test_dir" ]; then
ls -la test_dir/
echo "Test directory content (tests/):"
if [ -d "tests" ]; then
ls -la tests/
else
echo "test_dir not found in current directory!"
echo "Looking for test_dir in other locations:"
find . -type d -name "test_dir"
echo "tests directory not found!"
fi

- name: Lint with Ruff (check)
run: |
# Run linting but don't fail on errors in test files
ruff check --fix --verbose --preview --exclude "test_dir/*" .
ruff check --fix --verbose --preview --exit-zero test_dir/
ruff check --fix --verbose --preview .

- name: Lint with Ruff (format)
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ When running tests, use these approaches for better control and reliability:

```bash
# Run specific test files
python -m pytest test_dir/test_ollama_model_context.py
python -m pytest tests/models/test_ollama_model_context.py

# Run specific test classes or methods
python -m pytest test_dir/test_ollama_model_context.py::TestOllamaModelContext
python -m pytest test_dir/test_ollama_model_context.py::TestOllamaModelContext::test_clear_history
python -m pytest tests/models/test_ollama_model_context.py::TestOllamaModelContext
python -m pytest tests/models/test_ollama_model_context.py::TestOllamaModelContext::test_clear_history

# Use pattern matching with -k to select specific tests
python -m pytest -k "tree_tool or ollama_context"
Expand Down
4 changes: 2 additions & 2 deletions docs/CODE_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ If you prefer to run coverage manually, use the following commands:

```bash
# Run pytest with coverage
python -m pytest --cov=src/cli_code --cov-report=term --cov-report=xml --cov-report=html test_dir/
python -m pytest --cov=src/cli_code --cov-report=term --cov-report=xml --cov-report=html tests/

# To run specific test files
python -m pytest --cov=src/cli_code --cov-report=term test_dir/test_file.py
python -m pytest --cov=src/cli_code --cov-report=term tests/tools/test_file_tools.py
```

## Analyzing Coverage Results
Expand Down
6 changes: 3 additions & 3 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This document provides guidelines and best practices for writing and maintaining
Tests are organized in two main directories:

- `test_dir/`: Contains most test files
- `tests/`: Contains specialized test directories (e.g., `models/`, `tools/`)
- `tests/`: Contains all test files, organized by module (e.g., `tests/models`, `tests/tools`).

Test file naming follows these conventions:

Expand All @@ -42,10 +42,10 @@ python -m pytest --cov=src

```bash
# Run tests in a specific file
python -m pytest test_dir/test_gemini_model.py
python -m pytest tests/models/test_gemini.py

# Run a specific test
python -m pytest test_dir/test_gemini_model.py::test_generate_simple_text_response
python -m pytest tests/models/test_gemini.py::test_generate_simple_text_response
```

## Mock Objects and API Interactions
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ flowchart TD
* **Sophisticated Planning**: Consider if needed beyond system prompts.
* **Asynchronous Operations**: Evaluate for long-running tools.
* **State Management**: Assess if needed for more complex multi-turn tasks.
* **Testing**: Expand test suite (`test_dir`) to cover both providers, mock API interactions, and test the agent selection logic.
* **Testing**: Expand test suite (`tests/`) to cover both providers, mock API interactions, and test the agent selection logic.
* **Tool Schema Validation/Translation**: Ensure robust handling of schema differences between Gemini and OpenAI formats.
* **Summarizer Tool Integration**: Clarify registration/usage.

Expand Down
8 changes: 4 additions & 4 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thank you for your interest in contributing to CLI-Code! This document outlines
- **Run local SonarCloud scan**: Get a baseline of current code quality and coverage
```bash
# Generate coverage report
pytest --cov=src test_dir --cov-report=xml
pytest --cov=src tests --cov-report=xml

# Run local SonarCloud scan
sonar-scanner -Dsonar.login=YOUR_SONARCLOUD_TOKEN
Expand All @@ -32,7 +32,7 @@ Thank you for your interest in contributing to CLI-Code! This document outlines
- Ensure overall code coverage does not decrease
- Run the test suite frequently during development:
```bash
pytest --cov=src test_dir
pytest --cov=src tests
```

### 5. Verification
Expand All @@ -41,7 +41,7 @@ Thank you for your interest in contributing to CLI-Code! This document outlines
- Run a final local SonarCloud scan to verify quality improvements:
```bash
# Generate final coverage report
pytest --cov=src test_dir --cov-report=xml
pytest --cov=src tests --cov-report=xml

# Run local SonarCloud scan
sonar-scanner -Dsonar.login=YOUR_SONARCLOUD_TOKEN
Expand Down Expand Up @@ -94,7 +94,7 @@ For the fastest feedback loop, run SonarCloud analysis locally before pushing ch

2. Generate coverage report:
```bash
pytest --cov=src test_dir --cov-report=xml
pytest --cov=src tests --cov-report=xml
```

3. Run local scan (requires your SonarCloud token):
Expand Down
2 changes: 1 addition & 1 deletion scripts/find_hanging_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ run_test_with_timeout() {
}

# Determine test directory
TEST_DIR="test_dir"
TEST_DIR="tests"

# Check if TEST_DIR environment variable is set
if [ -n "$TEST_DIR_ENV" ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/memory_backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"name": "SonarCloud Analysis Process",
"entityType": "TechnicalProcess",
"observations": [
"Generate coverage report with: pytest --cov=src test_dir --cov-report=xml",
"Generate coverage report with: pytest --cov=src tests --cov-report=xml",
"Run local SonarCloud scan with: sonar-scanner -Dsonar.login=YOUR_SONARCLOUD_TOKEN or use environment variable",
"Local analysis allows for faster feedback loop before pushing changes",
"GitHub Actions workflow automatically runs scans on push",
Expand Down
6 changes: 3 additions & 3 deletions scripts/run_api_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ echo "Running API-dependent tests with a 10-second timeout per test..."

# Run API-dependent tests
python -m pytest \
test_dir/test_ollama_model.py \
test_dir/test_gemini_model.py \
test_dir/test_model_integration.py \
tests/models/test_ollama.py \
tests/models/test_gemini.py \
tests/models/test_model_integration.py \
-v \
--timeout=10

Expand Down
Loading