Skip to content

Commit

Permalink
fix: RSpec issues (#638)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Dan Webb <[email protected]>
  • Loading branch information
damacus authored Jan 7, 2025
1 parent 485e5b3 commit 1928862
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 159 deletions.
23 changes: 23 additions & 0 deletions .github/actions/test-kitchen/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Test Kitchen Action'
description: 'Runs Test Kitchen tests with the specified suite and OS'
inputs:
suite:
description: 'Test suite to run'
required: true
os:
description: 'OS to test on'
required: true

runs:
using: "composite"
steps:
- name: Install Chef
uses: actionshub/[email protected]
- name: Dokken
uses: actionshub/[email protected]
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
with:
suite: ${{ inputs.suite }}
os: ${{ inputs.os }}
163 changes: 81 additions & 82 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: ci

jobs:
lint-unit:
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.1.1
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@main
permissions:
actions: write
checks: write
Expand All @@ -21,96 +21,95 @@ jobs:
needs: lint-unit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- "almalinux-8"
- "almalinux-9"
- "amazonlinux-2023"
- "centos-7"
- "centos-stream-8"
- "centos-stream-9"
- "debian-10"
- "debian-11"
- "opensuse-leap-15"
- "rockylinux-8"
- "rockylinux-9"
- "ubuntu-1804"
- "ubuntu-2004"
suite:
- "distro"
- "repo"
- "repo-overrides"
- "epel"
- "nginx-full"
[
"almalinux-8",
"almalinux-9",
"amazonlinux-2023",
"centos-stream-9",
"centos-stream-10",
"debian-11",
"debian-12",
"rockylinux-8",
"rockylinux-9",
"ubuntu-2204",
"ubuntu-2404",
]
suite: ["distro", "repo"]
exclude:
- os: "opensuse-leap-15"
- os: "centos-stream-10"
suite: "repo"
- os: "centos-7"
suite: "distro"
- os: "amazonlinux-2023"
suite: "epel"
- os: "debian-9"
suite: "epel"
- os: "debian-10"
suite: "epel"
- os: "debian-11"
suite: "epel"
- os: "ubuntu-1804"
suite: "epel"
- os: "ubuntu-2004"
suite: "epel"
- os: "fedora-latest"
suite: "epel"
- os: "opensuse-leap-15"
suite: "epel"
- os: "amazonlinux-2023"
suite: "nginx-full"
- os: "centos-7"
suite: "nginx-full"
- os: "centos-stream-8"
suite: "nginx-full"
- os: "centos-stream-9"
suite: "nginx-full"
- os: "almalinux-8"
suite: "nginx-full"
- os: "almalinux-9"
suite: "nginx-full"
- os: "rockylinux-8"
suite: "nginx-full"
- os: "rockylinux-9"
suite: "nginx-full"
- os: "amazonlinux"
suite: "nginx-full"
- os: "debian-10"
suite: "nginx-full"
- os: "debian-11"
suite: "nginx-full"
- os: "fedora-latest"
suite: "nginx-full"
- os: "opensuse-leap-15"
suite: "nginx-full"
- os: "amazonlinux-2023"
suite: "repo-overrides"
- os: "centos-7"
suite: "repo-overrides"
- os: "debian-10"
suite: "repo-overrides"
- os: "opensuse-leap-15"
suite: "repo-overrides"
- os: "ubuntu-1804"
suite: "repo-overrides"
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ./.github/actions/test-kitchen
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}

# TODO: This is currently broken
# integration-repo-overrides:
# needs: lint-unit
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# os: ["ubuntu-2204", "ubuntu-2404"]
# suite: ["repo-overrides"]
# steps:
# - name: Check out code
# uses: actions/checkout@v4
# - uses: ./.github/actions/test-kitchen
# with:
# suite: ${{ matrix.suite }}
# os: ${{ matrix.os }}

integration-epel:
needs: lint-unit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
[
"almalinux-8",
"almalinux-9",
"centos-stream-9",
"centos-stream-10",
"rockylinux-8",
"rockylinux-9",
]
suite: ["epel"]
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ./.github/actions/test-kitchen
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}

integration-nginx-full:
needs: lint-unit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: ["ubuntu-2204", "ubuntu-2404"]
suite: ["distro-nginx-full"]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Chef
uses: actionshub/[email protected]
- name: Dokken
uses: actionshub/[email protected]
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
- uses: ./.github/actions/test-kitchen
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}

