Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Define doctor rake task (#496)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Lane <[email protected]>
  • Loading branch information
aaron-lane and Aaron Lane authored Feb 2, 2023
1 parent 694e621 commit d84ef01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Run Kitchen doctor
run: |
status=0
output="$(kitchen doctor doctor)"
output="$(rake test:kitchen:doctor-${{ matrix.operating-system }})"
if [[ $output != *"${{ matrix.operating-system }}.driver.client"* ]]
then
echo "kitchen doctor did not detect driver.client error"
Expand Down
3 changes: 2 additions & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ suites:
shell_command: /bin/sh
shell_options: -x
user: root
- name: doctor
- name: doctor-driver
driver:
client: /nonexistent/pathname
- name: doctor-verifier
verifier:
systems: []
- name: plug-ins
Expand Down
12 changes: 12 additions & 0 deletions test/kitchen/terraform/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,22 @@ class RakeTasks < ::Kitchen::RakeTasks
def define
super
namespace "kitchen" do
define_doctor
define_workspaces
end
end

def define_doctor
config.instances.get_all(/doctor-\w+/).group_by do |instance|
instance.platform.name
end.each_pair do |platform_name, instances|
desc "Run doctor-#{platform_name} test"
task "doctor-#{platform_name}" do
instances.each_entry(&:doctor_action)
end
end
end

def define_workspaces
config.instances.get_all(/workspace-\w+/).group_by do |instance|
instance.platform.name
Expand Down

0 comments on commit d84ef01

Please sign in to comment.