Skip to content

Commit

Permalink
Reverted to using kitchen-salt in order to get this out faster
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Jun 25, 2024
1 parent b131ae4 commit fc79848
Show file tree
Hide file tree
Showing 11 changed files with 436 additions and 65 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
separator: ","
files: |
bootstrap-salt.*
## DGM Gemfile
## DGM kitchen*.yml
btstrap-build*.yml
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
files_ignore: |
Expand Down Expand Up @@ -62,10 +61,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: 3.9

- name: Install Pre-Commit
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/templates/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
separator: ","
files: |
bootstrap-salt.*
## DGM Gemfile
## DGM kitchen*.yml
btstrap-build*.yml
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
files_ignore: |
Expand Down Expand Up @@ -62,10 +61,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: 3.9

- name: Install Pre-Commit
run: |
Expand Down
28 changes: 11 additions & 17 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ jobs:
- uses: actions/checkout@v3

## DGM Need to replace this
## DGM - name: Setup Ruby
## DGM uses: ruby/setup-ruby@v1
## DGM with:
## DGM ruby-version: 3.2.3
## DGM bundler-cache: true
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
## DGM ruby-version: 3.2.3
ruby-version: 2.6.10
bundler-cache: true

- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: 3.9

- name: Install Python Dependencies
run: |
Expand All @@ -57,27 +58,20 @@ jobs:
- name: Create Test Instance
run: |
## DGM Need to replace this
## DGM b
## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
## DGM
## DGM Need to select a GitHub runner here , ubuntu-latest
(sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
sleep 2
- name: Test Bootstrap
run: |
## DGM Need to replace this
## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to run the bootstrap tests for Linux here
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Destroy Test Instance
if: always()
run: |
## DGM Need to replace this
## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM this can be removed since using GitHub shared runners, and it should just close when done with it
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Set Exit Status
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ on:
default: 20
description: The timeout(in minutes) for the workflow

## DGM env:
## DGM KITCHEN_LOCAL_YAML: 'kitchen.macos.yml'
## DGM
env:
KITCHEN_LOCAL_YAML: 'kitchen.macos.yml'

## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for MacOS, do we need to do something similar for runners ?

jobs:
Expand All @@ -50,13 +50,14 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
## DGM ruby-version: 3.2.3
ruby-version: 2.6.10
bundler-cache: true

- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: 3.9

- name: Install Python Dependencies
run: |
Expand All @@ -65,25 +66,19 @@ jobs:
- name: Create Test Instance
run: |
## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
## DGM
## DGM Need to select a GitHub runner here , macos-latest
bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
(sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
sleep 2
- name: Test Bootstrap
run: |
## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to run the bootstrap tests for MacOS here
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Destroy Test Instance
if: always()
run: |
## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM this can be removed since using GitHub shared runners, and it should just close when done with it
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Set Exit Status
Expand Down
33 changes: 14 additions & 19 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ on:
default: 20
description: The timeout(in minutes) for the workflow

## DGM env:
## DGM machine_user: kitchen
## DGM machine_pass: Password1
## DGM machine_port: 5985
## DGM KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
## DGM
env:
machine_user: kitchen
machine_pass: Password1
machine_port: 5985
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'

## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for Windows, do we need to do something similar for runners ?

jobs:
Expand All @@ -53,7 +53,8 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
## DGM ruby-version: 3.2.3
ruby-version: 2.6.10
bundler-cache: true

- name: Install Chef
Expand Down Expand Up @@ -82,10 +83,10 @@ jobs:
winrm set winrm/config/service '@{AllowUnencrypted="True"}'
env
- name: Set up Python 3.10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: 3.9

- name: Install Python Dependencies
run: |
Expand All @@ -94,25 +95,19 @@ jobs:
- name: Create Test Instance
run: |
## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to select a GitHub runner here , ubuntu-latest
bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Test Bootstrap
run: |
## DGM env
## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to run the bootstrap tests for Windows here
env
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Destroy Test Instance
if: always()
run: |
## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM this can be removed since using GitHub shared runners, and it should just close when done with it
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
sleep 2
- name: Set Exit Status
Expand Down
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ repos:
args:
- requirements/release.in

## DGM - repo: https://github.com/asottile/pyupgrade
## DGM rev: v3.15.0
## DGM hooks:
## DGM - id: pyupgrade
## DGM name: Rewrite Code to be Py3.10+
## DGM args: [--py310-plus]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
name: Rewrite Code to be Py3.10+
args: [--py310-plus]
name: Rewrite Code to be Py3.9+
args: [--py39-plus]

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## What's Changed

- Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities
## DGM - Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities

- Migrated to using GitHub Actions
- Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7
- Removed support for FreeBSD and OpenBSD
Expand Down
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem 'test-kitchen', '>= 3.2.2'
gem 'kitchen-salt', '>= 0.7.2'
gem 'kitchen-docker', :git => 'https://github.com/test-kitchen/kitchen-docker.git', :branch => 'main'

group :vagrant do
gem 'kitchen-vagrant'
end
42 changes: 42 additions & 0 deletions kitchen.macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
driver:
name: exec

provisioner:
sudo: true
salt_bootstrap_options: -MP stable %s
init_environment: |
echo 'auto_accept: true' > /tmp/auto-accept-keys.conf
sudo mkdir -p /etc/salt/master.d
sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf
brew install coreutils
sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t'
platforms:
- name: macos-12
- name: macos-13

suites:
- name: stable-3006
provisioner:
salt_version: 3006
salt_call_command: /opt/salt/salt-call
- name: stable-3006-8
provisioner:
salt_version: 3006.8
salt_call_command: /opt/salt/salt-call
- name: stable-3007
provisioner:
salt_version: 3007
salt_call_command: /opt/salt/salt-call
- name: stable-3007-1
provisioner:
salt_version: 3007.1
salt_call_command: /opt/salt/salt-call
- name: latest
provisioner:
salt_version: latest
salt_call_command: /opt/salt/salt-call

verifier:
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/
42 changes: 42 additions & 0 deletions kitchen.windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
driver:
name: proxy
host: localhost
reset_command: "exit 0"
port: 5985
username: kitchen
password: Password1

provisioner:
salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1
salt_bootstrap_options: -Version %s -Verbose
init_environment: ''

platforms:
- name: windows-2022
- name: windows-2019

suites:
- name: stable-3006
provisioner:
salt_version: 3006
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: stable-3006-8
provisioner:
salt_version: 3006.8
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: stable-3007
provisioner:
salt_version: 3007
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: stable-3007-1
provisioner:
salt_version: 3007.1
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: latest
provisioner:
salt_version: latest
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe

verifier:
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/
Loading

0 comments on commit fc79848

Please sign in to comment.