-
Notifications
You must be signed in to change notification settings - Fork 0
Phase3 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Phase 3: Systemd Unit Infrastructure - Timer/service unit file syntax documented - Generation patterns from go-systemd analyzed - Configurable path pattern for testability - SystemctlRunner interface pattern established
Phase 03: Systemd Unit Infrastructure - 3 plan(s) in 2 wave(s) - Wave 1: 03-01 + 03-02 (parallel) - Wave 2: 03-03 (depends on 01 + 02) - Ready for execution
- SystemctlRunner interface with DaemonReload, Enable, Disable, Start, Stop, IsActive, IsEnabled - DefaultSystemctlRunner executes real systemctl commands - SetRunner function for test injection with cleanup function - runSystemctl helper function for consistent command execution
- MockSystemctlRunner implements SystemctlRunner interface - Captures called state and unit names for all methods - Configurable results and errors for test scenarios
- Add TimerConfig struct for timer unit configuration - Add ServiceConfig struct for service unit configuration - Add GenerateTimer function with [Unit], [Timer], [Install] sections - Add GenerateService function with [Unit], [Service] sections - Use strings.Builder for efficient string building
- Add TestGenerateTimer with 4 test cases (minimal, persistent, delay, full) - Add TestGenerateService with 2 test cases (minimal, oneshot) - Add TestGenerateTimerSectionOrder to verify section ordering - Add TestGenerateServiceSectionOrder to verify section ordering - Use table-driven tests with contains/excludes verification - 8 test cases total, 227 lines of test code
Tasks completed: 2/2 - Create SystemctlRunner interface and DefaultSystemctlRunner - Create MockSystemctlRunner for testing SUMMARY: .planning/phases/03-systemd-unit-infrastructure/03-02-SUMMARY.md
Tasks completed: 2/2 - Create unit types and generation functions - Create comprehensive unit generation tests SUMMARY: .planning/phases/03-systemd-unit-infrastructure/03-01-SUMMARY.md
- Manager struct with UnitPath and SystemctlRunner - NewManager() with defaults, NewTestManager() for testing - Install() writes timer and service files atomically - Remove() stops, disables, and removes unit files - Exists() checks if unit files are present - All operations call daemon-reload
- TestInstall: successful install, existing files, daemon-reload error - TestInstall_CleanupOnPartialFailure: timer removed if service fails - TestRemove: successful/idempotent remove, stop/disable/reload failures - TestExists: timer only, service only, both, neither - TestNewManager/TestNewTestManager: constructor verification - 16 test cases total, all using t.TempDir() and MockSystemctlRunner
Tasks completed: 2/2 - Create Manager with Install/Remove operations - Create comprehensive Manager tests SUMMARY: .planning/phases/03-systemd-unit-infrastructure/03-03-SUMMARY.md Phase 3 complete - all systemd unit infrastructure in place
Phase 3: Systemd Unit Infrastructure - 3 plans in 2 waves - All plans executed and verified - AUTO-01 requirement complete
Signed-off-by: Brian Ketelsen <bketelsen@gmail.com>
Signed-off-by: Brian Ketelsen <bketelsen@gmail.com>
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.
No description provided.