From 737fd5b635a606d2204e5821a621fff32d5e1224 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Fri, 2 Aug 2024 22:22:53 -0700 Subject: [PATCH] CI Fixes Signed-off-by: Lance Albertson --- .github/workflows/ci.yml | 8 +++++++- CHANGELOG.md | 2 ++ kitchen.yml | 3 ++- .../docker_test/recipes/installation_package.rb | 12 ------------ .../inspec/assert_functioning_spec.rb | 13 +++---------- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81a1504f7..c79e49f16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: integration-smoke: needs: lint-unit - runs-on: macos-12 + runs-on: ubuntu-latest strategy: matrix: os: @@ -119,6 +119,12 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + - name: Install VirtualBox & Vagrant + run: | + sudo apt update && sudo apt install virtualbox + wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + sudo apt update && sudo apt install vagrant - name: Install Chef uses: actionshub/chef-install@3.0.0 - name: Dokken diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f7c07809..df6ebbe2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased - Add `none` as an option to `service_manager` to allow using the system defaults +- Switch to running vagrant+virtualbox on Ubuntu via nested virtualization for smoke tests +- Fix package installation tests ## 11.4.2 - *2024-07-16* diff --git a/kitchen.yml b/kitchen.yml index ccf96395b..38e6f8f82 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -8,10 +8,11 @@ driver: provisioner: name: chef_infra product_name: <%= ENV['CHEF_PRODUCT_NAME'] || 'chef' %> - product_version: <%= ENV['CHEF_VERSION'] || '17' %> + product_version: <%= ENV['CHEF_VERSION'] || '18' %> enforce_idempotency: true multiple_converge: 2 deprecations_as_errors: true + chef_license: accept-no-persist verifier: name: inspec diff --git a/test/cookbooks/docker_test/recipes/installation_package.rb b/test/cookbooks/docker_test/recipes/installation_package.rb index 7207c8e36..68483642b 100644 --- a/test/cookbooks/docker_test/recipes/installation_package.rb +++ b/test/cookbooks/docker_test/recipes/installation_package.rb @@ -1,15 +1,3 @@ -docker_ver = - # Include epoch on RHEL to fix idempotency issues - if platform_family?('rhel', 'fedora') - '3:20.10.11' - # Debian 9 does not include 20.10 - elsif platform?('debian') && node['platform_version'].to_i == 9 - '19.03.14' - else - '20.10.11' - end - docker_installation_package 'default' do - version docker_ver action :create end diff --git a/test/integration/installation_package/inspec/assert_functioning_spec.rb b/test/integration/installation_package/inspec/assert_functioning_spec.rb index 337d8a715..1e9b8a828 100644 --- a/test/integration/installation_package/inspec/assert_functioning_spec.rb +++ b/test/integration/installation_package/inspec/assert_functioning_spec.rb @@ -1,11 +1,4 @@ -if os.family == 'redhat' && os.release.to_i == 8 - describe command('/usr/bin/docker --version') do - its(:exit_status) { should eq 0 } - its(:stdout) { should match(/26\.1\./) } - end -else - describe command('/usr/bin/docker --version') do - its(:exit_status) { should eq 0 } - its(:stdout) { should match(/27\.1\./) } - end +describe command('/usr/bin/docker --version') do + its(:exit_status) { should eq 0 } + its(:stdout) { should match(/2[0-9]\.[0-9]+\./) } end