Add 77 unit tests for 6 previously untested modules#3
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add 77 unit tests for 6 previously untested modules#3devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
app_paths.rsnormalize_codex_app_path,build_codex_executable,find_latest_codex_app_dir(version sorting, nestedapp/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_outputuser_scripts.rsUserScriptManagerconfig save/load roundtrip,set_global_enabled,set_script_enabled,delete_user_scriptwith path traversal rejection,inventoryJSON shape,build_enabled_bundle(global disable, per-script disable),market_script_filenamesanitization,.js-only file filteringscript_market.rsparse_market_manifestversion defaulting, required field validation (skips entries missing id/name/version/url), empty/whitespace field rejection,updated_attrimming, tag filtering,install_market_script_contentfile write + config recordingcodex_sqlite.rscodex_sqlite_sidecar_paths(-wal/-shm),relative_to_codex_home, session DB discovery preferringsqlite/codex-dev.dbover legacystate_5.sqlite, extension filtering (.db/.sqlite/.sqlite3), skipping DBs without session tablesbackup.rsBackupStorewrite/read roundtrip, auto-create root dir,path_fortoken sanitization (strips../and special chars), unique token generation, pretty-print formatdiagnostic_log.rsappend_diagnostic_logwrite + append + parent dir creation,diagnostic_log_pathtest override, all tests serialized viaMutexto avoid globalTEST_LOG_PATHracesPre-existing failure
settings::tests::settings_store_save_load_roundtrip_preserves_aggregate_relay_settingsfails onmain— the aggregate profile'sbase_url/api_keyfields are mutated during save/load. Not introduced by this PR.Link to Devin session: https://app.devin.ai/sessions/46084a7743e34be7a0fb8b620e418695
Requested by: @ManhND226677