Skip to content
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
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,23 @@ on:
branches: ["*"]
merge_group:

permissions:
contents: read
actions: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
ci:
runs-on: ubuntu-latest
runs-on: ubuntu-16gb
timeout-minutes: 30
env:
TURBO_TELEMETRY_DISABLED: 1
TURBO_CACHE_DIR: .turbo
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -103,10 +113,6 @@ jobs:
# This will build once and cache, then run lint, typecheck, and test in parallel
pnpm check
env:
TURBO_TELEMETRY_DISABLED: 1
TURBO_CACHE_DIR: .turbo
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
ENVIRONMENT: test
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-ci-testing' }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY || 'sk-ant-test-key-for-ci-testing' }}
Expand Down
2 changes: 0 additions & 2 deletions agents-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@
},
"devDependencies": {
"@hono/vite-dev-server": "^0.20.1",
"@opentelemetry/exporter-trace-otlp-proto": "^0.203.0",
"@opentelemetry/sdk-metrics": "^2.1.0",
"@types/jmespath": "^0.15.2",
"@types/node": "^20.11.24",
"@types/pg": "^8.15.6",
Expand Down
3 changes: 3 additions & 0 deletions agents-api/src/__tests__/manage/utils/cors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ describe('isOriginAllowed', () => {
env: {
INKEEP_AGENTS_API_URL: 'http://localhost:3002',
INKEEP_AGENTS_MANAGE_UI_URL: undefined,
ENVIRONMENT: 'development',
},
}));
});
Expand Down Expand Up @@ -112,6 +113,7 @@ describe('isOriginAllowed', () => {
env: {
INKEEP_AGENTS_API_URL: 'http://127.0.0.1:3002',
INKEEP_AGENTS_MANAGE_UI_URL: undefined,
ENVIRONMENT: 'development',
},
}));
});
Expand Down Expand Up @@ -227,6 +229,7 @@ describe('isOriginAllowed', () => {
env: {
INKEEP_AGENTS_API_URL: undefined,
INKEEP_AGENTS_MANAGE_UI_URL: undefined,
ENVIRONMENT: 'development',
},
}));
});
Expand Down
27 changes: 0 additions & 27 deletions agents-api/src/__tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import { getLogger } from '@inkeep/agents-core';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import { ConsoleMetricExporter, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
/*instrumentation.ts*/
import { NodeSDK } from '@opentelemetry/sdk-node';
import { migrate } from 'drizzle-orm/pglite/migrator';
import { afterAll, afterEach, beforeAll, vi } from 'vitest';
import manageDbClient from '../data/db/manageDbClient';
import runDbClient from '../data/db/runDbClient';

const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');

// Mock the local logger module globally - this will be hoisted automatically by Vitest
vi.mock('../logger.js', () => {
const mockLogger = {
Expand Down Expand Up @@ -79,26 +72,6 @@ vi.mock('src/data/db/manageDbPool', () => {
};
});

const sdk = new NodeSDK({
serviceName: 'inkeep-agents-api-test',
spanProcessors: [
new SimpleSpanProcessor(
new OTLPTraceExporter({
// optional - default url is http://localhost:4318/v1/traces
// url: 'http://localhost:4318/v1/traces',
})
),
],
instrumentations: [getNodeAutoInstrumentations()],
// optional - default url is http://localhost:4318/v1/metrics
// url: 'http://localhost:4318/v1/metrics',
metricReader: new PeriodicExportingMetricReader({
exporter: new ConsoleMetricExporter(),
}),
});

sdk.start();

// Initialize database schema for in-memory test databases using Drizzle migrations
beforeAll(async () => {
const logger = getLogger('Test Setup');
Expand Down
3 changes: 3 additions & 0 deletions agents-api/src/__tests__/utils/cors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ describe('isOriginAllowed', () => {
env: {
INKEEP_AGENTS_API_URL: 'http://localhost:3002',
INKEEP_AGENTS_MANAGE_UI_URL: undefined,
ENVIRONMENT: 'development',
},
}));
});
Expand Down Expand Up @@ -112,6 +113,7 @@ describe('isOriginAllowed', () => {
env: {
INKEEP_AGENTS_API_URL: 'http://127.0.0.1:3002',
INKEEP_AGENTS_MANAGE_UI_URL: undefined,
ENVIRONMENT: 'development',
},
}));
});
Expand Down Expand Up @@ -227,6 +229,7 @@ describe('isOriginAllowed', () => {
env: {
INKEEP_AGENTS_API_URL: undefined,
INKEEP_AGENTS_MANAGE_UI_URL: undefined,
ENVIRONMENT: 'development',
},
}));
});
Expand Down
4 changes: 2 additions & 2 deletions agents-api/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default defineProject({
isolate: true, // Ensure test isolation to prevent state leakage
poolOptions: {
threads: {
maxThreads: 10, // Increase for GitHub Actions runners (have more cores)
minThreads: 4,
maxThreads: 8,
minThreads: 2,
},
},
env: {
Expand Down
15 changes: 9 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 21 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
},
"build": {
"dependsOn": ["^build", "sync:licenses"],
"inputs": ["$TURBO_DEFAULT$", ".env.example"],
"inputs": [
"$TURBO_DEFAULT$",
"!**/*.test.*",
"!**/*.spec.*",
"!**/__tests__/**",
".env.example"
],
"outputs": ["dist/**", "build/**", ".next/**", "!.next/cache/**"]
},
"dev": {
Expand All @@ -54,12 +60,24 @@
},
"@inkeep/agents-manage-mcp#build": {
"dependsOn": ["^build", "sync:licenses"],
"inputs": ["$TURBO_DEFAULT$", ".env.example"],
"inputs": [
"$TURBO_DEFAULT$",
"!**/*.test.*",
"!**/*.spec.*",
"!**/__tests__/**",
".env.example"
],
"outputs": ["dist/**", "bin/**", ".tsbuildinfo"]
},
"@inkeep/agents-mcp#build": {
"dependsOn": ["^build", "sync:licenses"],
"inputs": ["$TURBO_DEFAULT$", ".env.example"],
"inputs": [
"$TURBO_DEFAULT$",
"!**/*.test.*",
"!**/*.spec.*",
"!**/__tests__/**",
".env.example"
],
"outputs": ["esm/**", "bin/**", ".tsbuildinfo"]
},
"test:watch": {
Expand All @@ -72,7 +90,6 @@
"outputs": ["coverage/**"]
},
"lint": {
"dependsOn": ["transit"],
"inputs": ["$TURBO_DEFAULT$"],
"outputs": []
},
Expand Down