Repository navigation
Test UsageReportingService's value handling and no-home path - #76
Merged
Merged
Conversation
Lock in that only "false" turns reporting off (any case, trimmed) while values such as "no", "0" and "off" leave it on, as COMMANDS.md documents; that the version is trimmed and a blank or missing one becomes "unknown"; that the installation ID file sits next to the notice marker; and that without a usable home directory no marker, installation ID or first-run notice exists while the startup event is still sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
This is a Stage B (unit-test expansion) cycle. Only characterization tests are added. No production code is changed.
false(any case, with surrounding spaces trimmed) turns reporting off.no,0,off,disabledandtrueleave it on, which is whatCOMMANDS.mddocuments forUSAGE_REPORTING_ENABLED("Any other value ... leaves reporting on").versionOrUnknowntrims the value.null, an empty value, a blank value or the unfiltered@project.version@placeholder is sent asunknown.installIdFileresolves totrace-install-idnext to the notice marker and returnsnullwhen there is no marker.defaultNoticeMarker()returnsnullwhenuser.homeis blank or unset. With no marker, there is no installation ID and no first-run notice, but thestartupevent is still sent, with only theversiontag.CHANGELOG.md[Unreleased]entry is added, following the convention of earlier test-expansion PRs.The new tests follow
UsageReportingServiceTest's existing descriptive naming and stub-server pattern. Its methods don't use thetest<Method>_<Scenario>naming, so mixing the two styles in one file was avoided.Finding filed separately
The no-home test shows that reporting runs with no first-run notice in that case.
CONFIG.md/README.mdsay the notice is always logged on first run. Per the characterization rule, production code is left unchanged and the discrepancy is filed as #75.Triage and skip reasons
LICENSE) is skipped again because choosing a license and copyright holder is a maintainer decision.README.md,COMMANDS.md,CONFIG.mdandUSER_GUIDE.mdwere checked againstBackupCommandLineRunner,BackupController,BackupRequest,BackupService,ScheduledBackupService,GitHubService,RateLimitNoticeHandler,UsageReportingServiceand theapplication*.propertiesfiles. Stage B was chosen instead.Test plan
mvn test -Dtest=UsageReportingServiceTest: 14 run, 0 failures, 0 skipped (5 of them new)mvn test: 235 run, 0 failures, 0 errors, 1 skipped (the skip predates this change)Buildgreen on the PR headNo tracking issue: this 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