updating tests and workflow to use OPENROUTER API Key from GHA secrets

This commit is contained in:
ColemanRoo 2025-01-27 11:12:29 -06:00
parent 4c6c28958e
commit b21dbd4590
2 changed files with 31 additions and 26 deletions

View file

@ -1,30 +1,35 @@
name: Extension Test
on:
push:
branches:
- feature/integrationTestCI
branches: [ feature/integrationTestCI ]
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
branches: [feature/integrationTestCI]
branches: [ feature/integrationTestCI ]
workflow_dispatch:
jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm run install:all
- name: Compile TypeScript
run: npm run compile
- name: Run test
run: xvfb-run -a npm run test:extension
steps:
- uses: actions/checkout@v4
- name: Create .test_env file
run: |
echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .test_env
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm run install:all
- name: Compile TypeScript
run: npm run compile
- name: Run tests
run: xvfb-run -a npm run test:extension

View file

@ -38,9 +38,9 @@ suite("Roo Code Extension Test Suite", () => {
}
// Verify API key is set and valid
const apiKey = process.env.OPEN_ROUTER_API_KEY
const apiKey = process.env.OPENROUTER_API_KEY
if (!apiKey) {
done(new Error("OPEN_ROUTER_API_KEY environment variable is not set"))
done(new Error("OPENROUTER_API_KEY environment variable is not set"))
return
}
if (!apiKey.startsWith("sk-or-v1-")) {
@ -178,9 +178,9 @@ suite("Roo Code Extension Test Suite", () => {
// Set up API configuration
await provider.updateGlobalState("apiProvider", "openrouter")
await provider.updateGlobalState("openRouterModelId", "anthropic/claude-3.5-sonnet")
const apiKey = process.env.OPEN_ROUTER_API_KEY
const apiKey = process.env.OPENROUTER_API_KEY
if (!apiKey) {
assert.fail("OPEN_ROUTER_API_KEY environment variable is not set")
assert.fail("OPENROUTER_API_KEY environment variable is not set")
return
}
await provider.storeSecret("openRouterApiKey", apiKey)