Skip to content

Commit 7b3b275

Browse files
author
Lasim
committed
Add unit tests for MCP versions list and update routes
- Implement comprehensive unit tests for the MCP versions list route, covering route registration, request handling, error responses, and response format. - Add unit tests for the MCP versions update route, ensuring proper registration, request handling, error responses, and response format. - Validate schema configuration and performance for both routes, including concurrent request handling and edge cases. - Ensure consistent error responses and proper HTTP method usage in tests.
1 parent a1f9c9f commit 7b3b275

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+11657
-5
lines changed

package-lock.json

Lines changed: 441 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/backend/api-spec.json

Lines changed: 750 additions & 0 deletions
Large diffs are not rendered by default.

services/backend/api-spec.yaml

Lines changed: 500 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
CREATE TABLE `mcpCategories` (
2+
`id` text PRIMARY KEY NOT NULL,
3+
`name` text NOT NULL,
4+
`description` text,
5+
`icon` text,
6+
`sort_order` integer DEFAULT 0 NOT NULL,
7+
`created_at` integer NOT NULL
8+
);
9+
--> statement-breakpoint
10+
CREATE TABLE `mcpServerVersions` (
11+
`id` text PRIMARY KEY NOT NULL,
12+
`server_id` text NOT NULL,
13+
`version` text NOT NULL,
14+
`git_commit` text,
15+
`changelog` text,
16+
`is_latest` integer DEFAULT false NOT NULL,
17+
`is_stable` integer DEFAULT true NOT NULL,
18+
`created_at` integer NOT NULL,
19+
FOREIGN KEY (`server_id`) REFERENCES `mcpServers`(`id`) ON UPDATE no action ON DELETE cascade
20+
);
21+
--> statement-breakpoint
22+
CREATE INDEX `mcp_server_versions_server_idx` ON `mcpServerVersions` (`server_id`);--> statement-breakpoint
23+
CREATE INDEX `mcp_server_versions_latest_idx` ON `mcpServerVersions` (`is_latest`);--> statement-breakpoint
24+
CREATE TABLE `mcpServers` (
25+
`id` text PRIMARY KEY NOT NULL,
26+
`name` text NOT NULL,
27+
`slug` text NOT NULL,
28+
`description` text NOT NULL,
29+
`long_description` text,
30+
`github_url` text,
31+
`git_branch` text DEFAULT 'main',
32+
`homepage_url` text,
33+
`language` text NOT NULL,
34+
`runtime` text NOT NULL,
35+
`runtime_min_version` text,
36+
`installation_methods` text NOT NULL,
37+
`tools` text NOT NULL,
38+
`resources` text,
39+
`prompts` text,
40+
`visibility` text DEFAULT 'team' NOT NULL,
41+
`owner_team_id` text,
42+
`created_by` text NOT NULL,
43+
`author_name` text,
44+
`author_contact` text,
45+
`organization` text,
46+
`license` text,
47+
`default_config` text,
48+
`environment_variables` text,
49+
`dependencies` text,
50+
`category_id` text,
51+
`tags` text,
52+
`status` text DEFAULT 'active' NOT NULL,
53+
`featured` integer DEFAULT false NOT NULL,
54+
`created_at` integer NOT NULL,
55+
`updated_at` integer NOT NULL,
56+
`last_sync_at` integer,
57+
FOREIGN KEY (`owner_team_id`) REFERENCES `teams`(`id`) ON UPDATE no action ON DELETE cascade,
58+
FOREIGN KEY (`created_by`) REFERENCES `authUser`(`id`) ON UPDATE no action ON DELETE no action,
59+
FOREIGN KEY (`category_id`) REFERENCES `mcpCategories`(`id`) ON UPDATE no action ON DELETE no action
60+
);
61+
--> statement-breakpoint
62+
CREATE UNIQUE INDEX `mcpServers_slug_unique` ON `mcpServers` (`slug`);--> statement-breakpoint
63+
CREATE INDEX `mcp_servers_visibility_idx` ON `mcpServers` (`visibility`);--> statement-breakpoint
64+
CREATE INDEX `mcp_servers_category_idx` ON `mcpServers` (`category_id`);--> statement-breakpoint
65+
CREATE INDEX `mcp_servers_status_idx` ON `mcpServers` (`status`);--> statement-breakpoint
66+
CREATE INDEX `mcp_servers_owner_team_idx` ON `mcpServers` (`owner_team_id`);

0 commit comments

Comments
 (0)