Skip to content

Conversation

@koxudaxi
Copy link
Collaborator

@koxudaxi koxudaxi commented Dec 10, 2025

TL;DR

Added comprehensive test suite for the Functions API and database services.

What changed?

  • Added functions.test.ts in the cloud/api directory to test the Functions API endpoints:

    • Testing registration of new functions
    • Retrieving functions by ID and hash
    • Listing functions with filtering capabilities
    • Proper API key authentication and validation
  • Added functions.test.ts in the cloud/db/services directory to test the database services:

    • Testing environment context retrieval
    • Function registration and versioning logic
    • Function retrieval by ID and hash
    • Function listing with pagination and filtering

How to test?

  1. Run the test suite with:

    npm test cloud/api/functions.test.ts
    npm test cloud/db/services/functions.test.ts
    
  2. Verify that all tests pass, including:

    • API authentication tests
    • Function registration tests
    • Function retrieval tests
    • Function listing and filtering tests

Why make this change?

These tests ensure the reliability and correctness of the Functions API and database services. They validate key functionality like:

  • Proper function versioning (major/minor version bumps based on signature changes)
  • Correct handling of function metadata, tags, and descriptions
  • API authentication and authorization
  • Proper error handling for non-existent resources
  • Filtering and pagination for function listings

This test coverage helps prevent regressions and ensures the Functions API behaves as expected.

This was referenced Dec 10, 2025
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from 147562c to 51931fc Compare December 25, 2025 02:10
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch 2 times, most recently from 01fa060 to a30b964 Compare December 25, 2025 04:37
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from 51931fc to a3af512 Compare December 25, 2025 04:37
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch from a30b964 to 9ffcd68 Compare December 25, 2025 04:49
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from a3af512 to 9aee38f Compare December 25, 2025 04:49
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch from 9ffcd68 to cefc65f Compare December 25, 2025 04:53
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch 2 times, most recently from 224402c to e601a88 Compare December 25, 2025 04:56
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch 2 times, most recently from 8f244ed to 0c0893b Compare December 25, 2025 05:00
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from e601a88 to 04940cb Compare December 25, 2025 05:00
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch from 0c0893b to a1ade0b Compare December 25, 2025 05:02
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch 2 times, most recently from 530ca94 to c1421f4 Compare December 25, 2025 05:05
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch from a1ade0b to 5df4adc Compare December 25, 2025 05:05
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from c1421f4 to bc0d2ec Compare December 25, 2025 06:19
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch 2 times, most recently from 24388d3 to ef59c2b Compare December 25, 2025 06:23
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch 2 times, most recently from 7efc689 to b0f6417 Compare December 25, 2025 06:31
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch from ef59c2b to 008d1e5 Compare December 25, 2025 06:31
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from b0f6417 to 67bde06 Compare December 25, 2025 06:37
@koxudaxi koxudaxi force-pushed the 12-10-test_api_add_functions_endpoint_tests branch from 008d1e5 to 370602e Compare December 25, 2025 06:37
@koxudaxi koxudaxi changed the base branch from 12-10-feat_api_add_functions_api_endpoints to graphite-base/1626 December 25, 2025 06:59
@koxudaxi koxudaxi closed this Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants