Skip to content

Add 77 unit tests for 6 previously untested modules#3

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782257380-add-unit-tests-coverage
Open

Add 77 unit tests for 6 previously untested modules#3
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782257380-add-unit-tests-coverage

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Adds comprehensive unit test coverage for the 6 modules with zero existing tests, bringing 77 new tests across 2 crates.

Modules covered (by test count)

Module Tests Key areas
app_paths.rs 26 normalize_codex_app_path, build_codex_executable, find_latest_codex_app_dir (version sorting, nested app/ dir), codex_app_version (Windows package + macOS plist), packaged_app_user_model_id, find_macos_codex_app, user_data_candidates_from, latest_appx_install_location_from_output
user_scripts.rs 17 UserScriptManager config save/load roundtrip, set_global_enabled, set_script_enabled, delete_user_script with path traversal rejection, inventory JSON shape, build_enabled_bundle (global disable, per-script disable), market_script_filename sanitization, .js-only file filtering
script_market.rs 11 parse_market_manifest version defaulting, required field validation (skips entries missing id/name/version/url), empty/whitespace field rejection, updated_at trimming, tag filtering, install_market_script_content file write + config recording
codex_sqlite.rs 10 codex_sqlite_sidecar_paths (-wal/-shm), relative_to_codex_home, session DB discovery preferring sqlite/codex-dev.db over legacy state_5.sqlite, extension filtering (.db/.sqlite/.sqlite3), skipping DBs without session tables
backup.rs 7 BackupStore write/read roundtrip, auto-create root dir, path_for token sanitization (strips ../ and special chars), unique token generation, pretty-print format
diagnostic_log.rs 6 append_diagnostic_log write + append + parent dir creation, diagnostic_log_path test override, all tests serialized via Mutex to avoid global TEST_LOG_PATH races

Pre-existing failure

settings::tests::settings_store_save_load_roundtrip_preserves_aggregate_relay_settings fails on main — the aggregate profile's base_url/api_key fields are mutated during save/load. Not introduced by this PR.

Link to Devin session: https://app.devin.ai/sessions/46084a7743e34be7a0fb8b620e418695
Requested by: @ManhND226677

Add comprehensive test coverage for modules that had zero tests:

- app_paths.rs (26 tests): normalize/build/find functions for Codex app paths,
  version extraction, macOS/Windows package resolution, user data candidates
- user_scripts.rs (17 tests): UserScriptManager config CRUD, script enable/disable,
  delete with path traversal protection, inventory, bundle building, market filename
- script_market.rs (11 tests): manifest parsing, field validation, missing/empty
  field handling, tag filtering, install_market_script_content
- diagnostic_log.rs (6 tests): append/read log entries, path override, directory
  creation, serialized via mutex to avoid global state races
- codex_sqlite.rs (10 tests): sidecar paths, relative path resolution, session DB
  discovery with sqlite dir vs legacy fallback, extension filtering
- backup.rs (7 tests): write/read roundtrip, directory creation, token sanitization,
  path traversal prevention, unique token generation

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ManhND226677 ManhND226677 self-assigned this Jun 23, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant