Skip to content

Commit a0178d0

Browse files
Merge pull request #32 from neuromechanist/develop
Fix CI: use testing API key and optimize integration test runs
2 parents c81c2fb + 13c569d commit a0178d0

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,19 @@ jobs:
128128
pip install -e ".[dev]"
129129
pip install pytest-timeout
130130
131-
- name: Run integration tests
131+
- name: Run integration tests only
132132
env:
133133
OPENROUTER_API_KEY_FOR_TESTING: ${{ secrets.OPENROUTER_API_KEY_FOR_TESTING }}
134134
run: |
135135
# Only run if the secret is available
136136
if [ -n "$OPENROUTER_API_KEY_FOR_TESTING" ]; then
137137
echo "Running integration tests with OpenRouter..."
138-
pytest tests/test_integration_openrouter.py -v -m integration --timeout=180 --cov=src --cov-report=xml:coverage-integration.xml --cov-report=term-missing
138+
pytest tests/ -v -m integration --timeout=180 --cov=src --cov-report=xml:coverage-integration.xml --cov-report=term-missing
139139
else
140140
echo "OPENROUTER_API_KEY_FOR_TESTING not set, skipping integration tests"
141141
fi
142142
143143
- name: Upload integration coverage to Codecov
144-
# Always upload coverage, even if some tests fail
145-
# This ensures partial coverage is still counted
146144
if: always()
147145
uses: codecov/codecov-action@v4
148146
with:

codecov.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ coverage:
1111
# Allow coverage to drop by 2% without failing
1212
threshold: 2%
1313
if_ci_failed: error
14-
# Only report status after all flags are uploaded
15-
flags:
16-
- unittests
17-
- integration
1814
patch:
1915
default:
2016
# New code should have coverage, but be lenient
@@ -55,5 +51,5 @@ flags:
5551
paths:
5652
- src/
5753
carryforward: true
58-
# Integration tests run less frequently (only on merge with src changes)
59-
# Carry forward ensures previous results are used when skipped
54+
# Integration tests run less frequently (only when related files change)
55+
# Carryforward ensures previous coverage is used when skipped

src/scripts/process_feedback.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ async def process_feedback_file(
4747
from src.utils.github_client import GitHubClient
4848
from src.utils.openrouter_llm import create_openrouter_llm
4949

50-
# Get API keys from environment
51-
openrouter_key = os.getenv("OPENROUTER_API_KEY")
50+
# Get API keys from environment (prefer testing key for CI/tests)
51+
openrouter_key = os.getenv("OPENROUTER_API_KEY_FOR_TESTING") or os.getenv("OPENROUTER_API_KEY")
5252
github_token = os.getenv("GITHUB_TOKEN")
5353

5454
if not openrouter_key:
55-
logger.error("OPENROUTER_API_KEY not set")
55+
logger.error("OPENROUTER_API_KEY or OPENROUTER_API_KEY_FOR_TESTING not set")
5656
sys.exit(1)
5757

5858
# Get model configuration from environment

0 commit comments

Comments
 (0)