feat(labrinth): database seed data fixtures for better installation and testing (#4132)

* feat(labrinth): database seed data fixtures for better installation and testing

* chore(labrinth): simplify and fixup seed data fixture

* docs(contributing/labrinth): enable all useful features for `sqlx-cli` install

* chore(docs/labrinth): fix typo

* chore(docs/labrinth): fix `cargo fmt` parameter typo

* chore: replace Labrinth -> labrinth
This commit is contained in:
Alejandro González
2025-08-09 16:51:04 +02:00
committed by GitHub
parent 8af65f58d9
commit 3b8cd661bc
11 changed files with 1137 additions and 48 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
"lint": "cargo fmt --check && cargo clippy --all-targets",
"fix": "cargo clippy --all-targets --fix --allow-dirty && cargo fmt",
"dev": "cargo run",
"//": "Labrinth integration tests require a lot of disk space, so in the standard GitHub Actions",
"//": "labrinth integration tests require a lot of disk space, so in the standard GitHub Actions",
"//": "runners we must remove useless development tools from the base image, which frees up ~20 GiB.",
"//": "The command commented out below can be used in CI to debug what is taking up space:",
"//": "sudo du -xh --max-depth=4 / | sort -rh | curl -X POST --data-urlencode content@/dev/fd/0 https://api.mclo.gs/1/log",

View File

@@ -71,7 +71,7 @@ pub fn app_setup(
enable_background_tasks: bool,
) -> LabrinthConfig {
info!(
"Starting Labrinth on {}",
"Starting labrinth on {}",
dotenvy::var("BIND_ADDR").unwrap()
);

View File

@@ -71,7 +71,7 @@ async fn main() -> std::io::Result<()> {
if args.run_background_task.is_none() {
info!(
"Starting Labrinth on {}",
"Starting labrinth on {}",
dotenvy::var("BIND_ADDR").unwrap()
);

View File

@@ -55,10 +55,10 @@ pub fn jemalloc_memory_stats(
) -> Result<(), prometheus::Error> {
let allocated_mem = IntGauge::new(
"labrinth_memory_allocated",
"Labrinth allocated memory",
"labrinth allocated memory",
)?;
let resident_mem =
IntGauge::new("labrinth_resident_memory", "Labrinth resident memory")?;
IntGauge::new("labrinth_resident_memory", "labrinth resident memory")?;
registry.register(Box::new(allocated_mem.clone()))?;
registry.register(Box::new(resident_mem.clone()))?;

View File

@@ -292,7 +292,7 @@ pub async fn add_dummy_data(api: &ApiV3, db: TemporaryDatabase) -> DummyData {
let pool = &db.pool.clone();
pool.execute(
include_str!("../files/dummy_data.sql")
include_str!("../fixtures/dummy_data.sql")
.replace("$1", &Scopes::all().bits().to_string())
.as_str(),
)