refactor testing crates (#1166)

This commit is contained in:
Brandon Thomas
2026-03-18 21:06:46 -04:00
committed by GitHub
parent 5caa578b86
commit ebe365703b
59 changed files with 79 additions and 79 deletions
Generated
+21 -21
View File
@@ -4070,7 +4070,7 @@ dependencies = [
"serde",
"strum 0.28.0",
"test_data",
"testing",
"test_utils",
"tokio",
"url",
"workspace-build-acceleration",
@@ -4128,7 +4128,7 @@ dependencies = [
"ffprobe",
"log",
"tempdir",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -4160,7 +4160,7 @@ dependencies = [
"base64 0.22.1",
"errors",
"mimetypes",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -4170,7 +4170,7 @@ version = "0.0.1"
dependencies = [
"errors",
"log",
"testing",
"test_utils",
"walkdir",
"workspace-build-acceleration",
]
@@ -4800,7 +4800,7 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -4853,7 +4853,7 @@ dependencies = [
"serde_json",
"sha2 0.11.0-rc.5",
"test_data",
"testing",
"test_utils",
"tokio",
"url",
"uuid 1.22.0",
@@ -5718,7 +5718,7 @@ version = "0.0.1"
dependencies = [
"errors",
"image",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -5730,7 +5730,7 @@ dependencies = [
"errors",
"image",
"mimetypes",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -5847,7 +5847,7 @@ dependencies = [
"subprocess",
"subprocess_common",
"tempdir",
"testing",
"test_utils",
"thumbnail_generator",
"time",
"tokens",
@@ -6888,7 +6888,7 @@ dependencies = [
"serde",
"serde_json",
"test_data",
"testing",
"test_utils",
"tokio",
"url",
"workspace-build-acceleration",
@@ -6968,7 +6968,7 @@ version = "0.0.1"
dependencies = [
"anyhow",
"infer 0.19.0",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -7113,7 +7113,7 @@ dependencies = [
"serde_derive",
"serde_json",
"test_data",
"testing",
"test_utils",
"tokio",
"url",
"workspace-build-acceleration",
@@ -7865,7 +7865,7 @@ dependencies = [
"serde_derive",
"serde_json",
"sha3",
"testing",
"test_utils",
"thiserror 2.0.18",
"tokio",
"toml 1.0.7+spec-1.1.0",
@@ -7897,7 +7897,7 @@ dependencies = [
"serde_json",
"sha3",
"subprocess_common",
"testing",
"test_utils",
"thiserror 2.0.18",
"tokio",
"toml 1.0.7+spec-1.1.0",
@@ -8624,7 +8624,7 @@ name = "primitives"
version = "0.0.1"
dependencies = [
"assertor",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -9731,7 +9731,7 @@ dependencies = [
"serde_json",
"sha3",
"subprocess_common",
"testing",
"test_utils",
"thiserror 2.0.18",
"tokio",
"toml 1.0.7+spec-1.1.0",
@@ -10289,7 +10289,7 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"testing",
"test_utils",
"tokio",
"url",
"workspace-build-acceleration",
@@ -11376,7 +11376,7 @@ dependencies = [
"strum_macros 0.26.4",
"tempdir",
"tempfile",
"testing",
"test_utils",
"thumbnail_generator",
"time",
"tokens",
@@ -12323,7 +12323,7 @@ dependencies = [
]
[[package]]
name = "testing"
name = "test_utils"
version = "0.0.1"
dependencies = [
"errors",
@@ -13514,7 +13514,7 @@ dependencies = [
"errors",
"log",
"mp4",
"testing",
"test_utils",
"workspace-build-acceleration",
]
@@ -14938,7 +14938,7 @@ dependencies = [
"serde_json",
"sha2 0.11.0-rc.5",
"test_data",
"testing",
"test_utils",
"tokio",
"url",
"uuid 1.22.0",
+4 -4
View File
@@ -88,8 +88,8 @@ members = [
"crates/lib/sqlx_mysql_helpers",
"crates/lib/storyteller_root",
"crates/lib/deprecated/subprocess_common",
"crates/lib/test_data",
"crates/lib/testing",
"crates/testing/test_data",
"crates/testing/test_utils",
"crates/lib/deprecated/tts_common",
"crates/lib/url_config",
"crates/lib/url_utils",
@@ -252,8 +252,8 @@ seedance2pro_client = { path = "crates/api_clients/seedance2pro_client" }
shared_service_components = { path = "crates/lib/shared_service_components" }
sqlite_tasks = { path = "crates/schema/database/sqlite_tasks" }
subprocess_common = { path = "crates/lib/deprecated/subprocess_common" }
test_data = { path = "crates/lib/test_data" }
testing = { path = "crates/lib/testing" }
test_data = { path = "crates/testing/test_data" }
test_utils = { path = "crates/testing/test_utils" }
tokens = { path = "crates/schema/public/tokens" }
url_utils = { path = "crates/lib/url_utils" }
users = { path = "crates/lib/users" }
+1 -1
View File
@@ -35,5 +35,5 @@ url.workspace = true
fal = { path = "../../vendor/fal-rs", features = ["endpoints"] }
[dev-dependencies]
testing = { path = "../../lib/testing" }
test_utils = { path = "../../testing/test_utils" }
test_data.workspace = true
@@ -45,7 +45,7 @@ mod tests {
use crate::requests::queue::enqueue_hunyuan2_image_to_3d::{enqueue_hunyuan2_image_to_3d, Hunyuan2Args};
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[tokio::test]
#[ignore]
@@ -57,7 +57,7 @@ mod tests {
use crate::requests::queue::remove_background_rembg::remove_background_rembg;
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[tokio::test]
#[ignore]
@@ -75,7 +75,7 @@ mod tests {
use crate::requests::queue::video_gen::enqueue_kling_16_pro_image_to_video::{enqueue_kling_16_pro_image_to_video, Kling16ProArgs, Kling16ProAspectRatio, Kling16ProDuration};
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[tokio::test]
#[ignore]
@@ -43,7 +43,7 @@ mod tests {
use crate::requests::queue::video_gen::enqueue_minimax_01_image_to_video::{enqueue_minimax_01_image_to_video, Minimax01Args};
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[tokio::test]
#[ignore]
+1 -1
View File
@@ -37,5 +37,5 @@ serde_derive.workspace = true
serde_json.workspace = true
[dev-dependencies]
testing = { path = "../../lib/testing" }
test_utils = { path = "../../testing/test_utils" }
coarsetime = "0.1.34" # To set the clock for testing
@@ -66,7 +66,7 @@ mod tests {
use crate::certs::jwk_to_public_key::jwk_to_public_key;
use jwt_simple::algorithms::RSAPublicKeyLike;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn test_jwk_payload_decode() {
@@ -78,7 +78,7 @@ mod tests {
use jwt_simple::prelude::VerificationOptions;
use std::collections::HashSet;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
/*
Example payload:
iss https://accounts.google.com
+1 -1
View File
@@ -44,7 +44,7 @@ wreq.workspace = true
[dev-dependencies]
filesys.workspace = true
test_data.workspace = true
testing.workspace = true
test_utils.workspace = true
log4rs = "1.4.0"
env_logger.workspace = true
env.workspace = true
@@ -37,4 +37,4 @@ dom_query = "0.20.2"
[dev-dependencies]
filesys.workspace = true
test_data.workspace = true
testing.workspace = true
test_utils.workspace = true
+2 -2
View File
@@ -28,6 +28,6 @@ url.workspace = true
[dev-dependencies]
env.workspace = true
env_logger.workspace = true
test_data = { path = "../../lib/test_data" }
testing = { path = "../../lib/testing" }
test_data = { path = "../../testing/test_data" }
test_utils = { path = "../../testing/test_utils" }
tokio = { version = "1", features = ["full"] }
@@ -43,4 +43,4 @@ wreq-util.workspace = true
wreq.workspace = true
[dev-dependencies]
testing = { path = "../../lib/testing" }
test_utils = { path = "../../testing/test_utils" }
@@ -303,7 +303,7 @@ mod tests {
use crate::requests::deprecated::job_status::sora_job_status::{get_image_gen_status, save_generations_to_dir, StatusRequest, VideoGenStatusResponse};
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[ignore]
#[tokio::test]
@@ -50,7 +50,7 @@ mod tests {
use crate::requests::deprecated::job_status::unimplemented_sora_job_status::unimplemented_sora_job_status;
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[ignore]
#[tokio::test]
@@ -56,7 +56,7 @@ mod tests {
use crate::requests::image_gen::sora_image_gen_remix::{sora_image_gen_remix, SoraImageGenRemixRequest};
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[ignore] // You can manually run "ignore" tests in the IDE, but they won't run in CI.
#[tokio::test]
@@ -59,7 +59,7 @@ mod tests {
use crate::requests::upload::upload_media_from_file::sora_media_upload_from_file;
use crate::test_utils::get_test_credentials::get_test_credentials;
use errors::AnyhowResult;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[ignore] // You can manually run "ignore" tests in the IDE, but they won't run in CI.
#[tokio::test]
@@ -59,7 +59,7 @@ mod tests {
use crate::requests::upload::upload_media_from_file::sora_media_upload_from_file;
use errors::AnyhowResult;
use std::fs::read_to_string;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[ignore] // You can manually run "ignore" tests in the IDE, but they won't run in CI.
#[tokio::test]
+1 -1
View File
@@ -41,5 +41,5 @@ tokio.workspace = true
toml.workspace = true
[dev-dependencies]
testing = { path = "../../lib/testing" }
test_utils = { path = "../../testing/test_utils" }
filesys.workspace = true
@@ -118,7 +118,7 @@ mod tests {
use crate::requests::get_session_request::get_session_request;
use crate::requests::upload_image_from_file_request::upload_image_from_file_request;
use errors::AnyhowResult;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[tokio::test]
#[ignore] // Do not run in CI. Run manually to test session retrieval.
@@ -42,5 +42,5 @@ tokio.workspace = true
toml.workspace = true
[dev-dependencies]
testing = { path = "../../lib/testing" }
test_utils = { path = "../../testing/test_utils" }
filesys.workspace = true
@@ -33,5 +33,5 @@ url.workspace = true
[dev-dependencies]
env.workspace = true
env_logger.workspace = true
testing = { path = "../../lib/testing" }
test_utils = { path = "../../testing/test_utils" }
tokio = { version = "1", features = ["full"] }
@@ -48,7 +48,7 @@ wreq.workspace = true
[dev-dependencies]
filesys.workspace = true
test_data.workspace = true
testing.workspace = true
test_utils.workspace = true
log4rs = "1.4.0"
env_logger.workspace = true
env.workspace = true
+1 -1
View File
@@ -34,7 +34,7 @@ workspace-build-acceleration.workspace = true
[dev-dependencies]
# Internal
testing.workspace = true
test_utils.workspace = true
# External
assertor = "0.0.3"
@@ -15,7 +15,7 @@ mod tests {
use crate::iterators::iterate_trimmed_lines_without_comments::iterate_trimmed_lines_without_comments;
use std::fs::File;
use std::io::Read;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn load_file() {
@@ -27,4 +27,4 @@ errors = { path = "../../errors" }
image = "0.25.6"
[dev-dependencies]
testing = { path = "../../testing" }
test_utils = { path = "../../../testing/test_utils" }
@@ -60,7 +60,7 @@ pub fn remove_image_border(image: &DynamicImage) -> AnyhowResult<DynamicImage> {
mod tests {
use image::{ImageFormat, ImageReader};
use errors::AnyhowResult;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::remove_image_border::remove_image_border;
#[ignore] // NB: Not going to check these files into the repo. Just for manual testing.
+1 -1
View File
@@ -30,4 +30,4 @@ log.workspace = true
[dev-dependencies]
tempdir.workspace = true
testing.workspace = true
test_utils.workspace = true
@@ -51,7 +51,7 @@ mod tests {
use super::*;
use crate::ffprobe::ffprobe_get_dimensions::ffprobe_get_dimensions;
use tempdir::TempDir;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn test_extract_jpg_thumbnail_from_mp4() {
@@ -50,7 +50,7 @@ pub fn ffmpeg_video_gif_preview<I: AsRef<Path>, O: AsRef<Path>>(
mod tests {
use super::*;
use tempdir::TempDir;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn test_extract_gif_preview_from_mp4() {
@@ -43,7 +43,7 @@ pub fn ffprobe_get_dimensions(
#[cfg(test)]
pub mod tests {
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use super::ffprobe_get_dimensions;
@@ -112,7 +112,7 @@ fn parse_fps(ffprobe_fps: &str) -> AnyhowResult<f32> {
#[cfg(test)]
pub mod tests {
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use super::{ffprobe_get_info, parse_seconds};
@@ -25,4 +25,4 @@ base64.workspace = true
mimetypes.workspace = true
[dev-dependencies]
testing = { path = "../../testing" }
test_utils = { path = "../../../testing/test_utils" }
@@ -28,7 +28,7 @@ pub fn file_to_base64_url<P: AsRef<Path>>(path: P) -> AnyhowResult<String> {
#[cfg(test)]
mod tests {
use errors::AnyhowResult;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::file_to_base64_url::file_to_base64_url;
#[test]
+1 -1
View File
@@ -29,4 +29,4 @@ log.workspace = true
walkdir = "2.4.0"
[dev-dependencies]
testing = { path = "../../testing" }
test_utils = { path = "../../../testing/test_utils" }
@@ -12,7 +12,7 @@ where P: AsRef<Path>, {
#[cfg(test)]
mod tests {
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::file_lines::iterate_file_lines::iterate_file_lines;
#[test]
@@ -33,7 +33,7 @@ where
#[cfg(test)]
mod tests {
use crate::file_lines::iterate_trimmed_file_lines_without_comments::iterate_trimmed_file_lines_without_comments;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn load_file() {
@@ -26,7 +26,7 @@ pub fn recursively_find_file_by_name<P: AsRef<Path>, Q: AsRef<Path>>(
#[cfg(test)]
mod tests {
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::recursively_find_file_by_name::recursively_find_file_by_name;
#[test]
+1 -1
View File
@@ -30,4 +30,4 @@ image = { version = "0.25.6" , features = ["jpeg", "png", "tiff", "webp"] }
[dev-dependencies]
anyhow = { workspace = true }
testing = { path = "../../testing" }
test_utils = { path = "../../../testing/test_utils" }
@@ -67,7 +67,7 @@ impl ImageInfo {
mod tests {
use crate::image_info::image_info::ImageInfo;
use mimetypes::mimetype_info::file_extension::FileExtension;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn jpg_file() -> anyhow::Result<()> {
@@ -28,7 +28,7 @@ pub fn resize_image_file_preserving_aspect<P: AsRef<Path>>(
#[cfg(test)]
mod tests {
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::resize_image_file_preserving_aspect::resize_image_file_preserving_aspect;
@@ -23,7 +23,7 @@ mod tests {
use image::DynamicImage;
use errors::AnyhowResult;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::resize_preserving_aspect::resize_preserving_aspect;
+1 -1
View File
@@ -24,5 +24,5 @@ workspace-build-acceleration = { workspace = true }
infer = "0.19.0" # Mimetype detection
[dev-dependencies]
testing = { path = "../../testing" }
test_utils = { path = "../../../testing/test_utils" }
anyhow = { workspace = true }
@@ -20,7 +20,7 @@ fn gltf_matcher(buf: &[u8]) -> bool {
#[cfg(test)]
mod tests {
use crate::custom::custom_infer::CUSTOM_INFER;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn test_gltf() -> anyhow::Result<()> {
@@ -64,7 +64,7 @@ mod tests {
mod for_files {
use super::*;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
#[test]
fn mp3() -> anyhow::Result<()> {
+1 -1
View File
@@ -31,4 +31,4 @@ log.workspace = true
mp4 = "0.14.0"
[dev-dependencies]
testing.workspace = true
test_utils.workspace = true
+1 -1
View File
@@ -73,7 +73,7 @@ pub mod tests {
use std::fs::File;
use std::io::BufReader;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::get_mp4_info::get_mp4_info;
@@ -102,4 +102,4 @@ zip = "2.1.3"
url = { workspace = true }
[dev-dependencies]
testing = { path = "../../../../lib/testing" }
test_utils = { path = "../../../../testing/test_utils" }
@@ -312,7 +312,7 @@ mod tests {
use zip::ZipArchive;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::job::job_types::gpt_sovits::model_package::model_package::{GptSovitsPackageError, GptSovitsPackageFileType};
use crate::job::job_types::gpt_sovits::upload_model::get_gptsovits_zip_entries::get_gptsovits_zip_entries;
@@ -189,7 +189,7 @@ diesel = { version = "2.2.4", features = ["mysql"] }
[dev-dependencies]
# Testing/Dev Deps: Internal
testing = { path = "../../../lib/testing" }
test_utils = { path = "../../../testing/test_utils" }
# Testing/Dev Deps: External
speculoos = "0.11.0" # Fluent assertions
@@ -98,7 +98,7 @@ pub fn title_to_url_slug(title: &str) -> Option<String> {
#[cfg(test)]
mod tests {
use filesys::file_lines::iterate_file_lines::iterate_file_lines;
use testing::test_file_path::test_file_path;
use test_utils::test_file_path::test_file_path;
use crate::util::title_to_url_slug::title_to_url_slug;
@@ -1,5 +1,5 @@
[package]
name = "testing"
name = "test_utils"
edition = "2018"
version = "0.0.1"
authors = [
@@ -11,7 +11,7 @@ publish = false
[lib]
# NB: Public "testing" crate is used by the "swc" project as an internal project.
# It isn't a crate meant to be consumed by others, so we'll use it internally.
name = "testing"
name = "test_utils"
path = "src/lib.rs"
[package.metadata.cargo-udeps.ignore]
@@ -20,7 +20,7 @@ normal = ["workspace-build-acceleration"]
[dependencies]
# Internal
errors = { path = "../errors" }
errors = { path = "../../lib/errors" }
# Workspace hack (faster compile times)
workspace-build-acceleration = { version = "0.1", path = "../../workspace-build-acceleration" }