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 render is called with empty services array
  • Individual helper method called by render method 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

  1. Check out this merge request's branch.
  2. Run the new tests:
    bundle exec rspec spec/lib/runit/config_spec.rb

Impacted categories

The following categories relate to this merge request:

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 doctor test added.

Merge request reports

Loading