Repository navigation
Test BackupService's failed-update and relative-directory paths - #74
Conversation
A repository directory that exists but is not a Git repository is reported as a failed update without being cloned over, and a relative backup.directory is resolved and normalized. Neither was asserted by any test before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Self-review rubric (scored against the diff and the CI run on the PR head):
Observations (judgment calls, none blocking):
This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
|
Correction to the last observation in the self-review above: the reason is reported. JGit's This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
Summary
Stage B (unit-test expansion) cycle for
BackupService, with no production code changed.testBackupUserRepositories_ExistingDirectoryThatIsNotARepositoryFailsToUpdate: when a repository's directory already exists but is not a Git repository, the update fails (✗ Failed to update: …andFailed to backup repo1: Failed to update repositoryon standard error). The directory is not cloned over, its contents are left untouched, the other repository is still cloned, and the thrown summary names onlyrepo1. Before this test, no test ran theIOExceptionbranch ofbackupRepository's update path.testBackupDirectory_RelativePathIsResolvedAgainstWorkingDirectoryAndNormalized: a relativebackup.directorycontaining..is resolved against the working directory and normalized, as shown by the exact pathshowBackupStatusprints. The existingtestBackupDirectory_IsAbsoluteonly asserts that nothing is thrown. It was left unchanged and the new test was added beside it.captureStderrhelper, written to match the existingcaptureStdout.CHANGELOG.md[Unreleased]→Addedentry.Before this cycle, a documentation accuracy sweep (Stage A) was run.
CONFIG.md,COMMANDS.md,USER_GUIDE.mdandREADME.mdwere checked againstapplication*.properties,BackupCommandLineRunner,BackupController,BackupService,ScheduledBackupService,GitHubServiceandTraceInstallId, and no drift was found. For that reason, the cycle was spent on test expansion instead.Test plan
mvn test -Dtest=BackupServiceTest: 29 tests run, 0 failuresmvn test: 230 tests run, 0 failures, 0 errors, 1 skipped (the same skip as onmain), BUILD SUCCESSBuildgreen on the PR headSkipped issues
LICENSE): deferred, as in earlier cycles. Picking the license, copyright holder and year is a decision for the maintainer.No tracking issue: this test-coverage gap was found during triage.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson