Add tests for Runit::Config#render
What does this merge request do and why?
This merge request adds comprehensive test coverage for the Runit::Config#render method, which is a critical component of GDK's service management system responsible for setting up runit service configuration.
This MR implements tests covering:
- Directory creation (services_dir and log_dir) for both new and existing directories.
- Service processing pipeline execution in the correct order with proper arguments
- Cleanup of stale service's symlinks
- When
renderis called with emptyservicesarray - Individual helper method called by
rendermethod with correct template creation and call to write the content to file - Methods related to writing content to file with correct permission and skipping file writes in case not needed
Issue: #2897
How to set up and validate locally
- Check out this merge request's branch.
- Run the new tests:
bundle exec rspec spec/lib/runit/config_spec.rb
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This MR references an issue describing the change. -
This change is backward compatible. If not, include steps to communicate to users. -
Tests added for new functionality. If not, raise an issue to follow-up. -
Observability added/updated (logging, metrics, tracing). -
Documentation added/updated. -
Announcement added for notable changes. -
gdk doctortest added.