test(filename_audit): seed library 2 before its image_exif row (#151) #154

Merged
cameron merged 1 commits from fix/filename-audit-test-fk into master 2026-09-30 01:53:21 +00:00
Owner

Summary

filename_audit::tests::run_audit_skips_disabled_and_offline_libraries failed on master: it seeded an image_exif row for library 2, which migrations never create (they only seed library 1), so the insert tripped the image_exif.library_id foreign key.

  • Insert the libraries row for library 2 before seeding its image_exif row. The test still asserts what its name says: the offline (2) and disabled (3) libraries are skipped and only library 1 is audited.
  • Fix the cmp_owned clippy warning in src/bin/filename_audit.rs (compare against Path::new instead of allocating a PathBuf per library).

Verification

  • cargo fmt, cargo clippy --all-targets (0 warnings), cargo build
  • cargo test: all green (782 passed, 0 failed)

Closes #151

🤖 Generated with Claude Code

## Summary `filename_audit::tests::run_audit_skips_disabled_and_offline_libraries` failed on master: it seeded an `image_exif` row for library 2, which migrations never create (they only seed library 1), so the insert tripped the `image_exif.library_id` foreign key. - Insert the `libraries` row for library 2 before seeding its `image_exif` row. The test still asserts what its name says: the offline (2) and disabled (3) libraries are skipped and only library 1 is audited. - Fix the `cmp_owned` clippy warning in `src/bin/filename_audit.rs` (compare against `Path::new` instead of allocating a `PathBuf` per library). ## Verification - `cargo fmt`, `cargo clippy --all-targets` (0 warnings), `cargo build` - `cargo test`: all green (782 passed, 0 failed) Closes #151 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cameron added 1 commit 2026-09-30 01:35:50 +00:00
run_audit_skips_disabled_and_offline_libraries inserted an image_exif
row for library 2, which migrations never create, tripping the
image_exif.library_id foreign key. Insert the libraries row first so
the suite is green on master again.

Also fix the cmp_owned clippy warning in the filename_audit bin.

Closes #151

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cameron merged commit 79b339a2a6 into master 2026-09-30 01:53:21 +00:00
cameron deleted branch fix/filename-audit-test-fk 2026-09-30 01:53:21 +00:00
Sign in to join this conversation.