Skip to content

feat: modernise cookbook structure and ChefSpec#602

Open
damacus wants to merge 3 commits intomainfrom
modernise-cookbook
Open

feat: modernise cookbook structure and ChefSpec#602
damacus wants to merge 3 commits intomainfrom
modernise-cookbook

Conversation

@damacus
Copy link
Member

@damacus damacus commented Mar 14, 2026

Summary

Modernises the cookbook structure, spec organisation, and CI configuration.

Changes

  • frozen_string_literal: Added # frozen_string_literal: true to all Ruby files
  • Resources: Added provides declarations to all custom resources
  • ChefSpec: Renamed spec/unit/recipes/spec/unit/resources/ to reflect resource-based testing
  • ChefSpec: Fixed almalinux/10 spec — platform not bundled in fauxhai gem; use almalinux/9 with node.automatic['platform_version'] = '10' override to test PCRE2 branch
  • metadata.rb: Expanded platform support (almalinux, rocky, oracle, fedora)
  • kitchen.yml: Added default suite, aligned platforms with kitchen.dokken.yml, switched provisioner to chef_infra
  • CI: Aligned matrix with kitchen platforms and suites, added missing platforms, removed duplicates
  • LIMITATIONS.md: Documents known constraints (package availability, source build deps, architecture)
  • Integration: Added default test suite with test recipe and InSpec profile

Testing

  • 29/29 ChefSpec examples pass, 0 failures, no fauxhai download warnings

- Add frozen_string_literal: true to all Ruby files

- Add provides declarations to all resources

- Rename spec/unit/recipes/ to spec/unit/resources/

- Fix almalinux/10 fauxhai spec (use platform override instead of unbundled platform)

- Expand metadata.rb platform support (almalinux, rocky, oracle, fedora)

- Add default kitchen suite with test recipe and InSpec profile

- Align CI matrix with kitchen platforms and suites

- Add LIMITATIONS.md documenting known constraints
@damacus damacus requested a review from a team as a code owner March 14, 2026 21:21
damacus added 2 commits March 14, 2026 21:25
- 3.2 is the current LTS branch (EOL 2030-04-01)

- Update source_version default: 2.8.5 -> 3.2.14

- Update source_checksum to match 3.2.14 tarball

- Update stub_command version refs in specs

- Update test recipe versions and checksums
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (1.13 seconds, 45.88% of total time)
Example Description Time in seconds
spec/unit/resources/frontend_backend_spec.rb:35 haproxy_frontend create frontend and backend with http-request rule placed before use_backend is expected to render file "/etc/haproxy/haproxy.cfg" 0.14976
spec/unit/resources/frontend_backend_spec.rb:36 haproxy_frontend create frontend and backend with http-request rule placed before use_backend is expected not to render file "/etc/haproxy/haproxy.cfg" with content /use_backend admin0 if path_beg /admin0.*http-request add-header Test Value/m 0.14451
spec/unit/resources/cache_spec.rb:47 haproxy_cache create a cache, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.14421
spec/unit/resources/defaults_spec.rb:28 haproxy_config_defaults create a cache, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.11528
spec/unit/resources/listen_spec.rb:84 haproxy_listen extra options hash with disabled option is expected to render file "/etc/haproxy/haproxy.cfg" 0.10665
spec/unit/resources/listen_spec.rb:108 haproxy_listen extra options http-request rule should be placed before use_backend rule is expected not to render file "/etc/haproxy/haproxy.cfg" with content /use_backend admin0 if path_beg /admin0.*http-request add-header Test Value/m 0.10233
spec/unit/resources/peer_spec.rb:47 haproxy_peer create a peers section, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.10057
spec/unit/resources/fastcgi_spec.rb:65 haproxy_fastcgi create a fastcgi resource, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.09418
spec/unit/resources/mailer_spec.rb:50 haproxy_mailer create a mailer, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.09016
spec/unit/resources/listen_spec.rb:107 haproxy_listen extra options http-request rule should be placed before use_backend rule is expected to render file "/etc/haproxy/haproxy.cfg" 0.08921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant