Skip to content

refactor: move ark prerequisites into resources#297

Open
damacus wants to merge 3 commits intomainfrom
fix/ark-rspec-ostruct
Open

refactor: move ark prerequisites into resources#297
damacus wants to merge 3 commits intomainfrom
fix/ark-rspec-ostruct

Conversation

@damacus
Copy link
Copy Markdown
Member

@damacus damacus commented Apr 21, 2026

Summary

  • move ark prerequisite installation and default resolution into custom resources
  • sync the Kitchen and GitHub Actions platform matrix to the current Linux test set and update metadata support declarations to match
  • replace network-bound archive fixtures in the test cookbook with local cookbook fixtures so the default Kitchen suite is deterministic

Test coverage changes

The platform-specific package selection logic no longer lives in recipes/default. That recipe now delegates to ark_prereq, and the platform dependency matrix now lives in libraries/platform_defaults.rb.

Coverage is split accordingly:

  • spec/libraries/platform_defaults_spec.rb covers the platform package matrix
  • spec/resources/prereq_spec.rb covers resource-level converge behavior
  • spec/recipes/default_spec.rb covers the compatibility wrapper entrypoint

The Kitchen fixtures were also updated so the default suite exercises archive handling without depending on external TLS endpoints.

Testing

  • cookstyle
  • /opt/chef-workstation/embedded/bin/rspec --format documentation
  • env KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen list
  • env KITCHEN_LOCAL_YAML=kitchen.exec.yml kitchen list
  • env KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen test default-ubuntu-2404 --destroy=always

damacus added 2 commits March 16, 2026 09:13
Ruby 3.2+ no longer auto-loads OpenStruct. The spec_helper uses

OpenStruct for test doubles but was missing the explicit require.
@damacus damacus requested a review from a team as a code owner April 21, 2026 09:33
@github-actions
Copy link
Copy Markdown

Slowest examples

Top 10 slowest examples (0.47 seconds, 60.1% of total time)
Example Description Time in seconds
spec/recipes/default_spec.rb:6 ark::default delegates prerequisite installation to the custom resource 0.10388
spec/resources/default_spec.rb:73 ark install with append_env_path binary is not already in the environment path installs 0.06627
spec/resources/default_spec.rb:327 ark install_with_make installs with make 0.04805
spec/resources/default_spec.rb:357 ark configure configures 0.03861
spec/resources/default_spec.rb:8 ark install installs 0.038
spec/resources/default_spec.rb:43 ark install with binaries installs 0.03761
spec/resources/default_spec.rb:113 ark install with append_env_path binary is already in the environment path installs 0.03532
spec/resources/default_spec.rb:34 ark install without dependencies skips prerequisite installation 0.03506
spec/resources/default_spec.rb:220 ark unzip unzips 0.0345
spec/resources/default_spec.rb:152 ark install on windows installs 0.03395

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