From 612a8841f88d2c43651eb5d52ca36327ed6457a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 14 Sep 2026 06:13:44 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20spec=5Fbounds=20rows=20f?= =?UTF-8?q?or=20split=20login=20DTOs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Person-scoped login replaced Credentials with RegisterCredentials, LoginCredentials, and SelectSchool. The bound table still named the old schema, so CI's full suite failed after 50 minutes. --- README.md | 2 +- tests/spec_bounds.rs | 48 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index be1d056..fbcf99d 100644 --- a/README.md +++ b/README.md @@ -649,7 +649,7 @@ drift from it**, which is enforced rather than asked for: and fails unless each one is either referenced by `src/web/limits.rs` or listed as a deliberate exclusion *with a reason*. A new constant breaks the suite until someone decides, consciously, whether clients need it. -- `tests/spec_bounds.rs` builds the OpenAPI document, reads all 194 published +- `tests/spec_bounds.rs` builds the OpenAPI document, reads all 200 published bounds back out of the emitted JSON, and asserts each equals its constant. This exists because utoipa's `#[schema(max_length = …)]` accepts a **literal only** — a `const` there does not compile — so the annotations are diff --git a/tests/spec_bounds.rs b/tests/spec_bounds.rs index 696a513..282d116 100644 --- a/tests/spec_bounds.rs +++ b/tests/spec_bounds.rs @@ -159,32 +159,68 @@ fn expectations() -> Vec<(&'static str, &'static str, &'static str, i64)> { MAX_PASSWORD_LEN as i64, ), // --- auth / users / notes / messages --- - ("Credentials", "school", "minLength", MIN_SLUG_LEN as i64), - ("Credentials", "school", "maxLength", MAX_SLUG_LEN as i64), ( - "Credentials", + "RegisterCredentials", + "school", + "minLength", + MIN_SLUG_LEN as i64, + ), + ( + "RegisterCredentials", + "school", + "maxLength", + MAX_SLUG_LEN as i64, + ), + ( + "RegisterCredentials", + "username", + "minLength", + MIN_USERNAME_LEN as i64, + ), + ( + "RegisterCredentials", + "username", + "maxLength", + MAX_USERNAME_LEN as i64, + ), + ( + "RegisterCredentials", + "password", + "minLength", + MIN_PASSWORD_LEN as i64, + ), + ( + "RegisterCredentials", + "password", + "maxLength", + MAX_PASSWORD_LEN as i64, + ), + ( + "LoginCredentials", "username", "minLength", MIN_USERNAME_LEN as i64, ), ( - "Credentials", + "LoginCredentials", "username", "maxLength", MAX_USERNAME_LEN as i64, ), ( - "Credentials", + "LoginCredentials", "password", "minLength", MIN_PASSWORD_LEN as i64, ), ( - "Credentials", + "LoginCredentials", "password", "maxLength", MAX_PASSWORD_LEN as i64, ), + ("SelectSchool", "school", "minLength", MIN_SLUG_LEN as i64), + ("SelectSchool", "school", "maxLength", MAX_SLUG_LEN as i64), ("UpdateProfile", "name", "maxLength", MAX_NAME_LEN as i64), ("UpdateProfile", "surname", "maxLength", MAX_NAME_LEN as i64), ("UpdateProfile", "email", "maxLength", MAX_EMAIL_LEN as i64),