From 7f21ed99c879664d652d1a7d524895007985ab73 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Tue, 11 Aug 2026 17:32:32 -0400 Subject: [PATCH] test: allow deprecated OrganizationInput::domains in handwritten tests The spec is about to mark the organization input's `domains` field as deprecated (workos/openapi-spec#103), which the Rust emitter renders as `#[deprecated]`. Struct literals must name every field, so the handwritten tests constructing OrganizationInput trip the deprecation lint, which clippy's -D warnings escalates to an error. Allowing the lint on the four affected test fns is inert until the deprecation lands, so this can merge ahead of the spec update. --- tests/request_options_and_errors_test.rs | 3 +++ tests/retry_safety_test.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/tests/request_options_and_errors_test.rs b/tests/request_options_and_errors_test.rs index 4c53d3cf..bef07cb6 100644 --- a/tests/request_options_and_errors_test.rs +++ b/tests/request_options_and_errors_test.rs @@ -10,6 +10,9 @@ use wiremock::matchers::{header, header_exists, method, path}; use wiremock::{Mock, MockServer, ResponseTemplate}; use workos::{Error, RequestOptions}; +// `OrganizationInput::domains` is deprecated in the spec, but struct literals +// must name every field, so tests constructing the input allow the lint. +#[allow(deprecated)] #[tokio::test] async fn idempotency_key_is_sent_as_header() { let server = MockServer::start().await; diff --git a/tests/retry_safety_test.rs b/tests/retry_safety_test.rs index 32d2a2f4..d42d09a4 100644 --- a/tests/retry_safety_test.rs +++ b/tests/retry_safety_test.rs @@ -83,6 +83,9 @@ async fn get_retries_on_5xx_up_to_max_retries() { assert_eq!(transport.calls(), 3); } +// `OrganizationInput::domains` is deprecated in the spec, but struct literals +// must name every field, so tests constructing the input allow the lint. +#[allow(deprecated)] #[tokio::test] async fn post_does_not_retry_without_idempotency_key() { let transport = Arc::new(CountingTransport::new(503)); @@ -104,6 +107,7 @@ async fn post_does_not_retry_without_idempotency_key() { assert_eq!(transport.calls(), 1); } +#[allow(deprecated)] #[tokio::test] async fn post_retries_with_idempotency_key() { let transport = Arc::new(CountingTransport::new(503)); @@ -156,6 +160,7 @@ async fn retry_after_header_is_honored() { assert_eq!(transport.calls(), 3); } +#[allow(deprecated)] #[tokio::test] async fn idempotent_strategy_overrides_explicit_key() { let transport = Arc::new(CountingTransport::new(503));