[api] Move test_server to agdb_api and add it to typedef #1780#1792
Merged
michaelvlach merged 9 commits intomainfrom May 1, 2026
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the test_server test harness and shared server configuration types into agdb_api so agdb_server integration tests can reuse them and so the types can participate in agdb’s type-definition reflection.
Changes:
- Refactors
agdb_serverintegration tests to useagdb_api::test_server::*utilities instead of local test helpers. - Centralizes server configuration constants/struct (
ConfigImpl, limits,SALT_LEN) underagdb_api::config_impland updates server code to consume it. - Extends
agdbtype-definition coverage (e.g.,Arc<T>, arrays,PathBuf) and updates the derive parser to treatbail!as a call-like macro.
Reviewed changes
Copilot reviewed 57 out of 57 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| agdb_server/tests/tls/mod.rs | Switches TLS tests to use agdb_api’s moved test_server + config_impl APIs. |
| agdb_server/tests/tests.rs | Adds integration test crate root that includes routes and optional tls modules. |
| agdb_server/tests/routes/user_status.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/user_logout_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/user_login_test.rs | Updates imports and reqwest_client() usage to agdb_api::test_server. |
| agdb_server/tests/routes/user_change_password_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/misc_routes.rs | Updates imports and config construction to use agdb_api::{test_server, config_impl}. |
| agdb_server/tests/routes/db_user_remove_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_user_list.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_user_add_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_rename_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_remove_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_optimize_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_list_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_exec_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_delete_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_copy_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_convert_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_clear_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_backup_restore_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_audit_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/db_add_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/cluster_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_user_logout_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_user_logout_all.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_user_list_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_user_delete_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_user_change_password_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_user_add_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_status_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_set_log_level_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_user_remove_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_user_list_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_user_add_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_rename_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_remove_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_optimize_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_list_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_exec_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_delete_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_copy_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_convert_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_clear_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_backup_restore_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_audit_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/tests/routes/admin_db_add_test.rs | Updates imports to use agdb_api::test_server helpers. |
| agdb_server/src/password.rs | Uses shared SALT_LEN from agdb_api::config_impl. |
| agdb_server/src/config.rs | Replaces local ConfigImpl/constants and config serialization with agdb_api::config_impl. |
| agdb_server/Cargo.toml | Adds agdb_api dev-dependency with test_server feature for integration tests. |
| agdb_derive/src/type_def_parser/expression_parser.rs | Treats bail! as a call-like macro during type-def parsing. |
| agdb_api/rust/src/test_server/test_error.rs | Introduces TestError + local bail! macro for test_server errors. |
| agdb_api/rust/src/test_server.rs | Adds/migrates test_server harness into agdb_api, plus type-def hooks. |
| agdb_api/rust/src/lib.rs | Exposes test_server module behind test_server feature; re-exports config_impl. |
| agdb_api/rust/src/api_types/config_impl.rs | Adds shared ConfigImpl + defaults + config string serializer. |
| agdb_api/rust/src/api_types.rs | Exposes the new config_impl API types module. |
| agdb_api/rust/Cargo.toml | Adds test_server feature and optional tokio dependency. |
| agdb/src/type_def.rs | Adds type-definition impls for Arc<T>, arrays, and PathBuf. |
Comments suppressed due to low confidence (4)
agdb_api/rust/src/test_server.rs:125
- The
#[agdb::impl_def]-annotated impl blocks in this module won't be surfaced viaTypeDefinition::impl_defs()unless the corresponding structs are annotated with#[type_def(...)](e.g.#[type_def(inherent)],#[type_def(inherent, Drop)]). As-is, the generated__*_impl_defhelper fns will be unused (potentialdead_codewarnings) and the impl signatures won't appear in reflection.
agdb_api/rust/src/test_server.rs:431 - The timeout message uses
{TEST_TIMEOUT}seconds, butTEST_TIMEOUTis compared againstnow.elapsed().as_millis()(so it is milliseconds). This message should either convert to seconds (TEST_TIMEOUT / 1000) or change the wording to milliseconds, and also add a space before the unit for readability.
agdb_api/rust/src/test_server.rs:13 - This module unconditionally imports
agdb::type_def::{Struct, TypeDefinition}, butagdb::type_defonly exists with theagdb/apifeature. Ifagdb_apiis built withtest_serverbut withoutapi, this will fail to compile. Consider gating these imports and the relatedTypeDefinitionimpls behindcfg(feature = "api"), or maketest_serverimplyapi.
agdb_api/rust/src/test_server.rs:89 TestServer,TestServerImpl, andTestClusterderiveagdb::TypeDefunconditionally. TheTypeDefderive is only re-exported byagdbwhen theagdb/apifeature is enabled, so this will not compile for consumers enabling onlyagdb_api'stest_serverfeature. Gate these derives withcfg_attr(feature = "api", derive(...))(or maketest_serverdepend onapi).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agnesoft
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.