Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test: align quota suites with current dev contracts

Alfredo Lopez4067e75450d0
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index ff69417b7..33f2df8e4 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.712",
+ "version": "0.1.713",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.712",
+ "version": "0.1.713",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",
diff --git a/control-api/package.json b/control-api/package.json
index 7488e270c..0a60f5958 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.712",
+ "version": "0.1.713",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/routes.externalGfs.test.ts b/control-api/test/routes.externalGfs.test.ts
index 90dfd7ebe..35035194e 100644
--- a/control-api/test/routes.externalGfs.test.ts
+++ b/control-api/test/routes.externalGfs.test.ts
@@ -56,6 +56,10 @@ vi.mock('../src/config.js', () => ({
externalGfsGrantsReadRlPerMin: 45,
externalGfsSharesReadRlPerMin: 35,
externalGfsOperationRlPerMin: 30,
+ // Operator GFS route budgets; production defaults from src/config.ts.
+ adminGfsGrantsPerMin: 150,
+ adminGfsSharesPerMin: 150,
+ adminGfsLegacyGrantReportPerMin: 150,
},
}))
vi.mock('../src/services/gfsDesktopOperatorLinkService.js', () => ({
diff --git a/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts b/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts
index 0c17c231f..9fc7f8d7d 100644
--- a/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts
+++ b/control-api/test/routes.rateLimitProcessMemory.realPostgres.integration.test.ts
@@ -210,7 +210,12 @@ describeRealPostgres('rateLimitMiddleware process-memory mode (real PostgreSQL)'
const retryAfterSeconds = Number(denied.headers['retry-after'])
expect(retryAfterSeconds).toBeGreaterThanOrEqual(1)
expect(retryAfterSeconds).toBeLessThanOrEqual(60)
- expect(denied.body).toEqual({ error: 'Too Many Requests', retryAfterSeconds })
+ expect(denied.body).toEqual({
+ error: 'Too Many Requests',
+ code: 'rate_limited',
+ message: `This request limit has been reached. Try again in ${retryAfterSeconds} seconds.`,
+ retryAfterSeconds,
+ })
expect(denied.headers['x-ratelimit-remaining']).toBe('0')
const hitsHeld = await externalUserHits()
diff --git a/control-api/test/services.adminSubscriptionRateLimitMigration.realPostgres.integration.test.ts b/control-api/test/services.adminSubscriptionRateLimitMigration.realPostgres.integration.test.ts
index e96dd8a6e..303fe37e6 100644
--- a/control-api/test/services.adminSubscriptionRateLimitMigration.realPostgres.integration.test.ts
+++ b/control-api/test/services.adminSubscriptionRateLimitMigration.realPostgres.integration.test.ts
@@ -39,11 +39,14 @@ describeRealPostgres('administrative subscription counter namespace migration',
})
afterAll(async () => {
- client?.release()
- await pool?.end()
- if (!adminPool) return
- await adminPool.query(`DROP DATABASE IF EXISTS "${database}" WITH (FORCE)`)
- await adminPool.end()
+ try {
+ client?.release()
+ await pool?.end()
+ if (!adminPool) return
+ await adminPool.query(`DROP DATABASE IF EXISTS "${database}" WITH (FORCE)`)
+ } finally {
+ await adminPool?.end()
+ }
})
async function migrate() {
diff --git a/external-rest-api/package-lock.json b/external-rest-api/package-lock.json
index ec891878c..02ab6e38f 100644
--- a/external-rest-api/package-lock.json
+++ b/external-rest-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-external-rest-api",
- "version": "0.1.96",
+ "version": "0.1.97",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-external-rest-api",
- "version": "0.1.96",
+ "version": "0.1.97",
"dependencies": {
"@clerum/jwt-key-policy": "file:../packages/jwt-key-policy",
"cors": "^2.8.5",
diff --git a/external-rest-api/package.json b/external-rest-api/package.json
index 8cc5df649..834823f07 100644
--- a/external-rest-api/package.json
+++ b/external-rest-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-external-rest-api",
- "version": "0.1.96",
+ "version": "0.1.97",
"description": "External REST API for profile, team management, and RPC token brokerage",
"main": "dist/main.js",
"engines": {
diff --git a/external-rest-api/src/releaseManifest.ts b/external-rest-api/src/releaseManifest.ts
index 04c3e275d..f84b7ddf1 100644
--- a/external-rest-api/src/releaseManifest.ts
+++ b/external-rest-api/src/releaseManifest.ts
@@ -8,7 +8,7 @@ export type ReleaseManifest = {
export const releaseManifest: ReleaseManifest = {
releaseId: 'v0.10.0',
- externalRestApiVersion: '0.1.96',
+ externalRestApiVersion: '0.1.97',
rpcProxyVersion: '0.1.119',
desktopVersion: '0.10.0',
minimumDesktopVersion: '0.1.252',
diff --git a/external-rest-api/vitest.config.ts b/external-rest-api/vitest.config.ts
index 15644fae2..959ba82ce 100644
--- a/external-rest-api/vitest.config.ts
+++ b/external-rest-api/vitest.config.ts
@@ -1,6 +1,14 @@
import { defineConfig } from 'vitest/config'
+import path from 'node:path'
export default defineConfig({
+ resolve: {
+ alias: {
+ // Cross-package contract tests import control-ui/lib modules, which resolve
+ // shared constants through control-ui's own path alias.
+ '@constants': path.resolve(__dirname, '../control-ui/app/constants'),
+ },
+ },
test: {
setupFiles: ['../scripts/testing/bind-loopback-in-tests.mjs', 'test/testJwtKey.setup.ts'],
include: ['src/**/*.test.ts', 'src/**/__tests__/**/*.ts', 'test/**/*.test.ts'],