final:
runs-on: ubuntu-latest
needs: [integration, integration-nginx-full, integration-epel]
steps:
- run: echo ${{needs.integration.outputs}}
- run: echo ${{needs.integration-nginx-full.outputs}}
- run: echo ${{needs.integration-epel.outputs}}
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
- cookstyle
23 changes: 2 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,21 @@ This file is used to list changes made in each version of the nginx cookbook.

## Unreleased

## 12.2.11 - *2024-11-18*

Standardise files with files in sous-chefs/repo-management

Standardise files with files in sous-chefs/repo-management
Fix Rspec issues
Update workflows

## 12.2.10 - *2024-07-10*

Standardise files with files in sous-chefs/repo-management

Standardise files with files in sous-chefs/repo-management

## 12.2.9 - *2024-05-02*

## 12.2.8 - *2024-05-02*

## 12.2.7 - *2023-12-27*

## 12.2.6 - *2023-12-27*

Remove Fedora Linux from test matrix

## 12.2.5 - *2023-09-28*

## 12.2.4 - *2023-09-28*

## 12.2.3 - *2023-08-20*

- Skip creation of the list directory resource if the directory already exists as it is managed elsewhere

## 12.2.2 - *2023-07-10*

## 12.2.1 - *2023-05-17*

## 12.2.0 - *2023-04-13*

- Fix installation on EL9 platforms
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ The following cookbooks are direct dependencies because they're used for common

The following platforms are supported and tested with Test Kitchen:

- Amazon Linux 2
- CentOS 7
- Debian 8+
- Fedora 30
- openSUSE Leap 15
- Ubuntu 16.04+

Other Debian and RHEL family distributions are assumed to work.
- AlmaLinux 8/9
- Rocky Linux 8/9
- CentOS Stream 8/9
- Amazon Linux 2023
- Debian 11/12
- Ubuntu 22.04/24.04

### Chef

- Chef 14+
- Chef 15.3+

## Resources

Expand Down
2 changes: 1 addition & 1 deletion kitchen.global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ platforms:
- name: almalinux-8
- name: almalinux-9
- name: amazonlinux-2023
- name: centos-stream-9
- name: centos-stream-10
- name: debian-11
- name: debian-12
- name: fedora-latest
Expand Down
36 changes: 12 additions & 24 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,24 @@ verifier:
name: inspec

platforms:
- name: amazonlinux-2023
- name: almalinux-8
- name: amazonlinux-2
- name: centos-7
- name: centos-stream-8
- name: debian-10
- name: almalinux-9
- name: rockylinux-8
- name: rockylinux-9
- name: centos-stream-9
- name: centos-stream-10
- name: debian-11
- name: debian-12
- name: fedora-latest
- name: opensuse-leap-15
- name: rockylinux-8
- name: ubuntu-18.04
- name: ubuntu-20.04
- name: ubuntu-22.04
- name: ubuntu-24.04

suites:
- name: distro
run_list:
- recipe[test::distro]
- recipe[test::test_site]
excludes:
- centos-7
verifier:
inspec_tests:
- test/integration/default
Expand All @@ -43,8 +42,8 @@ suites:
- recipe[test::distro_nginx-full]
- recipe[test::test_site]
includes:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
verifier:
inspec_tests:
- test/integration/default
Expand All @@ -62,16 +61,6 @@ suites:
run_list:
- recipe[test::repo_overrides]
- recipe[test::test_site]
includes:
- almalinux-8
- almalinux-9
- centos-stream-8
- centos-stream-9
- debian-11
- fedora-latest
- rockylinux-8
- rockylinux-9
- ubuntu-20.04
verifier:
inspec_tests:
- test/integration/default
Expand All @@ -84,9 +73,8 @@ suites:
includes:
- almalinux-8
- almalinux-9
- centos-7
- centos-stream-8
- centos-stream-9
- centos-stream-10
- rockylinux-8
- rockylinux-9
verifier:
Expand Down
2 changes: 1 addition & 1 deletion libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def repo_url(train = 'stable')
else
"#{repo_base_url}/amzn/#{node['platform_version'].to_i}/$basearch"
end
when 'centos'
when 'centos', 'centos-stream'
"#{repo_base_url}/centos/#{node['platform_version'].to_i}/$basearch"
when 'fedora'
"#{repo_base_url}/rhel/9/$basearch"
Expand Down
Loading

0 comments on commit 1928862

Please sign in to comment.