-
-
Notifications
You must be signed in to change notification settings - Fork 1
test: add unit tests for drift_checker.py (issue #2834) #3428
Copy link
Copy link
Open
Description
Summary
autobot-slm-backend/services/drift_checker.py was added in commit 0dba8915b (#2834) with no accompanying unit tests. The service contains non-trivial logic that warrants test coverage.
File: autobot-slm-backend/services/drift_checker.py
What needs testing
_file_checksum()— correct SHA-256 for a known file_collect_checksums()— skips_SKIP_DIRS, only includes_INCLUDE_EXTENSIONS, returns correct relative pathscompute_drift()— correctly classifies files asmodified,source_only,deployed_only; handles missing source/deployed dirs gracefully; returns correcttotal_comparedcountbuild_drift_report()— correct schema shape anddrift_detectedflagget_default_source_dir()/get_default_deployed_dir()— env var override respected; fallback to root when subdir missing
Test file location
autobot-slm-backend/services/drift_checker_test.py (co-located with source, per project convention)
Related
- feat: code-sync should detect deployed-vs-source file mismatches #2834 — original implementation
- bug: path traversal in GET /code-sync/drift component query param #3427 — path traversal fix (allowlist should also be tested)
Reactions are currently unavailable